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 deleted file mode 100644 index 80fd7da717a7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java +++ /dev/null @@ -1,1275 +0,0 @@ -// Copyright (c) Microsoft Corporation. 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.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Configuration; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityCenter; -import com.azure.resourcemanager.security.implementation.AdaptiveApplicationControlsImpl; -import com.azure.resourcemanager.security.implementation.AdaptiveNetworkHardeningsImpl; -import com.azure.resourcemanager.security.implementation.AdvancedThreatProtectionsImpl; -import com.azure.resourcemanager.security.implementation.AlertsImpl; -import com.azure.resourcemanager.security.implementation.AlertsSuppressionRulesImpl; -import com.azure.resourcemanager.security.implementation.AllowedConnectionsImpl; -import com.azure.resourcemanager.security.implementation.ApiCollectionOffboardingsImpl; -import com.azure.resourcemanager.security.implementation.ApiCollectionOnboardingsImpl; -import com.azure.resourcemanager.security.implementation.ApiCollectionsImpl; -import com.azure.resourcemanager.security.implementation.ApplicationOperationsImpl; -import com.azure.resourcemanager.security.implementation.ApplicationsImpl; -import com.azure.resourcemanager.security.implementation.AssessmentsImpl; -import com.azure.resourcemanager.security.implementation.AssessmentsMetadatasImpl; -import com.azure.resourcemanager.security.implementation.AutoProvisioningSettingsImpl; -import com.azure.resourcemanager.security.implementation.AutomationsImpl; -import com.azure.resourcemanager.security.implementation.ComplianceResultsImpl; -import com.azure.resourcemanager.security.implementation.CompliancesImpl; -import com.azure.resourcemanager.security.implementation.ConnectorsImpl; -import com.azure.resourcemanager.security.implementation.CustomAssessmentAutomationsImpl; -import com.azure.resourcemanager.security.implementation.CustomEntityStoreAssignmentsImpl; -import com.azure.resourcemanager.security.implementation.DeviceSecurityGroupsImpl; -import com.azure.resourcemanager.security.implementation.DiscoveredSecuritySolutionsImpl; -import com.azure.resourcemanager.security.implementation.ExternalSecuritySolutionsImpl; -import com.azure.resourcemanager.security.implementation.GovernanceAssignmentsImpl; -import com.azure.resourcemanager.security.implementation.GovernanceRulesImpl; -import com.azure.resourcemanager.security.implementation.HealthReportOperationsImpl; -import com.azure.resourcemanager.security.implementation.HealthReportsImpl; -import com.azure.resourcemanager.security.implementation.InformationProtectionPoliciesImpl; -import com.azure.resourcemanager.security.implementation.IngestionSettingsImpl; -import com.azure.resourcemanager.security.implementation.IotSecuritySolutionAnalyticsImpl; -import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsAggregatedAlertsImpl; -import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsAnalyticsRecommendationsImpl; -import com.azure.resourcemanager.security.implementation.IotSecuritySolutionsImpl; -import com.azure.resourcemanager.security.implementation.JitNetworkAccessPoliciesImpl; -import com.azure.resourcemanager.security.implementation.LocationsImpl; -import com.azure.resourcemanager.security.implementation.MdeOnboardingsImpl; -import com.azure.resourcemanager.security.implementation.OperationsImpl; -import com.azure.resourcemanager.security.implementation.PricingsImpl; -import com.azure.resourcemanager.security.implementation.RegulatoryComplianceAssessmentsImpl; -import com.azure.resourcemanager.security.implementation.RegulatoryComplianceControlsImpl; -import com.azure.resourcemanager.security.implementation.RegulatoryComplianceStandardsImpl; -import com.azure.resourcemanager.security.implementation.SecureScoreControlDefinitionsImpl; -import com.azure.resourcemanager.security.implementation.SecureScoreControlsImpl; -import com.azure.resourcemanager.security.implementation.SecureScoresImpl; -import com.azure.resourcemanager.security.implementation.SecurityCenterBuilder; -import com.azure.resourcemanager.security.implementation.SecurityConnectorApplicationOperationsImpl; -import com.azure.resourcemanager.security.implementation.SecurityConnectorApplicationsImpl; -import com.azure.resourcemanager.security.implementation.SecurityConnectorsImpl; -import com.azure.resourcemanager.security.implementation.SecurityContactsImpl; -import com.azure.resourcemanager.security.implementation.SecurityOperatorsImpl; -import com.azure.resourcemanager.security.implementation.SecuritySolutionsImpl; -import com.azure.resourcemanager.security.implementation.SecuritySolutionsReferenceDatasImpl; -import com.azure.resourcemanager.security.implementation.ServerVulnerabilityAssessmentsImpl; -import com.azure.resourcemanager.security.implementation.SettingsImpl; -import com.azure.resourcemanager.security.implementation.SoftwareInventoriesImpl; -import com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentBaselineRulesImpl; -import com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentScanResultsImpl; -import com.azure.resourcemanager.security.implementation.SqlVulnerabilityAssessmentScansImpl; -import com.azure.resourcemanager.security.implementation.SubAssessmentsImpl; -import com.azure.resourcemanager.security.implementation.TasksImpl; -import com.azure.resourcemanager.security.implementation.TopologiesImpl; -import com.azure.resourcemanager.security.implementation.WorkspaceSettingsImpl; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControls; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardenings; -import com.azure.resourcemanager.security.models.AdvancedThreatProtections; -import com.azure.resourcemanager.security.models.Alerts; -import com.azure.resourcemanager.security.models.AlertsSuppressionRules; -import com.azure.resourcemanager.security.models.AllowedConnections; -import com.azure.resourcemanager.security.models.ApiCollectionOffboardings; -import com.azure.resourcemanager.security.models.ApiCollectionOnboardings; -import com.azure.resourcemanager.security.models.ApiCollections; -import com.azure.resourcemanager.security.models.ApplicationOperations; -import com.azure.resourcemanager.security.models.Applications; -import com.azure.resourcemanager.security.models.Assessments; -import com.azure.resourcemanager.security.models.AssessmentsMetadatas; -import com.azure.resourcemanager.security.models.AutoProvisioningSettings; -import com.azure.resourcemanager.security.models.Automations; -import com.azure.resourcemanager.security.models.ComplianceResults; -import com.azure.resourcemanager.security.models.Compliances; -import com.azure.resourcemanager.security.models.Connectors; -import com.azure.resourcemanager.security.models.CustomAssessmentAutomations; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignments; -import com.azure.resourcemanager.security.models.DeviceSecurityGroups; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolutions; -import com.azure.resourcemanager.security.models.ExternalSecuritySolutions; -import com.azure.resourcemanager.security.models.GovernanceAssignments; -import com.azure.resourcemanager.security.models.GovernanceRules; -import com.azure.resourcemanager.security.models.HealthReportOperations; -import com.azure.resourcemanager.security.models.HealthReports; -import com.azure.resourcemanager.security.models.InformationProtectionPolicies; -import com.azure.resourcemanager.security.models.IngestionSettings; -import com.azure.resourcemanager.security.models.IotSecuritySolutionAnalytics; -import com.azure.resourcemanager.security.models.IotSecuritySolutions; -import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsAggregatedAlerts; -import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsRecommendations; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicies; -import com.azure.resourcemanager.security.models.Locations; -import com.azure.resourcemanager.security.models.MdeOnboardings; -import com.azure.resourcemanager.security.models.Operations; -import com.azure.resourcemanager.security.models.Pricings; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessments; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControls; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandards; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitions; -import com.azure.resourcemanager.security.models.SecureScoreControls; -import com.azure.resourcemanager.security.models.SecureScores; -import com.azure.resourcemanager.security.models.SecurityConnectorApplicationOperations; -import com.azure.resourcemanager.security.models.SecurityConnectorApplications; -import com.azure.resourcemanager.security.models.SecurityConnectors; -import com.azure.resourcemanager.security.models.SecurityContacts; -import com.azure.resourcemanager.security.models.SecurityOperators; -import com.azure.resourcemanager.security.models.SecuritySolutions; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDatas; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessments; -import com.azure.resourcemanager.security.models.Settings; -import com.azure.resourcemanager.security.models.SoftwareInventories; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentBaselineRules; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScanResults; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScans; -import com.azure.resourcemanager.security.models.SubAssessments; -import com.azure.resourcemanager.security.models.Tasks; -import com.azure.resourcemanager.security.models.Topologies; -import com.azure.resourcemanager.security.models.WorkspaceSettings; -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -/** Entry point to SecurityManager. API spec for Microsoft.Security (Azure Security Center) resource provider. */ -public final class SecurityManager { - private MdeOnboardings mdeOnboardings; - - private CustomAssessmentAutomations customAssessmentAutomations; - - private CustomEntityStoreAssignments customEntityStoreAssignments; - - private ComplianceResults complianceResults; - - private Pricings pricings; - - private AdvancedThreatProtections advancedThreatProtections; - - private DeviceSecurityGroups deviceSecurityGroups; - - private IotSecuritySolutions iotSecuritySolutions; - - private IotSecuritySolutionAnalytics iotSecuritySolutionAnalytics; - - private IotSecuritySolutionsAnalyticsAggregatedAlerts iotSecuritySolutionsAnalyticsAggregatedAlerts; - - private IotSecuritySolutionsAnalyticsRecommendations iotSecuritySolutionsAnalyticsRecommendations; - - private Locations locations; - - private Operations operations; - - private Tasks tasks; - - private AutoProvisioningSettings autoProvisioningSettings; - - private Compliances compliances; - - private InformationProtectionPolicies informationProtectionPolicies; - - private SecurityContacts securityContacts; - - private WorkspaceSettings workspaceSettings; - - private RegulatoryComplianceStandards regulatoryComplianceStandards; - - private RegulatoryComplianceControls regulatoryComplianceControls; - - private RegulatoryComplianceAssessments regulatoryComplianceAssessments; - - private SubAssessments subAssessments; - - private Automations automations; - - private AlertsSuppressionRules alertsSuppressionRules; - - private ServerVulnerabilityAssessments serverVulnerabilityAssessments; - - private AssessmentsMetadatas assessmentsMetadatas; - - private Assessments assessments; - - private AdaptiveApplicationControls adaptiveApplicationControls; - - private AdaptiveNetworkHardenings adaptiveNetworkHardenings; - - private AllowedConnections allowedConnections; - - private Topologies topologies; - - private JitNetworkAccessPolicies jitNetworkAccessPolicies; - - private DiscoveredSecuritySolutions discoveredSecuritySolutions; - - private SecuritySolutionsReferenceDatas securitySolutionsReferenceDatas; - - private ExternalSecuritySolutions externalSecuritySolutions; - - private SecureScores secureScores; - - private SecureScoreControls secureScoreControls; - - private SecureScoreControlDefinitions secureScoreControlDefinitions; - - private SecuritySolutions securitySolutions; - - private Connectors connectors; - - private Alerts alerts; - - private Settings settings; - - private IngestionSettings ingestionSettings; - - private SoftwareInventories softwareInventories; - - private GovernanceRules governanceRules; - - private GovernanceAssignments governanceAssignments; - - private Applications applications; - - private ApplicationOperations applicationOperations; - - private SecurityConnectorApplications securityConnectorApplications; - - private SecurityConnectorApplicationOperations securityConnectorApplicationOperations; - - private ApiCollections apiCollections; - - private ApiCollectionOnboardings apiCollectionOnboardings; - - private ApiCollectionOffboardings apiCollectionOffboardings; - - private HealthReports healthReports; - - private HealthReportOperations healthReportOperations; - - private SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans; - - private SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults; - - private SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules; - - private SecurityConnectors securityConnectors; - - private SecurityOperators securityOperators; - - private final SecurityCenter clientObject; - - private SecurityManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new SecurityCenterBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); - } - - /** - * Creates an instance of Security service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the Security service API instance. - */ - public static SecurityManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return configure().authenticate(credential, profile); - } - - /** - * Creates an instance of Security service API entry point. - * - * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. - * @param profile the Azure profile for client. - * @return the Security service API instance. - */ - public static SecurityManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new SecurityManager(httpPipeline, profile, null); - } - - /** - * Gets a Configurable instance that can be used to create SecurityManager with optional configuration. - * - * @return the Configurable instance allowing configurations. - */ - public static Configurable configure() { - return new SecurityManager.Configurable(); - } - - /** The Configurable allowing configurations to be set. */ - public static final class Configurable { - private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); - - private HttpClient httpClient; - private HttpLogOptions httpLogOptions; - private final List policies = new ArrayList<>(); - private final List scopes = new ArrayList<>(); - private RetryPolicy retryPolicy; - private RetryOptions retryOptions; - private Duration defaultPollInterval; - - private Configurable() { - } - - /** - * Sets the http client. - * - * @param httpClient the HTTP client. - * @return the configurable object itself. - */ - public Configurable withHttpClient(HttpClient httpClient) { - this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); - return this; - } - - /** - * Sets the logging options to the HTTP pipeline. - * - * @param httpLogOptions the HTTP log options. - * @return the configurable object itself. - */ - public Configurable withLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); - return this; - } - - /** - * Adds the pipeline policy to the HTTP pipeline. - * - * @param policy the HTTP pipeline policy. - * @return the configurable object itself. - */ - public Configurable withPolicy(HttpPipelinePolicy policy) { - this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); - return this; - } - - /** - * Adds the scope to permission sets. - * - * @param scope the scope. - * @return the configurable object itself. - */ - public Configurable withScope(String scope) { - this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); - return this; - } - - /** - * Sets the retry policy to the HTTP pipeline. - * - * @param retryPolicy the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); - return this; - } - - /** - * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. - * - * @param retryOptions the retry options for the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryOptions(RetryOptions retryOptions) { - this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); - return this; - } - - /** - * Sets the default poll interval, used when service does not provide "Retry-After" header. - * - * @param defaultPollInterval the default poll interval. - * @return the configurable object itself. - */ - public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); - if (this.defaultPollInterval.isNegative()) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); - } - return this; - } - - /** - * Creates an instance of Security service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the Security service API instance. - */ - public SecurityManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - - StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") - .append("-") - .append("com.azure.resourcemanager.security") - .append("/") - .append("1.0.0-beta.5"); - if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); - } else { - userAgentBuilder.append(" (auto-generated)"); - } - - if (scopes.isEmpty()) { - scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); - } - if (retryPolicy == null) { - if (retryOptions != null) { - retryPolicy = new RetryPolicy(retryOptions); - } else { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); - } - } - List policies = new ArrayList<>(); - policies.add(new UserAgentPolicy(userAgentBuilder.toString())); - policies.add(new AddHeadersFromContextPolicy()); - policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy); - policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - return new SecurityManager(httpPipeline, profile, defaultPollInterval); - } - } - - /** - * Gets the resource collection API of MdeOnboardings. - * - * @return Resource collection API of MdeOnboardings. - */ - public MdeOnboardings mdeOnboardings() { - if (this.mdeOnboardings == null) { - this.mdeOnboardings = new MdeOnboardingsImpl(clientObject.getMdeOnboardings(), this); - } - return mdeOnboardings; - } - - /** - * Gets the resource collection API of CustomAssessmentAutomations. It manages CustomAssessmentAutomation. - * - * @return Resource collection API of CustomAssessmentAutomations. - */ - public CustomAssessmentAutomations customAssessmentAutomations() { - if (this.customAssessmentAutomations == null) { - this.customAssessmentAutomations = - new CustomAssessmentAutomationsImpl(clientObject.getCustomAssessmentAutomations(), this); - } - return customAssessmentAutomations; - } - - /** - * Gets the resource collection API of CustomEntityStoreAssignments. It manages CustomEntityStoreAssignment. - * - * @return Resource collection API of CustomEntityStoreAssignments. - */ - public CustomEntityStoreAssignments customEntityStoreAssignments() { - if (this.customEntityStoreAssignments == null) { - this.customEntityStoreAssignments = - new CustomEntityStoreAssignmentsImpl(clientObject.getCustomEntityStoreAssignments(), this); - } - return customEntityStoreAssignments; - } - - /** - * Gets the resource collection API of ComplianceResults. - * - * @return Resource collection API of ComplianceResults. - */ - public ComplianceResults complianceResults() { - if (this.complianceResults == null) { - this.complianceResults = new ComplianceResultsImpl(clientObject.getComplianceResults(), this); - } - return complianceResults; - } - - /** - * Gets the resource collection API of Pricings. - * - * @return Resource collection API of Pricings. - */ - public Pricings pricings() { - if (this.pricings == null) { - this.pricings = new PricingsImpl(clientObject.getPricings(), this); - } - return pricings; - } - - /** - * Gets the resource collection API of AdvancedThreatProtections. It manages AdvancedThreatProtectionSetting. - * - * @return Resource collection API of AdvancedThreatProtections. - */ - public AdvancedThreatProtections advancedThreatProtections() { - if (this.advancedThreatProtections == null) { - this.advancedThreatProtections = - new AdvancedThreatProtectionsImpl(clientObject.getAdvancedThreatProtections(), this); - } - return advancedThreatProtections; - } - - /** - * Gets the resource collection API of DeviceSecurityGroups. It manages DeviceSecurityGroup. - * - * @return Resource collection API of DeviceSecurityGroups. - */ - public DeviceSecurityGroups deviceSecurityGroups() { - if (this.deviceSecurityGroups == null) { - this.deviceSecurityGroups = new DeviceSecurityGroupsImpl(clientObject.getDeviceSecurityGroups(), this); - } - return deviceSecurityGroups; - } - - /** - * Gets the resource collection API of IotSecuritySolutions. It manages IoTSecuritySolutionModel. - * - * @return Resource collection API of IotSecuritySolutions. - */ - public IotSecuritySolutions iotSecuritySolutions() { - if (this.iotSecuritySolutions == null) { - this.iotSecuritySolutions = new IotSecuritySolutionsImpl(clientObject.getIotSecuritySolutions(), this); - } - return iotSecuritySolutions; - } - - /** - * Gets the resource collection API of IotSecuritySolutionAnalytics. - * - * @return Resource collection API of IotSecuritySolutionAnalytics. - */ - public IotSecuritySolutionAnalytics iotSecuritySolutionAnalytics() { - if (this.iotSecuritySolutionAnalytics == null) { - this.iotSecuritySolutionAnalytics = - new IotSecuritySolutionAnalyticsImpl(clientObject.getIotSecuritySolutionAnalytics(), this); - } - return iotSecuritySolutionAnalytics; - } - - /** - * Gets the resource collection API of IotSecuritySolutionsAnalyticsAggregatedAlerts. - * - * @return Resource collection API of IotSecuritySolutionsAnalyticsAggregatedAlerts. - */ - public IotSecuritySolutionsAnalyticsAggregatedAlerts iotSecuritySolutionsAnalyticsAggregatedAlerts() { - if (this.iotSecuritySolutionsAnalyticsAggregatedAlerts == null) { - this.iotSecuritySolutionsAnalyticsAggregatedAlerts = - new IotSecuritySolutionsAnalyticsAggregatedAlertsImpl( - clientObject.getIotSecuritySolutionsAnalyticsAggregatedAlerts(), this); - } - return iotSecuritySolutionsAnalyticsAggregatedAlerts; - } - - /** - * Gets the resource collection API of IotSecuritySolutionsAnalyticsRecommendations. - * - * @return Resource collection API of IotSecuritySolutionsAnalyticsRecommendations. - */ - public IotSecuritySolutionsAnalyticsRecommendations iotSecuritySolutionsAnalyticsRecommendations() { - if (this.iotSecuritySolutionsAnalyticsRecommendations == null) { - this.iotSecuritySolutionsAnalyticsRecommendations = - new IotSecuritySolutionsAnalyticsRecommendationsImpl( - clientObject.getIotSecuritySolutionsAnalyticsRecommendations(), this); - } - return iotSecuritySolutionsAnalyticsRecommendations; - } - - /** - * Gets the resource collection API of Locations. - * - * @return Resource collection API of Locations. - */ - public Locations locations() { - if (this.locations == null) { - this.locations = new LocationsImpl(clientObject.getLocations(), this); - } - return locations; - } - - /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - - /** - * Gets the resource collection API of Tasks. - * - * @return Resource collection API of Tasks. - */ - public Tasks tasks() { - if (this.tasks == null) { - this.tasks = new TasksImpl(clientObject.getTasks(), this); - } - return tasks; - } - - /** - * Gets the resource collection API of AutoProvisioningSettings. It manages AutoProvisioningSetting. - * - * @return Resource collection API of AutoProvisioningSettings. - */ - public AutoProvisioningSettings autoProvisioningSettings() { - if (this.autoProvisioningSettings == null) { - this.autoProvisioningSettings = - new AutoProvisioningSettingsImpl(clientObject.getAutoProvisioningSettings(), this); - } - return autoProvisioningSettings; - } - - /** - * Gets the resource collection API of Compliances. - * - * @return Resource collection API of Compliances. - */ - public Compliances compliances() { - if (this.compliances == null) { - this.compliances = new CompliancesImpl(clientObject.getCompliances(), this); - } - return compliances; - } - - /** - * Gets the resource collection API of InformationProtectionPolicies. It manages InformationProtectionPolicy. - * - * @return Resource collection API of InformationProtectionPolicies. - */ - public InformationProtectionPolicies informationProtectionPolicies() { - if (this.informationProtectionPolicies == null) { - this.informationProtectionPolicies = - new InformationProtectionPoliciesImpl(clientObject.getInformationProtectionPolicies(), this); - } - return informationProtectionPolicies; - } - - /** - * Gets the resource collection API of SecurityContacts. It manages SecurityContact. - * - * @return Resource collection API of SecurityContacts. - */ - public SecurityContacts securityContacts() { - if (this.securityContacts == null) { - this.securityContacts = new SecurityContactsImpl(clientObject.getSecurityContacts(), this); - } - return securityContacts; - } - - /** - * Gets the resource collection API of WorkspaceSettings. It manages WorkspaceSetting. - * - * @return Resource collection API of WorkspaceSettings. - */ - public WorkspaceSettings workspaceSettings() { - if (this.workspaceSettings == null) { - this.workspaceSettings = new WorkspaceSettingsImpl(clientObject.getWorkspaceSettings(), this); - } - return workspaceSettings; - } - - /** - * Gets the resource collection API of RegulatoryComplianceStandards. - * - * @return Resource collection API of RegulatoryComplianceStandards. - */ - public RegulatoryComplianceStandards regulatoryComplianceStandards() { - if (this.regulatoryComplianceStandards == null) { - this.regulatoryComplianceStandards = - new RegulatoryComplianceStandardsImpl(clientObject.getRegulatoryComplianceStandards(), this); - } - return regulatoryComplianceStandards; - } - - /** - * Gets the resource collection API of RegulatoryComplianceControls. - * - * @return Resource collection API of RegulatoryComplianceControls. - */ - public RegulatoryComplianceControls regulatoryComplianceControls() { - if (this.regulatoryComplianceControls == null) { - this.regulatoryComplianceControls = - new RegulatoryComplianceControlsImpl(clientObject.getRegulatoryComplianceControls(), this); - } - return regulatoryComplianceControls; - } - - /** - * Gets the resource collection API of RegulatoryComplianceAssessments. - * - * @return Resource collection API of RegulatoryComplianceAssessments. - */ - public RegulatoryComplianceAssessments regulatoryComplianceAssessments() { - if (this.regulatoryComplianceAssessments == null) { - this.regulatoryComplianceAssessments = - new RegulatoryComplianceAssessmentsImpl(clientObject.getRegulatoryComplianceAssessments(), this); - } - return regulatoryComplianceAssessments; - } - - /** - * Gets the resource collection API of SubAssessments. - * - * @return Resource collection API of SubAssessments. - */ - public SubAssessments subAssessments() { - if (this.subAssessments == null) { - this.subAssessments = new SubAssessmentsImpl(clientObject.getSubAssessments(), this); - } - return subAssessments; - } - - /** - * Gets the resource collection API of Automations. It manages Automation. - * - * @return Resource collection API of Automations. - */ - public Automations automations() { - if (this.automations == null) { - this.automations = new AutomationsImpl(clientObject.getAutomations(), this); - } - return automations; - } - - /** - * Gets the resource collection API of AlertsSuppressionRules. - * - * @return Resource collection API of AlertsSuppressionRules. - */ - public AlertsSuppressionRules alertsSuppressionRules() { - if (this.alertsSuppressionRules == null) { - this.alertsSuppressionRules = - new AlertsSuppressionRulesImpl(clientObject.getAlertsSuppressionRules(), this); - } - return alertsSuppressionRules; - } - - /** - * Gets the resource collection API of ServerVulnerabilityAssessments. - * - * @return Resource collection API of ServerVulnerabilityAssessments. - */ - public ServerVulnerabilityAssessments serverVulnerabilityAssessments() { - if (this.serverVulnerabilityAssessments == null) { - this.serverVulnerabilityAssessments = - new ServerVulnerabilityAssessmentsImpl(clientObject.getServerVulnerabilityAssessments(), this); - } - return serverVulnerabilityAssessments; - } - - /** - * Gets the resource collection API of AssessmentsMetadatas. It manages SecurityAssessmentMetadataResponse. - * - * @return Resource collection API of AssessmentsMetadatas. - */ - public AssessmentsMetadatas assessmentsMetadatas() { - if (this.assessmentsMetadatas == null) { - this.assessmentsMetadatas = new AssessmentsMetadatasImpl(clientObject.getAssessmentsMetadatas(), this); - } - return assessmentsMetadatas; - } - - /** - * Gets the resource collection API of Assessments. It manages SecurityAssessmentResponse. - * - * @return Resource collection API of Assessments. - */ - public Assessments assessments() { - if (this.assessments == null) { - this.assessments = new AssessmentsImpl(clientObject.getAssessments(), this); - } - return assessments; - } - - /** - * Gets the resource collection API of AdaptiveApplicationControls. It manages AdaptiveApplicationControlGroup. - * - * @return Resource collection API of AdaptiveApplicationControls. - */ - public AdaptiveApplicationControls adaptiveApplicationControls() { - if (this.adaptiveApplicationControls == null) { - this.adaptiveApplicationControls = - new AdaptiveApplicationControlsImpl(clientObject.getAdaptiveApplicationControls(), this); - } - return adaptiveApplicationControls; - } - - /** - * Gets the resource collection API of AdaptiveNetworkHardenings. - * - * @return Resource collection API of AdaptiveNetworkHardenings. - */ - public AdaptiveNetworkHardenings adaptiveNetworkHardenings() { - if (this.adaptiveNetworkHardenings == null) { - this.adaptiveNetworkHardenings = - new AdaptiveNetworkHardeningsImpl(clientObject.getAdaptiveNetworkHardenings(), this); - } - return adaptiveNetworkHardenings; - } - - /** - * Gets the resource collection API of AllowedConnections. - * - * @return Resource collection API of AllowedConnections. - */ - public AllowedConnections allowedConnections() { - if (this.allowedConnections == null) { - this.allowedConnections = new AllowedConnectionsImpl(clientObject.getAllowedConnections(), this); - } - return allowedConnections; - } - - /** - * Gets the resource collection API of Topologies. - * - * @return Resource collection API of Topologies. - */ - public Topologies topologies() { - if (this.topologies == null) { - this.topologies = new TopologiesImpl(clientObject.getTopologies(), this); - } - return topologies; - } - - /** - * Gets the resource collection API of JitNetworkAccessPolicies. It manages JitNetworkAccessPolicy. - * - * @return Resource collection API of JitNetworkAccessPolicies. - */ - public JitNetworkAccessPolicies jitNetworkAccessPolicies() { - if (this.jitNetworkAccessPolicies == null) { - this.jitNetworkAccessPolicies = - new JitNetworkAccessPoliciesImpl(clientObject.getJitNetworkAccessPolicies(), this); - } - return jitNetworkAccessPolicies; - } - - /** - * Gets the resource collection API of DiscoveredSecuritySolutions. - * - * @return Resource collection API of DiscoveredSecuritySolutions. - */ - public DiscoveredSecuritySolutions discoveredSecuritySolutions() { - if (this.discoveredSecuritySolutions == null) { - this.discoveredSecuritySolutions = - new DiscoveredSecuritySolutionsImpl(clientObject.getDiscoveredSecuritySolutions(), this); - } - return discoveredSecuritySolutions; - } - - /** - * Gets the resource collection API of SecuritySolutionsReferenceDatas. - * - * @return Resource collection API of SecuritySolutionsReferenceDatas. - */ - public SecuritySolutionsReferenceDatas securitySolutionsReferenceDatas() { - if (this.securitySolutionsReferenceDatas == null) { - this.securitySolutionsReferenceDatas = - new SecuritySolutionsReferenceDatasImpl(clientObject.getSecuritySolutionsReferenceDatas(), this); - } - return securitySolutionsReferenceDatas; - } - - /** - * Gets the resource collection API of ExternalSecuritySolutions. - * - * @return Resource collection API of ExternalSecuritySolutions. - */ - public ExternalSecuritySolutions externalSecuritySolutions() { - if (this.externalSecuritySolutions == null) { - this.externalSecuritySolutions = - new ExternalSecuritySolutionsImpl(clientObject.getExternalSecuritySolutions(), this); - } - return externalSecuritySolutions; - } - - /** - * Gets the resource collection API of SecureScores. - * - * @return Resource collection API of SecureScores. - */ - public SecureScores secureScores() { - if (this.secureScores == null) { - this.secureScores = new SecureScoresImpl(clientObject.getSecureScores(), this); - } - return secureScores; - } - - /** - * Gets the resource collection API of SecureScoreControls. - * - * @return Resource collection API of SecureScoreControls. - */ - public SecureScoreControls secureScoreControls() { - if (this.secureScoreControls == null) { - this.secureScoreControls = new SecureScoreControlsImpl(clientObject.getSecureScoreControls(), this); - } - return secureScoreControls; - } - - /** - * Gets the resource collection API of SecureScoreControlDefinitions. - * - * @return Resource collection API of SecureScoreControlDefinitions. - */ - public SecureScoreControlDefinitions secureScoreControlDefinitions() { - if (this.secureScoreControlDefinitions == null) { - this.secureScoreControlDefinitions = - new SecureScoreControlDefinitionsImpl(clientObject.getSecureScoreControlDefinitions(), this); - } - return secureScoreControlDefinitions; - } - - /** - * Gets the resource collection API of SecuritySolutions. - * - * @return Resource collection API of SecuritySolutions. - */ - public SecuritySolutions securitySolutions() { - if (this.securitySolutions == null) { - this.securitySolutions = new SecuritySolutionsImpl(clientObject.getSecuritySolutions(), this); - } - return securitySolutions; - } - - /** - * Gets the resource collection API of Connectors. It manages ConnectorSetting. - * - * @return Resource collection API of Connectors. - */ - public Connectors connectors() { - if (this.connectors == null) { - this.connectors = new ConnectorsImpl(clientObject.getConnectors(), this); - } - return connectors; - } - - /** - * Gets the resource collection API of Alerts. - * - * @return Resource collection API of Alerts. - */ - public Alerts alerts() { - if (this.alerts == null) { - this.alerts = new AlertsImpl(clientObject.getAlerts(), this); - } - return alerts; - } - - /** - * Gets the resource collection API of Settings. - * - * @return Resource collection API of Settings. - */ - public Settings settings() { - if (this.settings == null) { - this.settings = new SettingsImpl(clientObject.getSettings(), this); - } - return settings; - } - - /** - * Gets the resource collection API of IngestionSettings. It manages IngestionSetting. - * - * @return Resource collection API of IngestionSettings. - */ - public IngestionSettings ingestionSettings() { - if (this.ingestionSettings == null) { - this.ingestionSettings = new IngestionSettingsImpl(clientObject.getIngestionSettings(), this); - } - return ingestionSettings; - } - - /** - * Gets the resource collection API of SoftwareInventories. - * - * @return Resource collection API of SoftwareInventories. - */ - public SoftwareInventories softwareInventories() { - if (this.softwareInventories == null) { - this.softwareInventories = new SoftwareInventoriesImpl(clientObject.getSoftwareInventories(), this); - } - return softwareInventories; - } - - /** - * Gets the resource collection API of GovernanceRules. It manages GovernanceRule. - * - * @return Resource collection API of GovernanceRules. - */ - public GovernanceRules governanceRules() { - if (this.governanceRules == null) { - this.governanceRules = new GovernanceRulesImpl(clientObject.getGovernanceRules(), this); - } - return governanceRules; - } - - /** - * Gets the resource collection API of GovernanceAssignments. It manages GovernanceAssignment. - * - * @return Resource collection API of GovernanceAssignments. - */ - public GovernanceAssignments governanceAssignments() { - if (this.governanceAssignments == null) { - this.governanceAssignments = new GovernanceAssignmentsImpl(clientObject.getGovernanceAssignments(), this); - } - return governanceAssignments; - } - - /** - * Gets the resource collection API of Applications. - * - * @return Resource collection API of Applications. - */ - public Applications applications() { - if (this.applications == null) { - this.applications = new ApplicationsImpl(clientObject.getApplications(), this); - } - return applications; - } - - /** - * Gets the resource collection API of ApplicationOperations. It manages Application. - * - * @return Resource collection API of ApplicationOperations. - */ - public ApplicationOperations applicationOperations() { - if (this.applicationOperations == null) { - this.applicationOperations = new ApplicationOperationsImpl(clientObject.getApplicationOperations(), this); - } - return applicationOperations; - } - - /** - * Gets the resource collection API of SecurityConnectorApplications. - * - * @return Resource collection API of SecurityConnectorApplications. - */ - public SecurityConnectorApplications securityConnectorApplications() { - if (this.securityConnectorApplications == null) { - this.securityConnectorApplications = - new SecurityConnectorApplicationsImpl(clientObject.getSecurityConnectorApplications(), this); - } - return securityConnectorApplications; - } - - /** - * Gets the resource collection API of SecurityConnectorApplicationOperations. - * - * @return Resource collection API of SecurityConnectorApplicationOperations. - */ - public SecurityConnectorApplicationOperations securityConnectorApplicationOperations() { - if (this.securityConnectorApplicationOperations == null) { - this.securityConnectorApplicationOperations = - new SecurityConnectorApplicationOperationsImpl( - clientObject.getSecurityConnectorApplicationOperations(), this); - } - return securityConnectorApplicationOperations; - } - - /** - * Gets the resource collection API of ApiCollections. - * - * @return Resource collection API of ApiCollections. - */ - public ApiCollections apiCollections() { - if (this.apiCollections == null) { - this.apiCollections = new ApiCollectionsImpl(clientObject.getApiCollections(), this); - } - return apiCollections; - } - - /** - * Gets the resource collection API of ApiCollectionOnboardings. - * - * @return Resource collection API of ApiCollectionOnboardings. - */ - public ApiCollectionOnboardings apiCollectionOnboardings() { - if (this.apiCollectionOnboardings == null) { - this.apiCollectionOnboardings = - new ApiCollectionOnboardingsImpl(clientObject.getApiCollectionOnboardings(), this); - } - return apiCollectionOnboardings; - } - - /** - * Gets the resource collection API of ApiCollectionOffboardings. - * - * @return Resource collection API of ApiCollectionOffboardings. - */ - public ApiCollectionOffboardings apiCollectionOffboardings() { - if (this.apiCollectionOffboardings == null) { - this.apiCollectionOffboardings = - new ApiCollectionOffboardingsImpl(clientObject.getApiCollectionOffboardings(), this); - } - return apiCollectionOffboardings; - } - - /** - * Gets the resource collection API of HealthReports. - * - * @return Resource collection API of HealthReports. - */ - public HealthReports healthReports() { - if (this.healthReports == null) { - this.healthReports = new HealthReportsImpl(clientObject.getHealthReports(), this); - } - return healthReports; - } - - /** - * Gets the resource collection API of HealthReportOperations. - * - * @return Resource collection API of HealthReportOperations. - */ - public HealthReportOperations healthReportOperations() { - if (this.healthReportOperations == null) { - this.healthReportOperations = - new HealthReportOperationsImpl(clientObject.getHealthReportOperations(), this); - } - return healthReportOperations; - } - - /** - * Gets the resource collection API of SqlVulnerabilityAssessmentScans. - * - * @return Resource collection API of SqlVulnerabilityAssessmentScans. - */ - public SqlVulnerabilityAssessmentScans sqlVulnerabilityAssessmentScans() { - if (this.sqlVulnerabilityAssessmentScans == null) { - this.sqlVulnerabilityAssessmentScans = - new SqlVulnerabilityAssessmentScansImpl(clientObject.getSqlVulnerabilityAssessmentScans(), this); - } - return sqlVulnerabilityAssessmentScans; - } - - /** - * Gets the resource collection API of SqlVulnerabilityAssessmentScanResults. - * - * @return Resource collection API of SqlVulnerabilityAssessmentScanResults. - */ - public SqlVulnerabilityAssessmentScanResults sqlVulnerabilityAssessmentScanResults() { - if (this.sqlVulnerabilityAssessmentScanResults == null) { - this.sqlVulnerabilityAssessmentScanResults = - new SqlVulnerabilityAssessmentScanResultsImpl( - clientObject.getSqlVulnerabilityAssessmentScanResults(), this); - } - return sqlVulnerabilityAssessmentScanResults; - } - - /** - * Gets the resource collection API of SqlVulnerabilityAssessmentBaselineRules. It manages RuleResults. - * - * @return Resource collection API of SqlVulnerabilityAssessmentBaselineRules. - */ - public SqlVulnerabilityAssessmentBaselineRules sqlVulnerabilityAssessmentBaselineRules() { - if (this.sqlVulnerabilityAssessmentBaselineRules == null) { - this.sqlVulnerabilityAssessmentBaselineRules = - new SqlVulnerabilityAssessmentBaselineRulesImpl( - clientObject.getSqlVulnerabilityAssessmentBaselineRules(), this); - } - return sqlVulnerabilityAssessmentBaselineRules; - } - - /** - * Gets the resource collection API of SecurityConnectors. It manages SecurityConnector. - * - * @return Resource collection API of SecurityConnectors. - */ - public SecurityConnectors securityConnectors() { - if (this.securityConnectors == null) { - this.securityConnectors = new SecurityConnectorsImpl(clientObject.getSecurityConnectors(), this); - } - return securityConnectors; - } - - /** - * Gets the resource collection API of SecurityOperators. - * - * @return Resource collection API of SecurityOperators. - */ - public SecurityOperators securityOperators() { - if (this.securityOperators == null) { - this.securityOperators = new SecurityOperatorsImpl(clientObject.getSecurityOperators(), this); - } - return securityOperators; - } - - /** - * @return Wrapped service client SecurityCenter providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. - */ - public SecurityCenter serviceClient() { - return this.clientObject; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveApplicationControlsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveApplicationControlsClient.java deleted file mode 100644 index 26e579af6d38..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveApplicationControlsClient.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.AdaptiveApplicationControlGroupInner; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupsInner; - -/** An instance of this class provides access to all the operations defined in AdaptiveApplicationControlsClient. */ -public interface AdaptiveApplicationControlsClient { - /** - * Gets a list of application control machine groups for the subscription. - * - * @param includePathRecommendations Include the policy rules. - * @param summary Return output in a summarized form. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 application control machine groups for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - Boolean includePathRecommendations, Boolean summary, Context context); - - /** - * Gets a list of application control machine groups for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of application control machine groups for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdaptiveApplicationControlGroupsInner list(); - - /** - * Gets an application control VM/server group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application control VM/server group along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String ascLocation, String groupName, Context context); - - /** - * Gets an application control VM/server group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application control VM/server group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdaptiveApplicationControlGroupInner get(String ascLocation, String groupName); - - /** - * Update an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param body The body parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response putWithResponse( - String ascLocation, String groupName, AdaptiveApplicationControlGroupInner body, Context context); - - /** - * Update an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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) - AdaptiveApplicationControlGroupInner put( - String ascLocation, String groupName, AdaptiveApplicationControlGroupInner body); - - /** - * Delete an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String ascLocation, String groupName, Context context); - - /** - * Delete an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String ascLocation, String groupName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveNetworkHardeningsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveNetworkHardeningsClient.java deleted file mode 100644 index 9a39539b447e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdaptiveNetworkHardeningsClient.java +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningInner; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningEnforceRequest; - -/** An instance of this class provides access to all the operations defined in AdaptiveNetworkHardeningsClient. */ -public interface AdaptiveNetworkHardeningsClient { - /** - * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); - - /** - * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); - - /** - * Gets a single Adaptive Network Hardening resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single Adaptive Network Hardening resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - Context context); - - /** - * Gets a single Adaptive Network Hardening resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single Adaptive Network Hardening resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdaptiveNetworkHardeningInner get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName); - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginEnforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body); - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginEnforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context); - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body); - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdvancedThreatProtectionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdvancedThreatProtectionsClient.java deleted file mode 100644 index df0146bcab8f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AdvancedThreatProtectionsClient.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.AdvancedThreatProtectionSettingInner; - -/** An instance of this class provides access to all the operations defined in AdvancedThreatProtectionsClient. */ -public interface AdvancedThreatProtectionsClient { - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection settings for the specified resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, Context context); - - /** - * Gets the Advanced Threat Protection settings for the specified 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 the Advanced Threat Protection settings for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionSettingInner get(String resourceId); - - /** - * Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param resourceId The identifier of the resource. - * @param advancedThreatProtectionSetting Advanced Threat Protection 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 Advanced Threat Protection resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceId, AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting, Context context); - - /** - * Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param resourceId The identifier of the resource. - * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AdvancedThreatProtectionSettingInner create( - String resourceId, AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java deleted file mode 100644 index 6a8b01d63a82..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsClient.java +++ /dev/null @@ -1,496 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.models.AlertInner; -import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; - -/** An instance of this class provides access to all the operations defined in AlertsClient. */ -public interface AlertsClient { - /** - * List all the alerts that are associated with the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List all the alerts that are associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * List all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSubscriptionLevelByRegion(String ascLocation); - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSubscriptionLevelByRegion(String ascLocation, Context context); - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName); - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listResourceGroupLevelByRegion( - String ascLocation, String resourceGroupName, Context context); - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated with a subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSubscriptionLevelWithResponse(String ascLocation, String alertName, Context context); - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated with a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertInner getSubscriptionLevel(String ascLocation, String alertName); - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated a resource group or a resource in a resource group along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getResourceGroupLevelWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context); - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated a resource group or a resource in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertInner getResourceGroupLevel(String resourceGroupName, String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSubscriptionLevelStateToDismissWithResponse( - String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updateSubscriptionLevelStateToDismiss(String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSubscriptionLevelStateToResolveWithResponse( - String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updateSubscriptionLevelStateToResolve(String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSubscriptionLevelStateToActivateWithResponse( - String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updateSubscriptionLevelStateToActivate(String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSubscriptionLevelStateToInProgressWithResponse( - String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updateSubscriptionLevelStateToInProgress(String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateResourceGroupLevelStateToResolveWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updateResourceGroupLevelStateToResolve(String resourceGroupName, String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateResourceGroupLevelStateToDismissWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updateResourceGroupLevelStateToDismiss(String resourceGroupName, String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateResourceGroupLevelStateToActivateWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updateResourceGroupLevelStateToActivate(String resourceGroupName, String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateResourceGroupLevelStateToInProgressWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updateResourceGroupLevelStateToInProgress(String resourceGroupName, String ascLocation, String alertName); - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginSimulate( - String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody); - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginSimulate( - String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context); - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody); - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsSuppressionRulesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsSuppressionRulesClient.java deleted file mode 100644 index 64f7db01f3ce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AlertsSuppressionRulesClient.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.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; - -/** An instance of this class provides access to all the operations defined in AlertsSuppressionRulesClient. */ -public interface AlertsSuppressionRulesClient { - /** - * List of all the dismiss rules for the given subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String alertType, Context context); - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String alertsSuppressionRuleName, Context context); - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertsSuppressionRuleInner get(String alertsSuppressionRuleName); - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule, Context context); - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AlertsSuppressionRuleInner update( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule); - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String alertsSuppressionRuleName, Context context); - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String alertsSuppressionRuleName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AllowedConnectionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AllowedConnectionsClient.java deleted file mode 100644 index 021776947464..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AllowedConnectionsClient.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -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.AllowedConnectionsResourceInner; -import com.azure.resourcemanager.security.models.ConnectionType; - -/** An instance of this class provides access to all the operations defined in AllowedConnectionsClient. */ -public interface AllowedConnectionsClient { - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location, based on connection - * type along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String ascLocation, ConnectionType connectionType, Context context); - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location, based on connection - * type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AllowedConnectionsResourceInner get(String resourceGroupName, String ascLocation, ConnectionType connectionType); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOffboardingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOffboardingsClient.java deleted file mode 100644 index 01617030ae54..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionOffboardingsClient.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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; - -/** An instance of this class provides access to all the operations defined in ApiCollectionOffboardingsClient. */ -public interface ApiCollectionOffboardingsClient { - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

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

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

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

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an API collection as represented by Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApiCollectionResponseInner create(String resourceGroupName, String serviceName, String apiCollectionId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionsClient.java deleted file mode 100644 index 6eded28ea973..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApiCollectionsClient.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; - -/** An instance of this class provides access to all the operations defined in ApiCollectionsClient. */ -public interface ApiCollectionsClient { - /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serviceName); - - /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String serviceName, Context context); - - /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for - * intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure API Management API if it has been onboarded to Defender for APIs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context); - - /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for - * intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure API Management API if it has been onboarded to Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApiCollectionResponseInner get(String resourceGroupName, String serviceName, String apiCollectionId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationOperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationOperationsClient.java deleted file mode 100644 index 1454ded26234..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationOperationsClient.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.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; - -/** An instance of this class provides access to all the operations defined in ApplicationOperationsClient. */ -public interface ApplicationOperationsClient { - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String applicationId, Context context); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner get(String applicationId); - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String applicationId, ApplicationInner application, Context context); - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner createOrUpdate(String applicationId, ApplicationInner application); - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String applicationId, Context context); - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String applicationId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationsClient.java deleted file mode 100644 index 1f8851380eb8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ApplicationsClient.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.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; - -/** An instance of this class provides access to all the operations defined in ApplicationsClient. */ -public interface ApplicationsClient { - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java deleted file mode 100644 index ea903c0cc61a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsClient.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.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 { - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security assessment on your scanned resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceId, String assessmentName, ExpandEnum expand, Context context); - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security assessment on your scanned resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentResponseInner get(String resourceId, String assessmentName); - - /** - * Create a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assessment Calculated assessment on a pre-defined assessment metadata. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 - response format along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceId, String assessmentName, SecurityAssessment assessment, Context context); - - /** - * Create a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assessment Calculated assessment on a pre-defined assessment metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 - response format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentResponseInner createOrUpdate( - String resourceId, String assessmentName, SecurityAssessment assessment); - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceId, String assessmentName, Context context); - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceId, String assessmentName); -} 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 deleted file mode 100644 index d2d08e0c5684..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AssessmentsMetadatasClient.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.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -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 { - /** - * Get metadata information on all assessment 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 metadata information on all assessment types as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get metadata information on all assessment 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 metadata information on all assessment types as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String assessmentMetadataName, Context context); - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentMetadataResponseInner get(String assessmentMetadataName); - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscription(); - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscription(Context context); - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getInSubscriptionWithResponse( - String assessmentMetadataName, Context context); - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentMetadataResponseInner getInSubscription(String assessmentMetadataName); - - /** - * Create metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param assessmentMetadata AssessmentMetadata object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createInSubscriptionWithResponse( - String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata, Context context); - - /** - * Create metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param assessmentMetadata AssessmentMetadata object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityAssessmentMetadataResponseInner createInSubscription( - String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata); - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteInSubscriptionWithResponse(String assessmentMetadataName, Context context); - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteInSubscription(String assessmentMetadataName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutoProvisioningSettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutoProvisioningSettingsClient.java deleted file mode 100644 index 7d93098d7d09..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutoProvisioningSettingsClient.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; - -/** An instance of this class provides access to all the operations defined in AutoProvisioningSettingsClient. */ -public interface AutoProvisioningSettingsClient { - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String settingName, Context context); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutoProvisioningSettingInner get(String settingName); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String settingName, AutoProvisioningSettingInner setting, Context context); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutoProvisioningSettingInner create(String settingName, AutoProvisioningSettingInner setting); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutomationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutomationsClient.java deleted file mode 100644 index cfbcb6c5613d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/AutomationsClient.java +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; - -/** An instance of this class provides access to all the operations defined in AutomationsClient. */ -public interface AutomationsClient { - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String automationName, Context context); - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutomationInner getByResourceGroup(String resourceGroupName, String automationName); - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation id, then it will be updated. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String automationName, AutomationInner automation, Context context); - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation id, then it will be updated. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutomationInner createOrUpdate(String resourceGroupName, String automationName, AutomationInner automation); - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String automationName, Context context); - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String automationName); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation model state property bag along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response validateWithResponse( - String resourceGroupName, String automationName, AutomationInner automation, Context context); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation model state property bag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AutomationValidationStatusInner validate( - String resourceGroupName, String automationName, AutomationInner automation); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ComplianceResultsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ComplianceResultsClient.java deleted file mode 100644 index 834cf0990b35..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ComplianceResultsClient.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.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.ComplianceResultInner; - -/** An instance of this class provides access to all the operations defined in ComplianceResultsClient. */ -public interface ComplianceResultsClient { - /** - * Security compliance results in the subscription. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of compliance results response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Security compliance results in the subscription. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of compliance results response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); - - /** - * Security Compliance Result. - * - * @param resourceId The identifier of the resource. - * @param complianceResultName name of the desired assessment compliance result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a compliance result along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, String complianceResultName, Context context); - - /** - * Security Compliance Result. - * - * @param resourceId The identifier of the resource. - * @param complianceResultName name of the desired assessment compliance result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a compliance result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ComplianceResultInner get(String resourceId, String complianceResultName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CompliancesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CompliancesClient.java deleted file mode 100644 index 7914ab6d4293..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CompliancesClient.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; - -/** An instance of this class provides access to all the operations defined in CompliancesClient. */ -public interface CompliancesClient { - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String complianceName, Context context); - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ComplianceInner get(String scope, String complianceName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ConnectorsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ConnectorsClient.java deleted file mode 100644 index fc3073c4ec5a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ConnectorsClient.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; - -/** An instance of this class provides access to all the operations defined in ConnectorsClient. */ -public interface ConnectorsClient { - /** - * Cloud accounts connectors of a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Cloud accounts connectors of a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String connectorName, Context context); - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectorSettingInner get(String connectorName); - - /** - * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either - * account credentials or role-based authentication. For GCP, use account organization credentials. - * - * @param connectorName Name of the cloud account connector. - * @param connectorSetting Settings for the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String connectorName, ConnectorSettingInner connectorSetting, Context context); - - /** - * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either - * account credentials or role-based authentication. For GCP, use account organization credentials. - * - * @param connectorName Name of the cloud account connector. - * @param connectorSetting Settings for the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectorSettingInner createOrUpdate(String connectorName, ConnectorSettingInner connectorSetting); - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String connectorName, Context context); - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String connectorName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java deleted file mode 100644 index cdd6a0b7a94f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomAssessmentAutomationsClient.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; -import com.azure.resourcemanager.security.models.CustomAssessmentAutomationRequest; - -/** An instance of this class provides access to all the operations defined in CustomAssessmentAutomationsClient. */ -public interface CustomAssessmentAutomationsClient { - /** - * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom assessment automation by name for the provided subscription and resource group along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String customAssessmentAutomationName, Context context); - - /** - * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom assessment automation by name for the provided subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CustomAssessmentAutomationInner getByResourceGroup(String resourceGroupName, String customAssessmentAutomationName); - - /** - * Creates a custom assessment automation - * - *

Creates or updates a custom assessment automation for the provided subscription. Please note that providing an - * existing custom assessment automation will replace the existing record. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param customAssessmentAutomationBody Custom Assessment Automation body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Assessment Automation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String customAssessmentAutomationName, - CustomAssessmentAutomationRequest customAssessmentAutomationBody, - Context context); - - /** - * Creates a custom assessment automation - * - *

Creates or updates a custom assessment automation for the provided subscription. Please note that providing an - * existing custom assessment automation will replace the existing record. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param customAssessmentAutomationBody Custom Assessment Automation body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Assessment Automation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CustomAssessmentAutomationInner create( - String resourceGroupName, - String customAssessmentAutomationName, - CustomAssessmentAutomationRequest customAssessmentAutomationBody); - - /** - * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String customAssessmentAutomationName, Context context); - - /** - * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String customAssessmentAutomationName); - - /** - * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomEntityStoreAssignmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomEntityStoreAssignmentsClient.java deleted file mode 100644 index 5f7d062043ad..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/CustomEntityStoreAssignmentsClient.java +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentRequest; - -/** An instance of this class provides access to all the operations defined in CustomEntityStoreAssignmentsClient. */ -public interface CustomEntityStoreAssignmentsClient { - /** - * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom entity store assignment by name for the provided subscription and resource group along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context); - - /** - * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom entity store assignment by name for the provided subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CustomEntityStoreAssignmentInner getByResourceGroup( - String resourceGroupName, String customEntityStoreAssignmentName); - - /** - * Creates a custom entity store assignment - * - *

Creates a custom entity store assignment for the provided subscription, if not already exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom entity store assignment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String resourceGroupName, - String customEntityStoreAssignmentName, - CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, - Context context); - - /** - * Creates a custom entity store assignment - * - *

Creates a custom entity store assignment for the provided subscription, if not already exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom entity store assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CustomEntityStoreAssignmentInner create( - String resourceGroupName, - String customEntityStoreAssignmentName, - CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody); - - /** - * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context); - - /** - * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String customEntityStoreAssignmentName); - - /** - * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DeviceSecurityGroupsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DeviceSecurityGroupsClient.java deleted file mode 100644 index e03cd1b990c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DeviceSecurityGroupsClient.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.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.DeviceSecurityGroupInner; - -/** An instance of this class provides access to all the operations defined in DeviceSecurityGroupsClient. */ -public interface DeviceSecurityGroupsClient { - /** - * Use this method get the list of device security groups 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 device security groups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceId); - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of device security groups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceId, Context context); - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceId, String deviceSecurityGroupName, Context context); - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeviceSecurityGroupInner get(String resourceId, String deviceSecurityGroupName); - - /** - * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param deviceSecurityGroup Security group object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceId, - String deviceSecurityGroupName, - DeviceSecurityGroupInner deviceSecurityGroup, - Context context); - - /** - * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param deviceSecurityGroup Security group object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DeviceSecurityGroupInner createOrUpdate( - String resourceId, String deviceSecurityGroupName, DeviceSecurityGroupInner deviceSecurityGroup); - - /** - * User this method to deletes the device security group. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceId, String deviceSecurityGroupName, Context context); - - /** - * User this method to deletes the device security group. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceId, String deviceSecurityGroupName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DiscoveredSecuritySolutionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DiscoveredSecuritySolutionsClient.java deleted file mode 100644 index 692eeaf708cc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/DiscoveredSecuritySolutionsClient.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; - -/** An instance of this class provides access to all the operations defined in DiscoveredSecuritySolutionsClient. */ -public interface DiscoveredSecuritySolutionsClient { - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific discovered Security Solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName, Context context); - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific discovered Security Solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - DiscoveredSecuritySolutionInner get( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ExternalSecuritySolutionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ExternalSecuritySolutionsClient.java deleted file mode 100644 index ace625003ab6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ExternalSecuritySolutionsClient.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; - -/** An instance of this class provides access to all the operations defined in ExternalSecuritySolutionsClient. */ -public interface ExternalSecuritySolutionsClient { - /** - * Gets a list of external security solutions for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of external security solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific external Security Solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName, Context context); - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific external Security Solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExternalSecuritySolutionInner get( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceAssignmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceAssignmentsClient.java deleted file mode 100644 index ab8458ddf09c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceAssignmentsClient.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; - -/** An instance of this class provides access to all the operations defined in GovernanceAssignmentsClient. */ -public interface GovernanceAssignmentsClient { - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String assessmentName); - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String assessmentName, Context context); - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String scope, String assessmentName, String assignmentKey, Context context); - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceAssignmentInner get(String scope, String assessmentName, String assignmentKey); - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param governanceAssignment Governance assignment over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String scope, - String assessmentName, - String assignmentKey, - GovernanceAssignmentInner governanceAssignment, - Context context); - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param governanceAssignment Governance assignment over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceAssignmentInner createOrUpdate( - String scope, String assessmentName, String assignmentKey, GovernanceAssignmentInner governanceAssignment); - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scope, String assessmentName, String assignmentKey, Context context); - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String scope, String assessmentName, String assignmentKey); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesClient.java deleted file mode 100644 index d6f4ace6458c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/GovernanceRulesClient.java +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import com.azure.resourcemanager.security.models.GovernanceRulesOperationResultsResponse; - -/** An instance of this class provides access to all the operations defined in GovernanceRulesClient. */ -public interface GovernanceRulesClient { - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String ruleId, Context context); - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governance rule for the requested scope by ruleId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceRuleInner get(String scope, String ruleId); - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String scope, String ruleId, GovernanceRuleInner governanceRule, Context context); - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceRuleInner createOrUpdate(String scope, String ruleId, GovernanceRuleInner governanceRule); - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String scope, String ruleId); - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String scope, String ruleId, Context context); - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String scope, String ruleId); - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String scope, String ruleId, Context context); - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginExecute(String scope, String ruleId); - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginExecute( - String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void execute(String scope, String ruleId); - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void execute(String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GovernanceRulesOperationResultsResponse operationResultsWithResponse( - String scope, String ruleId, String operationId, Context context); - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationResultAutoGeneratedInner operationResults(String scope, String ruleId, String operationId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportOperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportOperationsClient.java deleted file mode 100644 index 9127fc7b309b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportOperationsClient.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.HealthReportInner; - -/** An instance of this class provides access to all the operations defined in HealthReportOperationsClient. */ -public interface HealthReportOperationsClient { - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceId, String healthReportName, Context context); - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HealthReportInner get(String resourceId, String healthReportName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.java deleted file mode 100644 index 57ee9785cfd2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/HealthReportsClient.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; - -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.HealthReportInner; - -/** An instance of this class provides access to all the operations defined in HealthReportsClient. */ -public interface HealthReportsClient { - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/InformationProtectionPoliciesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/InformationProtectionPoliciesClient.java deleted file mode 100644 index a43e048fb2fa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/InformationProtectionPoliciesClient.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; - -/** An instance of this class provides access to all the operations defined in InformationProtectionPoliciesClient. */ -public interface InformationProtectionPoliciesClient { - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String scope, InformationProtectionPolicyName informationProtectionPolicyName, Context context); - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InformationProtectionPolicyInner get(String scope, InformationProtectionPolicyName informationProtectionPolicyName); - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy, - Context context); - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - InformationProtectionPolicyInner createOrUpdate( - String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy); - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policies response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policies response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IngestionSettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IngestionSettingsClient.java deleted file mode 100644 index c0765e68586c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IngestionSettingsClient.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner; - -/** An instance of this class provides access to all the operations defined in IngestionSettingsClient. */ -public interface IngestionSettingsClient { - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String ingestionSettingName, Context context); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IngestionSettingInner get(String ingestionSettingName); - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String ingestionSettingName, IngestionSettingInner ingestionSetting, Context context); - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IngestionSettingInner create(String ingestionSettingName, IngestionSettingInner ingestionSetting); - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String ingestionSettingName, Context context); - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String ingestionSettingName); - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listTokensWithResponse(String ingestionSettingName, Context context); - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IngestionSettingTokenInner listTokens(String ingestionSettingName); - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listConnectionStringsWithResponse(String ingestionSettingName, Context context); - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ConnectionStringsInner listConnectionStrings(String ingestionSettingName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionAnalyticsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionAnalyticsClient.java deleted file mode 100644 index 25a019f2f016..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionAnalyticsClient.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.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.IoTSecuritySolutionAnalyticsModelInner; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelListInner; - -/** An instance of this class provides access to all the operations defined in IotSecuritySolutionAnalyticsClient. */ -public interface IotSecuritySolutionAnalyticsClient { - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String resourceGroupName, String solutionName, Context context); - - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecuritySolutionAnalyticsModelListInner list(String resourceGroupName, String solutionName); - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 analytics of your IoT Security solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String solutionName, Context context); - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 analytics of your IoT Security solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecuritySolutionAnalyticsModelInner get(String resourceGroupName, String solutionName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsAnalyticsAggregatedAlertsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsAnalyticsAggregatedAlertsClient.java deleted file mode 100644 index 1ea68d2ece5c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsAnalyticsAggregatedAlertsClient.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.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.IoTSecurityAggregatedAlertInner; - -/** - * An instance of this class provides access to all the operations defined in - * IotSecuritySolutionsAnalyticsAggregatedAlertsClient. - */ -public interface IotSecuritySolutionsAnalyticsAggregatedAlertsClient { - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 Security solution aggregated alert data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String solutionName); - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 Security solution aggregated alert data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String solutionName, Integer top, Context context); - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 security Solution Aggregated Alert information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String solutionName, String aggregatedAlertName, Context context); - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 security Solution Aggregated Alert information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecurityAggregatedAlertInner get(String resourceGroupName, String solutionName, String aggregatedAlertName); - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response dismissWithResponse( - String resourceGroupName, String solutionName, String aggregatedAlertName, Context context); - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void dismiss(String resourceGroupName, String solutionName, String aggregatedAlertName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsAnalyticsRecommendationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsAnalyticsRecommendationsClient.java deleted file mode 100644 index 1e534a2b033e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsAnalyticsRecommendationsClient.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.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.IoTSecurityAggregatedRecommendationInner; - -/** - * An instance of this class provides access to all the operations defined in - * IotSecuritySolutionsAnalyticsRecommendationsClient. - */ -public interface IotSecuritySolutionsAnalyticsRecommendationsClient { - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Security solution recommendation information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String solutionName, String aggregatedRecommendationName, Context context); - - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Security solution recommendation information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecurityAggregatedRecommendationInner get( - String resourceGroupName, String solutionName, String aggregatedRecommendationName); - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 Security solution aggregated recommendations as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String solutionName); - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 Security solution aggregated recommendations as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String solutionName, Integer top, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsClient.java deleted file mode 100644 index 140ffd6f2f62..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/IotSecuritySolutionsClient.java +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -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.IoTSecuritySolutionModelInner; -import com.azure.resourcemanager.security.models.UpdateIotSecuritySolutionData; - -/** An instance of this class provides access to all the operations defined in IotSecuritySolutionsClient. */ -public interface IotSecuritySolutionsClient { - /** - * Use this method to get the list of IoT Security solutions by 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 IoT Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Use this method to get the list of IoT Security solutions by subscription. - * - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context); - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Security solution configuration and resource information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String solutionName, Context context); - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Security solution configuration and resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecuritySolutionModelInner getByResourceGroup(String resourceGroupName, String solutionName); - - /** - * Use this method to create or update yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param iotSecuritySolutionData The security solution data. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String solutionName, - IoTSecuritySolutionModelInner iotSecuritySolutionData, - Context context); - - /** - * Use this method to create or update yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param iotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Security solution configuration and resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecuritySolutionModelInner createOrUpdate( - String resourceGroupName, String solutionName, IoTSecuritySolutionModelInner iotSecuritySolutionData); - - /** - * Use this method to update existing IoT Security solution tags or user defined resources. To update other fields - * use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param updateIotSecuritySolutionData The security solution data. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return ioT Security solution configuration and resource information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String solutionName, - UpdateIotSecuritySolutionData updateIotSecuritySolutionData, - Context context); - - /** - * Use this method to update existing IoT Security solution tags or user defined resources. To update other fields - * use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param updateIotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Security solution configuration and resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - IoTSecuritySolutionModelInner update( - String resourceGroupName, String solutionName, UpdateIotSecuritySolutionData updateIotSecuritySolutionData); - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String solutionName, Context context); - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 solutionName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/JitNetworkAccessPoliciesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/JitNetworkAccessPoliciesClient.java deleted file mode 100644 index 3170b606a0ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/JitNetworkAccessPoliciesClient.java +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) 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.JitNetworkAccessPolicyInner; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; - -/** An instance of this class provides access to all the operations defined in JitNetworkAccessPoliciesClient. */ -public interface JitNetworkAccessPoliciesClient { - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByRegion(String ascLocation); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByRegion(String ascLocation, Context context); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroupAndRegion( - String resourceGroupName, String ascLocation); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroupAndRegion( - String resourceGroupName, String ascLocation, Context context); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - JitNetworkAccessPolicyInner get(String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName); - - /** - * Create a policy for protecting resources using Just-in-Time access control. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInner body, - Context context); - - /** - * Create a policy for protecting resources using Just-in-Time access control. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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) - JitNetworkAccessPolicyInner createOrUpdate( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInner body); - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context); - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName); - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response initiateWithResponse( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest body, - Context context); - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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) - JitNetworkAccessRequestInner initiate( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest body); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/LocationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/LocationsClient.java deleted file mode 100644 index 9215df998226..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/LocationsClient.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; - -/** An instance of this class provides access to all the operations defined in LocationsClient. */ -public interface LocationsClient { - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String ascLocation, Context context); - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - AscLocationInner get(String ascLocation); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/MdeOnboardingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/MdeOnboardingsClient.java deleted file mode 100644 index f1a31c9a245a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/MdeOnboardingsClient.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; - -/** An instance of this class provides access to all the operations defined in MdeOnboardingsClient. */ -public interface MdeOnboardingsClient { - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MdeOnboardingDataListInner list(); - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(Context context); - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - MdeOnboardingDataInner get(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.java deleted file mode 100644 index 06e04115fd4b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/OperationsClient.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.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.OperationInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Exposes all available operations for discovery purposes. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft.Security resource provider as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Exposes all available operations for discovery purposes. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft.Security resource provider as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PricingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PricingsClient.java deleted file mode 100644 index fefcef79c849..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/PricingsClient.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.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.PricingInner; -import com.azure.resourcemanager.security.fluent.models.PricingListInner; - -/** An instance of this class provides access to all the operations defined in PricingsClient. */ -public interface PricingsClient { - /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of pricing configurations response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of pricing configurations response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PricingListInner list(); - - /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a provided Microsoft Defender for Cloud pricing configuration in the subscription along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String pricingName, Context context); - - /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a provided Microsoft Defender for Cloud pricing configuration in the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PricingInner get(String pricingName); - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String pricingName, PricingInner pricing, Context context); - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - PricingInner update(String pricingName, PricingInner pricing); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceAssessmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceAssessmentsClient.java deleted file mode 100644 index fb3daa044da5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceAssessmentsClient.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; - -/** An instance of this class provides access to all the operations defined in RegulatoryComplianceAssessmentsClient. */ -public interface RegulatoryComplianceAssessmentsClient { - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName); - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String filter, - Context context); - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName, - Context context); - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegulatoryComplianceAssessmentInner get( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceControlsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceControlsClient.java deleted file mode 100644 index d7f732d0cdb6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceControlsClient.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; - -/** An instance of this class provides access to all the operations defined in RegulatoryComplianceControlsClient. */ -public interface RegulatoryComplianceControlsClient { - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String regulatoryComplianceStandardName); - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String regulatoryComplianceStandardName, String filter, Context context); - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, Context context); - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegulatoryComplianceControlInner get( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceStandardsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceStandardsClient.java deleted file mode 100644 index 8bb55a3a903c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/RegulatoryComplianceStandardsClient.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; - -/** An instance of this class provides access to all the operations defined in RegulatoryComplianceStandardsClient. */ -public interface RegulatoryComplianceStandardsClient { - /** - * Supported regulatory compliance standards details and state. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String regulatoryComplianceStandardName, Context context); - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RegulatoryComplianceStandardInner get(String regulatoryComplianceStandardName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoreControlDefinitionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoreControlDefinitionsClient.java deleted file mode 100644 index 8b27a45f14e1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoreControlDefinitionsClient.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.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.SecureScoreControlDefinitionItemInner; - -/** An instance of this class provides access to all the operations defined in SecureScoreControlDefinitionsClient. */ -public interface SecureScoreControlDefinitionsClient { - /** - * List the available security controls, their assessments, and the max score. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscription(); - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySubscription(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoreControlsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoreControlsClient.java deleted file mode 100644 index 43be2302b12d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoreControlsClient.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.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.SecureScoreControlDetailsInner; -import com.azure.resourcemanager.security.models.ExpandControlsEnum; - -/** An instance of this class provides access to all the operations defined in SecureScoreControlsClient. */ -public interface SecureScoreControlsClient { - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls for a specific initiative within a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySecureScore(String secureScoreName); - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls for a specific initiative within a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listBySecureScore( - String secureScoreName, ExpandControlsEnum expand, Context context); - - /** - * Get all security controls within a scope. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls within a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get all security controls within a scope. - * - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls within a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(ExpandControlsEnum expand, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoresClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoresClient.java deleted file mode 100644 index 777ef62405f0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecureScoresClient.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.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.SecureScoreItemInner; - -/** An instance of this class provides access to all the operations defined in SecureScoresClient. */ -public interface SecureScoresClient { - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String secureScoreName, Context context); - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecureScoreItemInner get(String secureScoreName); -} 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 deleted file mode 100644 index 3632a9b91815..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java +++ /dev/null @@ -1,466 +0,0 @@ -// Copyright (c) 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.http.HttpPipeline; -import java.time.Duration; - -/** The interface for SecurityCenter class. */ -public interface SecurityCenter { - /** - * Gets Azure subscription ID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the MdeOnboardingsClient object to access its operations. - * - * @return the MdeOnboardingsClient object. - */ - MdeOnboardingsClient getMdeOnboardings(); - - /** - * Gets the CustomAssessmentAutomationsClient object to access its operations. - * - * @return the CustomAssessmentAutomationsClient object. - */ - CustomAssessmentAutomationsClient getCustomAssessmentAutomations(); - - /** - * Gets the CustomEntityStoreAssignmentsClient object to access its operations. - * - * @return the CustomEntityStoreAssignmentsClient object. - */ - CustomEntityStoreAssignmentsClient getCustomEntityStoreAssignments(); - - /** - * Gets the ComplianceResultsClient object to access its operations. - * - * @return the ComplianceResultsClient object. - */ - ComplianceResultsClient getComplianceResults(); - - /** - * Gets the PricingsClient object to access its operations. - * - * @return the PricingsClient object. - */ - PricingsClient getPricings(); - - /** - * Gets the AdvancedThreatProtectionsClient object to access its operations. - * - * @return the AdvancedThreatProtectionsClient object. - */ - AdvancedThreatProtectionsClient getAdvancedThreatProtections(); - - /** - * Gets the DeviceSecurityGroupsClient object to access its operations. - * - * @return the DeviceSecurityGroupsClient object. - */ - DeviceSecurityGroupsClient getDeviceSecurityGroups(); - - /** - * Gets the IotSecuritySolutionsClient object to access its operations. - * - * @return the IotSecuritySolutionsClient object. - */ - IotSecuritySolutionsClient getIotSecuritySolutions(); - - /** - * Gets the IotSecuritySolutionAnalyticsClient object to access its operations. - * - * @return the IotSecuritySolutionAnalyticsClient object. - */ - IotSecuritySolutionAnalyticsClient getIotSecuritySolutionAnalytics(); - - /** - * Gets the IotSecuritySolutionsAnalyticsAggregatedAlertsClient object to access its operations. - * - * @return the IotSecuritySolutionsAnalyticsAggregatedAlertsClient object. - */ - IotSecuritySolutionsAnalyticsAggregatedAlertsClient getIotSecuritySolutionsAnalyticsAggregatedAlerts(); - - /** - * Gets the IotSecuritySolutionsAnalyticsRecommendationsClient object to access its operations. - * - * @return the IotSecuritySolutionsAnalyticsRecommendationsClient object. - */ - IotSecuritySolutionsAnalyticsRecommendationsClient getIotSecuritySolutionsAnalyticsRecommendations(); - - /** - * Gets the LocationsClient object to access its operations. - * - * @return the LocationsClient object. - */ - LocationsClient getLocations(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the TasksClient object to access its operations. - * - * @return the TasksClient object. - */ - TasksClient getTasks(); - - /** - * Gets the AutoProvisioningSettingsClient object to access its operations. - * - * @return the AutoProvisioningSettingsClient object. - */ - AutoProvisioningSettingsClient getAutoProvisioningSettings(); - - /** - * Gets the CompliancesClient object to access its operations. - * - * @return the CompliancesClient object. - */ - CompliancesClient getCompliances(); - - /** - * Gets the InformationProtectionPoliciesClient object to access its operations. - * - * @return the InformationProtectionPoliciesClient object. - */ - InformationProtectionPoliciesClient getInformationProtectionPolicies(); - - /** - * Gets the SecurityContactsClient object to access its operations. - * - * @return the SecurityContactsClient object. - */ - SecurityContactsClient getSecurityContacts(); - - /** - * Gets the WorkspaceSettingsClient object to access its operations. - * - * @return the WorkspaceSettingsClient object. - */ - WorkspaceSettingsClient getWorkspaceSettings(); - - /** - * Gets the RegulatoryComplianceStandardsClient object to access its operations. - * - * @return the RegulatoryComplianceStandardsClient object. - */ - RegulatoryComplianceStandardsClient getRegulatoryComplianceStandards(); - - /** - * Gets the RegulatoryComplianceControlsClient object to access its operations. - * - * @return the RegulatoryComplianceControlsClient object. - */ - RegulatoryComplianceControlsClient getRegulatoryComplianceControls(); - - /** - * Gets the RegulatoryComplianceAssessmentsClient object to access its operations. - * - * @return the RegulatoryComplianceAssessmentsClient object. - */ - RegulatoryComplianceAssessmentsClient getRegulatoryComplianceAssessments(); - - /** - * Gets the SubAssessmentsClient object to access its operations. - * - * @return the SubAssessmentsClient object. - */ - SubAssessmentsClient getSubAssessments(); - - /** - * Gets the AutomationsClient object to access its operations. - * - * @return the AutomationsClient object. - */ - AutomationsClient getAutomations(); - - /** - * Gets the AlertsSuppressionRulesClient object to access its operations. - * - * @return the AlertsSuppressionRulesClient object. - */ - AlertsSuppressionRulesClient getAlertsSuppressionRules(); - - /** - * Gets the ServerVulnerabilityAssessmentsClient object to access its operations. - * - * @return the ServerVulnerabilityAssessmentsClient object. - */ - ServerVulnerabilityAssessmentsClient getServerVulnerabilityAssessments(); - - /** - * Gets the AssessmentsMetadatasClient object to access its operations. - * - * @return the AssessmentsMetadatasClient object. - */ - AssessmentsMetadatasClient getAssessmentsMetadatas(); - - /** - * Gets the AssessmentsClient object to access its operations. - * - * @return the AssessmentsClient object. - */ - AssessmentsClient getAssessments(); - - /** - * Gets the AdaptiveApplicationControlsClient object to access its operations. - * - * @return the AdaptiveApplicationControlsClient object. - */ - AdaptiveApplicationControlsClient getAdaptiveApplicationControls(); - - /** - * Gets the AdaptiveNetworkHardeningsClient object to access its operations. - * - * @return the AdaptiveNetworkHardeningsClient object. - */ - AdaptiveNetworkHardeningsClient getAdaptiveNetworkHardenings(); - - /** - * Gets the AllowedConnectionsClient object to access its operations. - * - * @return the AllowedConnectionsClient object. - */ - AllowedConnectionsClient getAllowedConnections(); - - /** - * Gets the TopologiesClient object to access its operations. - * - * @return the TopologiesClient object. - */ - TopologiesClient getTopologies(); - - /** - * Gets the JitNetworkAccessPoliciesClient object to access its operations. - * - * @return the JitNetworkAccessPoliciesClient object. - */ - JitNetworkAccessPoliciesClient getJitNetworkAccessPolicies(); - - /** - * Gets the DiscoveredSecuritySolutionsClient object to access its operations. - * - * @return the DiscoveredSecuritySolutionsClient object. - */ - DiscoveredSecuritySolutionsClient getDiscoveredSecuritySolutions(); - - /** - * Gets the SecuritySolutionsReferenceDatasClient object to access its operations. - * - * @return the SecuritySolutionsReferenceDatasClient object. - */ - SecuritySolutionsReferenceDatasClient getSecuritySolutionsReferenceDatas(); - - /** - * Gets the ExternalSecuritySolutionsClient object to access its operations. - * - * @return the ExternalSecuritySolutionsClient object. - */ - ExternalSecuritySolutionsClient getExternalSecuritySolutions(); - - /** - * Gets the SecureScoresClient object to access its operations. - * - * @return the SecureScoresClient object. - */ - SecureScoresClient getSecureScores(); - - /** - * Gets the SecureScoreControlsClient object to access its operations. - * - * @return the SecureScoreControlsClient object. - */ - SecureScoreControlsClient getSecureScoreControls(); - - /** - * Gets the SecureScoreControlDefinitionsClient object to access its operations. - * - * @return the SecureScoreControlDefinitionsClient object. - */ - SecureScoreControlDefinitionsClient getSecureScoreControlDefinitions(); - - /** - * Gets the SecuritySolutionsClient object to access its operations. - * - * @return the SecuritySolutionsClient object. - */ - SecuritySolutionsClient getSecuritySolutions(); - - /** - * Gets the ConnectorsClient object to access its operations. - * - * @return the ConnectorsClient object. - */ - ConnectorsClient getConnectors(); - - /** - * Gets the AlertsClient object to access its operations. - * - * @return the AlertsClient object. - */ - AlertsClient getAlerts(); - - /** - * Gets the SettingsClient object to access its operations. - * - * @return the SettingsClient object. - */ - SettingsClient getSettings(); - - /** - * Gets the IngestionSettingsClient object to access its operations. - * - * @return the IngestionSettingsClient object. - */ - IngestionSettingsClient getIngestionSettings(); - - /** - * Gets the SoftwareInventoriesClient object to access its operations. - * - * @return the SoftwareInventoriesClient object. - */ - SoftwareInventoriesClient getSoftwareInventories(); - - /** - * Gets the GovernanceRulesClient object to access its operations. - * - * @return the GovernanceRulesClient object. - */ - GovernanceRulesClient getGovernanceRules(); - - /** - * Gets the GovernanceAssignmentsClient object to access its operations. - * - * @return the GovernanceAssignmentsClient object. - */ - GovernanceAssignmentsClient getGovernanceAssignments(); - - /** - * Gets the ApplicationsClient object to access its operations. - * - * @return the ApplicationsClient object. - */ - ApplicationsClient getApplications(); - - /** - * Gets the ApplicationOperationsClient object to access its operations. - * - * @return the ApplicationOperationsClient object. - */ - ApplicationOperationsClient getApplicationOperations(); - - /** - * Gets the SecurityConnectorApplicationsClient object to access its operations. - * - * @return the SecurityConnectorApplicationsClient object. - */ - SecurityConnectorApplicationsClient getSecurityConnectorApplications(); - - /** - * Gets the SecurityConnectorApplicationOperationsClient object to access its operations. - * - * @return the SecurityConnectorApplicationOperationsClient object. - */ - SecurityConnectorApplicationOperationsClient getSecurityConnectorApplicationOperations(); - - /** - * Gets the ApiCollectionsClient object to access its operations. - * - * @return the ApiCollectionsClient object. - */ - ApiCollectionsClient getApiCollections(); - - /** - * Gets the ApiCollectionOnboardingsClient object to access its operations. - * - * @return the ApiCollectionOnboardingsClient object. - */ - ApiCollectionOnboardingsClient getApiCollectionOnboardings(); - - /** - * Gets the ApiCollectionOffboardingsClient object to access its operations. - * - * @return the ApiCollectionOffboardingsClient object. - */ - ApiCollectionOffboardingsClient getApiCollectionOffboardings(); - - /** - * Gets the HealthReportsClient object to access its operations. - * - * @return the HealthReportsClient object. - */ - HealthReportsClient getHealthReports(); - - /** - * Gets the HealthReportOperationsClient object to access its operations. - * - * @return the HealthReportOperationsClient object. - */ - HealthReportOperationsClient getHealthReportOperations(); - - /** - * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScansClient object. - */ - SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans(); - - /** - * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScanResultsClient object. - */ - SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults(); - - /** - * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. - */ - SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules(); - - /** - * Gets the SecurityConnectorsClient object to access its operations. - * - * @return the SecurityConnectorsClient object. - */ - SecurityConnectorsClient getSecurityConnectors(); - - /** - * Gets the SecurityOperatorsClient object to access its operations. - * - * @return the SecurityOperatorsClient object. - */ - SecurityOperatorsClient getSecurityOperators(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationOperationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationOperationsClient.java deleted file mode 100644 index 019e8eefacc0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationOperationsClient.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; - -/** - * An instance of this class provides access to all the operations defined in - * SecurityConnectorApplicationOperationsClient. - */ -public interface SecurityConnectorApplicationOperationsClient { - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String securityConnectorName, String applicationId, Context context); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner get(String resourceGroupName, String securityConnectorName, String applicationId); - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String securityConnectorName, - String applicationId, - ApplicationInner application, - Context context); - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ApplicationInner createOrUpdate( - String resourceGroupName, String securityConnectorName, String applicationId, ApplicationInner application); - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, String securityConnectorName, String applicationId, Context context); - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String securityConnectorName, String applicationId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationsClient.java deleted file mode 100644 index bafeb6ef94d4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorApplicationsClient.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.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; - -/** An instance of this class provides access to all the operations defined in SecurityConnectorApplicationsClient. */ -public interface SecurityConnectorApplicationsClient { - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorsClient.java deleted file mode 100644 index a1a51a3fcf9c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityConnectorsClient.java +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; - -/** An instance of this class provides access to all the operations defined in SecurityConnectorsClient. */ -public interface SecurityConnectorsClient { - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String securityConnectorName, Context context); - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityConnectorInner getByResourceGroup(String resourceGroupName, String securityConnectorName); - - /** - * Creates or updates a security connector. If a security connector is already created and a subsequent request is - * issued for the same security connector id, then it will be updated. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String securityConnectorName, - SecurityConnectorInner securityConnector, - Context context); - - /** - * Creates or updates a security connector. If a security connector is already created and a subsequent request is - * issued for the same security connector id, then it will be updated. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityConnectorInner createOrUpdate( - String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector); - - /** - * Updates a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, - String securityConnectorName, - SecurityConnectorInner securityConnector, - Context context); - - /** - * Updates a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityConnectorInner update( - String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector); - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String securityConnectorName, Context context); - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String securityConnectorName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityContactsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityContactsClient.java deleted file mode 100644 index ab1c6851f948..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityContactsClient.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; - -/** An instance of this class provides access to all the operations defined in SecurityContactsClient. */ -public interface SecurityContactsClient { - /** - * List all security contact configurations for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List all security contact configurations for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String securityContactName, Context context); - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityContactInner get(String securityContactName); - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String securityContactName, SecurityContactInner securityContact, Context context); - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityContactInner create(String securityContactName, SecurityContactInner securityContact); - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String securityContactName, Context context); - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String securityContactName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityOperatorsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityOperatorsClient.java deleted file mode 100644 index bd785ec861db..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityOperatorsClient.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorListInner; - -/** An instance of this class provides access to all the operations defined in SecurityOperatorsClient. */ -public interface SecurityOperatorsClient { - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String pricingName, Context context); - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityOperatorListInner list(String pricingName); - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String pricingName, String securityOperatorName, Context context); - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityOperatorInner get(String pricingName, String securityOperatorName); - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String pricingName, String securityOperatorName, Context context); - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityOperatorInner createOrUpdate(String pricingName, String securityOperatorName); - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String pricingName, String securityOperatorName, Context context); - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String pricingName, String securityOperatorName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecuritySolutionsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecuritySolutionsClient.java deleted file mode 100644 index 172a35c22dd1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecuritySolutionsClient.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.SecuritySolutionInner; - -/** An instance of this class provides access to all the operations defined in SecuritySolutionsClient. */ -public interface SecuritySolutionsClient { - /** - * Gets a list of Security Solutions for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list of Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Security Solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String ascLocation, String securitySolutionName, Context context); - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Security Solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecuritySolutionInner get(String resourceGroupName, String ascLocation, String securitySolutionName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecuritySolutionsReferenceDatasClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecuritySolutionsReferenceDatasClient.java deleted file mode 100644 index 2e07125883e6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecuritySolutionsReferenceDatasClient.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.SecuritySolutionsReferenceDataListInner; - -/** An instance of this class provides access to all the operations defined in SecuritySolutionsReferenceDatasClient. */ -public interface SecuritySolutionsReferenceDatasClient { - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); - - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecuritySolutionsReferenceDataListInner list(); - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listByHomeRegionWithResponse(String ascLocation, Context context); - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecuritySolutionsReferenceDataListInner listByHomeRegion(String ascLocation); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsClient.java deleted file mode 100644 index 26e9c4152c35..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ServerVulnerabilityAssessmentsClient.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsListInner; - -/** An instance of this class provides access to all the operations defined in ServerVulnerabilityAssessmentsClient. */ -public interface ServerVulnerabilityAssessmentsClient { - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server vulnerability assessment onboarding statuses on a given resource along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listByExtendedResourceWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); - - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server vulnerability assessment onboarding statuses on a given resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerVulnerabilityAssessmentsListInner listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server vulnerability assessment onboarding statuses on a given resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server vulnerability assessment onboarding statuses on a given resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerVulnerabilityAssessmentInner get( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the server vulnerability assessment details on a resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the server vulnerability assessment details on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServerVulnerabilityAssessmentInner createOrUpdate( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SettingsClient.java deleted file mode 100644 index 1d2ca46fd4b9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SettingsClient.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -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.SettingInner; -import com.azure.resourcemanager.security.models.SettingName; - -/** An instance of this class provides access to all the operations defined in SettingsClient. */ -public interface SettingsClient { - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription settings list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription settings list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(SettingName settingName, Context context); - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SettingInner get(SettingName settingName); - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(SettingName settingName, SettingInner setting, Context context); - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SettingInner update(SettingName settingName, SettingInner setting); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SoftwareInventoriesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SoftwareInventoriesClient.java deleted file mode 100644 index 68430027e194..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SoftwareInventoriesClient.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SoftwareInner; - -/** An instance of this class provides access to all the operations defined in SoftwareInventoriesClient. */ -public interface SoftwareInventoriesClient { - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of the virtual machine as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); - - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of the virtual machine as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single software data of the virtual machine along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName, - Context context); - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single software data of the virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SoftwareInner get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentBaselineRulesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentBaselineRulesClient.java deleted file mode 100644 index 01e57856a5c6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentBaselineRulesClient.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.fluent.models.RulesResultsInner; -import com.azure.resourcemanager.security.models.RuleResultsInput; -import com.azure.resourcemanager.security.models.RulesResultsInput; - -/** - * An instance of this class provides access to all the operations defined in - * SqlVulnerabilityAssessmentBaselineRulesClient. - */ -public interface SqlVulnerabilityAssessmentBaselineRulesClient { - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline results for this rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rule results along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String ruleId, String workspaceId, String resourceId, RuleResultsInput body, Context context); - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rule results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RuleResultsInner createOrUpdate(String ruleId, String workspaceId, String resourceId); - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String ruleId, String workspaceId, String resourceId, Context context); - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RuleResultsInner get(String ruleId, String workspaceId, String resourceId); - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String ruleId, String workspaceId, String resourceId, Context context); - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String ruleId, String workspaceId, String resourceId); - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String workspaceId, String resourceId, Context context); - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RulesResultsInner list(String workspaceId, String resourceId); - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline rules. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of rules results along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response addWithResponse( - String workspaceId, String resourceId, RulesResultsInput body, Context context); - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of rules results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RulesResultsInner add(String workspaceId, String resourceId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScanResultsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScanResultsClient.java deleted file mode 100644 index 9ab7d96a286f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScanResultsClient.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.fluent.models.ScanResultsInner; - -/** - * An instance of this class provides access to all the operations defined in - * SqlVulnerabilityAssessmentScanResultsClient. - */ -public interface SqlVulnerabilityAssessmentScanResultsClient { - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String scanId, String scanResultId, String workspaceId, String resourceId, Context context); - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScanResultInner get(String scanId, String scanResultId, String workspaceId, String resourceId); - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan results for a single scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String scanId, String workspaceId, String resourceId, Context context); - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan results for a single scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScanResultsInner list(String scanId, String workspaceId, String resourceId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScansClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScansClient.java deleted file mode 100644 index c586949d0f77..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SqlVulnerabilityAssessmentScansClient.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ScanInner; -import com.azure.resourcemanager.security.fluent.models.ScansInner; - -/** An instance of this class provides access to all the operations defined in SqlVulnerabilityAssessmentScansClient. */ -public interface SqlVulnerabilityAssessmentScansClient { - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scanId, String workspaceId, String resourceId, Context context); - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScanInner get(String scanId, String workspaceId, String resourceId); - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan records along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(String workspaceId, String resourceId, Context context); - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan records. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ScansInner list(String workspaceId, String resourceId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubAssessmentsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubAssessmentsClient.java deleted file mode 100644 index 84dfe1f4ca07..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SubAssessmentsClient.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner; - -/** An instance of this class provides access to all the operations defined in SubAssessmentsClient. */ -public interface SubAssessmentsClient { - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAll(String scope); - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAll(String scope, Context context); - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String assessmentName); - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String assessmentName, Context context); - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security sub-assessment on your scanned resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String scope, String assessmentName, String subAssessmentName, Context context); - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security sub-assessment on your scanned resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecuritySubAssessmentInner get(String scope, String assessmentName, String subAssessmentName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TasksClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TasksClient.java deleted file mode 100644 index a2c5a01a49be..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TasksClient.java +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityTaskInner; -import com.azure.resourcemanager.security.models.TaskUpdateActionType; - -/** An instance of this class provides access to all the operations defined in TasksClient. */ -public interface TasksClient { - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation, String filter, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getSubscriptionLevelTaskWithResponse( - String ascLocation, String taskName, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityTaskInner getSubscriptionLevelTask(String ascLocation, String taskName); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateSubscriptionLevelTaskStateWithResponse( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updateSubscriptionLevelTaskState( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup( - String resourceGroupName, String ascLocation, String filter, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getResourceGroupLevelTaskWithResponse( - String resourceGroupName, String ascLocation, String taskName, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SecurityTaskInner getResourceGroupLevelTask(String resourceGroupName, String ascLocation, String taskName); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateResourceGroupLevelTaskStateWithResponse( - String resourceGroupName, - String ascLocation, - String taskName, - TaskUpdateActionType taskUpdateActionType, - Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void updateResourceGroupLevelTaskState( - String resourceGroupName, String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java deleted file mode 100644 index 2af153a9fd5d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/TopologiesClient.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) 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.TopologyResourceInner; - -/** An instance of this class provides access to all the operations defined in TopologiesClient. */ -public interface TopologiesClient { - /** - * Gets a list that allows to build a topology view of a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Gets a list that allows to build a topology view of a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, String ascLocation, String topologyResourceName, Context context); - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TopologyResourceInner get(String resourceGroupName, String ascLocation, String topologyResourceName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/WorkspaceSettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/WorkspaceSettingsClient.java deleted file mode 100644 index 4aeb55188476..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/WorkspaceSettingsClient.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; - -/** An instance of this class provides access to all the operations defined in WorkspaceSettingsClient. */ -public interface WorkspaceSettingsClient { - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String workspaceSettingName, Context context); - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceSettingInner get(String workspaceSettingName); - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createWithResponse( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting, Context context); - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceSettingInner create(String workspaceSettingName, WorkspaceSettingInner workspaceSetting); - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting, Context context); - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - WorkspaceSettingInner update(String workspaceSettingName, WorkspaceSettingInner workspaceSetting); - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String workspaceSettingName, Context context); - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String workspaceSettingName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupData.java deleted file mode 100644 index de1ccc31bb95..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupData.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlIssueSummary; -import com.azure.resourcemanager.security.models.ConfigurationStatus; -import com.azure.resourcemanager.security.models.EnforcementMode; -import com.azure.resourcemanager.security.models.PathRecommendation; -import com.azure.resourcemanager.security.models.ProtectionMode; -import com.azure.resourcemanager.security.models.RecommendationStatus; -import com.azure.resourcemanager.security.models.SourceSystem; -import com.azure.resourcemanager.security.models.VmRecommendation; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents a machines group and set of rules to be allowed running on a machine. */ -@Fluent -public final class AdaptiveApplicationControlGroupData { - /* - * The application control policy enforcement/protection mode of the machine group - */ - @JsonProperty(value = "enforcementMode") - private EnforcementMode enforcementMode; - - /* - * The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for - * Linux. - */ - @JsonProperty(value = "protectionMode") - private ProtectionMode protectionMode; - - /* - * The configuration status of the machines group or machine or rule - */ - @JsonProperty(value = "configurationStatus", access = JsonProperty.Access.WRITE_ONLY) - private ConfigurationStatus configurationStatus; - - /* - * The initial recommendation status of the machine group or machine - */ - @JsonProperty(value = "recommendationStatus", access = JsonProperty.Access.WRITE_ONLY) - private RecommendationStatus recommendationStatus; - - /* - * The issues property. - */ - @JsonProperty(value = "issues", access = JsonProperty.Access.WRITE_ONLY) - private List issues; - - /* - * The source type of the machine group - */ - @JsonProperty(value = "sourceSystem", access = JsonProperty.Access.WRITE_ONLY) - private SourceSystem sourceSystem; - - /* - * The vmRecommendations property. - */ - @JsonProperty(value = "vmRecommendations") - private List vmRecommendations; - - /* - * The pathRecommendations property. - */ - @JsonProperty(value = "pathRecommendations") - private List pathRecommendations; - - /** Creates an instance of AdaptiveApplicationControlGroupData class. */ - public AdaptiveApplicationControlGroupData() { - } - - /** - * Get the enforcementMode property: The application control policy enforcement/protection mode of the machine - * group. - * - * @return the enforcementMode value. - */ - public EnforcementMode enforcementMode() { - return this.enforcementMode; - } - - /** - * Set the enforcementMode property: The application control policy enforcement/protection mode of the machine - * group. - * - * @param enforcementMode the enforcementMode value to set. - * @return the AdaptiveApplicationControlGroupData object itself. - */ - public AdaptiveApplicationControlGroupData withEnforcementMode(EnforcementMode enforcementMode) { - this.enforcementMode = enforcementMode; - return this; - } - - /** - * Get the protectionMode property: The protection mode of the collection/file types. Exe/Msi/Script are used for - * Windows, Executable is used for Linux. - * - * @return the protectionMode value. - */ - public ProtectionMode protectionMode() { - return this.protectionMode; - } - - /** - * Set the protectionMode property: The protection mode of the collection/file types. Exe/Msi/Script are used for - * Windows, Executable is used for Linux. - * - * @param protectionMode the protectionMode value to set. - * @return the AdaptiveApplicationControlGroupData object itself. - */ - public AdaptiveApplicationControlGroupData withProtectionMode(ProtectionMode protectionMode) { - this.protectionMode = protectionMode; - return this; - } - - /** - * Get the configurationStatus property: The configuration status of the machines group or machine or rule. - * - * @return the configurationStatus value. - */ - public ConfigurationStatus configurationStatus() { - return this.configurationStatus; - } - - /** - * Get the recommendationStatus property: The initial recommendation status of the machine group or machine. - * - * @return the recommendationStatus value. - */ - public RecommendationStatus recommendationStatus() { - return this.recommendationStatus; - } - - /** - * Get the issues property: The issues property. - * - * @return the issues value. - */ - public List issues() { - return this.issues; - } - - /** - * Get the sourceSystem property: The source type of the machine group. - * - * @return the sourceSystem value. - */ - public SourceSystem sourceSystem() { - return this.sourceSystem; - } - - /** - * Get the vmRecommendations property: The vmRecommendations property. - * - * @return the vmRecommendations value. - */ - public List vmRecommendations() { - return this.vmRecommendations; - } - - /** - * Set the vmRecommendations property: The vmRecommendations property. - * - * @param vmRecommendations the vmRecommendations value to set. - * @return the AdaptiveApplicationControlGroupData object itself. - */ - public AdaptiveApplicationControlGroupData withVmRecommendations(List vmRecommendations) { - this.vmRecommendations = vmRecommendations; - return this; - } - - /** - * Get the pathRecommendations property: The pathRecommendations property. - * - * @return the pathRecommendations value. - */ - public List pathRecommendations() { - return this.pathRecommendations; - } - - /** - * Set the pathRecommendations property: The pathRecommendations property. - * - * @param pathRecommendations the pathRecommendations value to set. - * @return the AdaptiveApplicationControlGroupData object itself. - */ - public AdaptiveApplicationControlGroupData withPathRecommendations(List pathRecommendations) { - this.pathRecommendations = pathRecommendations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (protectionMode() != null) { - protectionMode().validate(); - } - if (issues() != null) { - issues().forEach(e -> e.validate()); - } - if (vmRecommendations() != null) { - vmRecommendations().forEach(e -> e.validate()); - } - if (pathRecommendations() != null) { - pathRecommendations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupInner.java deleted file mode 100644 index 56eca9ad39ce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlIssueSummary; -import com.azure.resourcemanager.security.models.ConfigurationStatus; -import com.azure.resourcemanager.security.models.EnforcementMode; -import com.azure.resourcemanager.security.models.PathRecommendation; -import com.azure.resourcemanager.security.models.ProtectionMode; -import com.azure.resourcemanager.security.models.RecommendationStatus; -import com.azure.resourcemanager.security.models.SourceSystem; -import com.azure.resourcemanager.security.models.VmRecommendation; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The AdaptiveApplicationControlGroup model. */ -@Fluent -public final class AdaptiveApplicationControlGroupInner extends ProxyResource { - /* - * Represents a machines group and set of rules to be allowed running on a machine - */ - @JsonProperty(value = "properties", required = true) - private AdaptiveApplicationControlGroupData innerProperties = new AdaptiveApplicationControlGroupData(); - - /* - * Location where the resource is stored - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /** Creates an instance of AdaptiveApplicationControlGroupInner class. */ - public AdaptiveApplicationControlGroupInner() { - } - - /** - * Get the innerProperties property: Represents a machines group and set of rules to be allowed running on a - * machine. - * - * @return the innerProperties value. - */ - private AdaptiveApplicationControlGroupData innerProperties() { - return this.innerProperties; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the enforcementMode property: The application control policy enforcement/protection mode of the machine - * group. - * - * @return the enforcementMode value. - */ - public EnforcementMode enforcementMode() { - return this.innerProperties() == null ? null : this.innerProperties().enforcementMode(); - } - - /** - * Set the enforcementMode property: The application control policy enforcement/protection mode of the machine - * group. - * - * @param enforcementMode the enforcementMode value to set. - * @return the AdaptiveApplicationControlGroupInner object itself. - */ - public AdaptiveApplicationControlGroupInner withEnforcementMode(EnforcementMode enforcementMode) { - if (this.innerProperties() == null) { - this.innerProperties = new AdaptiveApplicationControlGroupData(); - } - this.innerProperties().withEnforcementMode(enforcementMode); - return this; - } - - /** - * Get the protectionMode property: The protection mode of the collection/file types. Exe/Msi/Script are used for - * Windows, Executable is used for Linux. - * - * @return the protectionMode value. - */ - public ProtectionMode protectionMode() { - return this.innerProperties() == null ? null : this.innerProperties().protectionMode(); - } - - /** - * Set the protectionMode property: The protection mode of the collection/file types. Exe/Msi/Script are used for - * Windows, Executable is used for Linux. - * - * @param protectionMode the protectionMode value to set. - * @return the AdaptiveApplicationControlGroupInner object itself. - */ - public AdaptiveApplicationControlGroupInner withProtectionMode(ProtectionMode protectionMode) { - if (this.innerProperties() == null) { - this.innerProperties = new AdaptiveApplicationControlGroupData(); - } - this.innerProperties().withProtectionMode(protectionMode); - return this; - } - - /** - * Get the configurationStatus property: The configuration status of the machines group or machine or rule. - * - * @return the configurationStatus value. - */ - public ConfigurationStatus configurationStatus() { - return this.innerProperties() == null ? null : this.innerProperties().configurationStatus(); - } - - /** - * Get the recommendationStatus property: The initial recommendation status of the machine group or machine. - * - * @return the recommendationStatus value. - */ - public RecommendationStatus recommendationStatus() { - return this.innerProperties() == null ? null : this.innerProperties().recommendationStatus(); - } - - /** - * Get the issues property: The issues property. - * - * @return the issues value. - */ - public List issues() { - return this.innerProperties() == null ? null : this.innerProperties().issues(); - } - - /** - * Get the sourceSystem property: The source type of the machine group. - * - * @return the sourceSystem value. - */ - public SourceSystem sourceSystem() { - return this.innerProperties() == null ? null : this.innerProperties().sourceSystem(); - } - - /** - * Get the vmRecommendations property: The vmRecommendations property. - * - * @return the vmRecommendations value. - */ - public List vmRecommendations() { - return this.innerProperties() == null ? null : this.innerProperties().vmRecommendations(); - } - - /** - * Set the vmRecommendations property: The vmRecommendations property. - * - * @param vmRecommendations the vmRecommendations value to set. - * @return the AdaptiveApplicationControlGroupInner object itself. - */ - public AdaptiveApplicationControlGroupInner withVmRecommendations(List vmRecommendations) { - if (this.innerProperties() == null) { - this.innerProperties = new AdaptiveApplicationControlGroupData(); - } - this.innerProperties().withVmRecommendations(vmRecommendations); - return this; - } - - /** - * Get the pathRecommendations property: The pathRecommendations property. - * - * @return the pathRecommendations value. - */ - public List pathRecommendations() { - return this.innerProperties() == null ? null : this.innerProperties().pathRecommendations(); - } - - /** - * Set the pathRecommendations property: The pathRecommendations property. - * - * @param pathRecommendations the pathRecommendations value to set. - * @return the AdaptiveApplicationControlGroupInner object itself. - */ - public AdaptiveApplicationControlGroupInner withPathRecommendations(List pathRecommendations) { - if (this.innerProperties() == null) { - this.innerProperties = new AdaptiveApplicationControlGroupData(); - } - this.innerProperties().withPathRecommendations(pathRecommendations); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model AdaptiveApplicationControlGroupInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AdaptiveApplicationControlGroupInner.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupsInner.java deleted file mode 100644 index 95c0019d7688..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveApplicationControlGroupsInner.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Represents a list of VM/server groups and set of rules that are Recommended by Microsoft Defender for Cloud to be - * allowed. - */ -@Fluent -public final class AdaptiveApplicationControlGroupsInner { - /* - * The value property. - */ - @JsonProperty(value = "value") - private List value; - - /** Creates an instance of AdaptiveApplicationControlGroupsInner class. */ - public AdaptiveApplicationControlGroupsInner() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the AdaptiveApplicationControlGroupsInner object itself. - */ - public AdaptiveApplicationControlGroupsInner 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/AdaptiveNetworkHardeningInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningInner.java deleted file mode 100644 index 463cfd294991..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningInner.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.EffectiveNetworkSecurityGroups; -import com.azure.resourcemanager.security.models.Rule; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The resource whose properties describes the Adaptive Network Hardening settings for some Azure resource. */ -@Fluent -public final class AdaptiveNetworkHardeningInner extends ProxyResource { - /* - * Properties of the Adaptive Network Hardening resource - */ - @JsonProperty(value = "properties") - private AdaptiveNetworkHardeningProperties innerProperties; - - /** Creates an instance of AdaptiveNetworkHardeningInner class. */ - public AdaptiveNetworkHardeningInner() { - } - - /** - * Get the innerProperties property: Properties of the Adaptive Network Hardening resource. - * - * @return the innerProperties value. - */ - private AdaptiveNetworkHardeningProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the rules property: The security rules which are recommended to be effective on the VM. - * - * @return the rules value. - */ - public List rules() { - return this.innerProperties() == null ? null : this.innerProperties().rules(); - } - - /** - * Set the rules property: The security rules which are recommended to be effective on the VM. - * - * @param rules the rules value to set. - * @return the AdaptiveNetworkHardeningInner object itself. - */ - public AdaptiveNetworkHardeningInner withRules(List rules) { - if (this.innerProperties() == null) { - this.innerProperties = new AdaptiveNetworkHardeningProperties(); - } - this.innerProperties().withRules(rules); - return this; - } - - /** - * Get the rulesCalculationTime property: The UTC time on which the rules were calculated. - * - * @return the rulesCalculationTime value. - */ - public OffsetDateTime rulesCalculationTime() { - return this.innerProperties() == null ? null : this.innerProperties().rulesCalculationTime(); - } - - /** - * Set the rulesCalculationTime property: The UTC time on which the rules were calculated. - * - * @param rulesCalculationTime the rulesCalculationTime value to set. - * @return the AdaptiveNetworkHardeningInner object itself. - */ - public AdaptiveNetworkHardeningInner withRulesCalculationTime(OffsetDateTime rulesCalculationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new AdaptiveNetworkHardeningProperties(); - } - this.innerProperties().withRulesCalculationTime(rulesCalculationTime); - return this; - } - - /** - * Get the effectiveNetworkSecurityGroups property: The Network Security Groups effective on the network interfaces - * of the protected resource. - * - * @return the effectiveNetworkSecurityGroups value. - */ - public List effectiveNetworkSecurityGroups() { - return this.innerProperties() == null ? null : this.innerProperties().effectiveNetworkSecurityGroups(); - } - - /** - * Set the effectiveNetworkSecurityGroups property: The Network Security Groups effective on the network interfaces - * of the protected resource. - * - * @param effectiveNetworkSecurityGroups the effectiveNetworkSecurityGroups value to set. - * @return the AdaptiveNetworkHardeningInner object itself. - */ - public AdaptiveNetworkHardeningInner withEffectiveNetworkSecurityGroups( - List effectiveNetworkSecurityGroups) { - if (this.innerProperties() == null) { - this.innerProperties = new AdaptiveNetworkHardeningProperties(); - } - this.innerProperties().withEffectiveNetworkSecurityGroups(effectiveNetworkSecurityGroups); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningProperties.java deleted file mode 100644 index d674845c0492..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdaptiveNetworkHardeningProperties.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.EffectiveNetworkSecurityGroups; -import com.azure.resourcemanager.security.models.Rule; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Adaptive Network Hardening resource properties. */ -@Fluent -public final class AdaptiveNetworkHardeningProperties { - /* - * The security rules which are recommended to be effective on the VM - */ - @JsonProperty(value = "rules") - private List rules; - - /* - * The UTC time on which the rules were calculated - */ - @JsonProperty(value = "rulesCalculationTime") - private OffsetDateTime rulesCalculationTime; - - /* - * The Network Security Groups effective on the network interfaces of the protected resource - */ - @JsonProperty(value = "effectiveNetworkSecurityGroups") - private List effectiveNetworkSecurityGroups; - - /** Creates an instance of AdaptiveNetworkHardeningProperties class. */ - public AdaptiveNetworkHardeningProperties() { - } - - /** - * Get the rules property: The security rules which are recommended to be effective on the VM. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: The security rules which are recommended to be effective on the VM. - * - * @param rules the rules value to set. - * @return the AdaptiveNetworkHardeningProperties object itself. - */ - public AdaptiveNetworkHardeningProperties withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Get the rulesCalculationTime property: The UTC time on which the rules were calculated. - * - * @return the rulesCalculationTime value. - */ - public OffsetDateTime rulesCalculationTime() { - return this.rulesCalculationTime; - } - - /** - * Set the rulesCalculationTime property: The UTC time on which the rules were calculated. - * - * @param rulesCalculationTime the rulesCalculationTime value to set. - * @return the AdaptiveNetworkHardeningProperties object itself. - */ - public AdaptiveNetworkHardeningProperties withRulesCalculationTime(OffsetDateTime rulesCalculationTime) { - this.rulesCalculationTime = rulesCalculationTime; - return this; - } - - /** - * Get the effectiveNetworkSecurityGroups property: The Network Security Groups effective on the network interfaces - * of the protected resource. - * - * @return the effectiveNetworkSecurityGroups value. - */ - public List effectiveNetworkSecurityGroups() { - return this.effectiveNetworkSecurityGroups; - } - - /** - * Set the effectiveNetworkSecurityGroups property: The Network Security Groups effective on the network interfaces - * of the protected resource. - * - * @param effectiveNetworkSecurityGroups the effectiveNetworkSecurityGroups value to set. - * @return the AdaptiveNetworkHardeningProperties object itself. - */ - public AdaptiveNetworkHardeningProperties withEffectiveNetworkSecurityGroups( - List effectiveNetworkSecurityGroups) { - this.effectiveNetworkSecurityGroups = effectiveNetworkSecurityGroups; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rules() != null) { - rules().forEach(e -> e.validate()); - } - if (effectiveNetworkSecurityGroups() != null) { - effectiveNetworkSecurityGroups().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionProperties.java deleted file mode 100644 index 3255fbeb3048..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionProperties.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Advanced Threat Protection settings. */ -@Fluent -public final class AdvancedThreatProtectionProperties { - /* - * Indicates whether Advanced Threat Protection is enabled. - */ - @JsonProperty(value = "isEnabled") - private Boolean isEnabled; - - /** Creates an instance of AdvancedThreatProtectionProperties class. */ - public AdvancedThreatProtectionProperties() { - } - - /** - * Get the isEnabled property: Indicates whether Advanced Threat Protection is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Indicates whether Advanced Threat Protection is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the AdvancedThreatProtectionProperties object itself. - */ - public AdvancedThreatProtectionProperties withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionSettingInner.java deleted file mode 100644 index fb63249f6d37..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AdvancedThreatProtectionSettingInner.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Advanced Threat Protection resource. */ -@Fluent -public final class AdvancedThreatProtectionSettingInner extends ProxyResource { - /* - * The Advanced Threat Protection settings. - */ - @JsonProperty(value = "properties") - private AdvancedThreatProtectionProperties innerProperties; - - /** Creates an instance of AdvancedThreatProtectionSettingInner class. */ - public AdvancedThreatProtectionSettingInner() { - } - - /** - * Get the innerProperties property: The Advanced Threat Protection settings. - * - * @return the innerProperties value. - */ - private AdvancedThreatProtectionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the isEnabled property: Indicates whether Advanced Threat Protection is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); - } - - /** - * Set the isEnabled property: Indicates whether Advanced Threat Protection is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the AdvancedThreatProtectionSettingInner object itself. - */ - public AdvancedThreatProtectionSettingInner withIsEnabled(Boolean isEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new AdvancedThreatProtectionProperties(); - } - this.innerProperties().withIsEnabled(isEnabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java deleted file mode 100644 index ac8fd6624bd4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertInner.java +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.AlertEntity; -import com.azure.resourcemanager.security.models.AlertPropertiesSupportingEvidence; -import com.azure.resourcemanager.security.models.AlertSeverity; -import com.azure.resourcemanager.security.models.AlertStatus; -import com.azure.resourcemanager.security.models.Intent; -import com.azure.resourcemanager.security.models.ResourceIdentifier; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** Security alert. */ -@Fluent -public final class AlertInner extends ProxyResource { - /* - * describes security alert properties. - */ - @JsonProperty(value = "properties") - private AlertProperties innerProperties; - - /** Creates an instance of AlertInner class. */ - public AlertInner() { - } - - /** - * Get the innerProperties property: describes security alert properties. - * - * @return the innerProperties value. - */ - private AlertProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the version property: Schema version. - * - * @return the version value. - */ - public String version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Get the alertType property: Unique identifier for the detection logic (all alert instances from the same - * detection logic will have the same alertType). - * - * @return the alertType value. - */ - public String alertType() { - return this.innerProperties() == null ? null : this.innerProperties().alertType(); - } - - /** - * Get the systemAlertId property: Unique identifier for the alert. - * - * @return the systemAlertId value. - */ - public String systemAlertId() { - return this.innerProperties() == null ? null : this.innerProperties().systemAlertId(); - } - - /** - * Get the productComponentName property: The name of Azure Security Center pricing tier which powering this alert. - * Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing. - * - * @return the productComponentName value. - */ - public String productComponentName() { - return this.innerProperties() == null ? null : this.innerProperties().productComponentName(); - } - - /** - * Get the alertDisplayName property: The display name of the alert. - * - * @return the alertDisplayName value. - */ - public String alertDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().alertDisplayName(); - } - - /** - * Get the description property: Description of the suspicious activity that was detected. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the severity property: The risk level of the threat that was detected. Learn more: - * https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. - * - * @return the severity value. - */ - public AlertSeverity severity() { - return this.innerProperties() == null ? null : this.innerProperties().severity(); - } - - /** - * Get the intent property: The kill chain related intent behind the alert. For list of supported values, and - * explanations of Azure Security Center's supported kill chain intents. - * - * @return the intent value. - */ - public Intent intent() { - return this.innerProperties() == null ? null : this.innerProperties().intent(); - } - - /** - * Get the startTimeUtc property: The UTC time of the first event or activity included in the alert in ISO8601 - * format. - * - * @return the startTimeUtc value. - */ - public OffsetDateTime startTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().startTimeUtc(); - } - - /** - * Get the endTimeUtc property: The UTC time of the last event or activity included in the alert in ISO8601 format. - * - * @return the endTimeUtc value. - */ - public OffsetDateTime endTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().endTimeUtc(); - } - - /** - * Get the resourceIdentifiers property: The resource identifiers that can be used to direct the alert to the right - * product exposure group (tenant, workspace, subscription etc.). There can be multiple identifiers of different - * type per alert. - * - * @return the resourceIdentifiers value. - */ - public List resourceIdentifiers() { - return this.innerProperties() == null ? null : this.innerProperties().resourceIdentifiers(); - } - - /** - * Get the remediationSteps property: Manual action items to take to remediate the alert. - * - * @return the remediationSteps value. - */ - public List remediationSteps() { - return this.innerProperties() == null ? null : this.innerProperties().remediationSteps(); - } - - /** - * Get the vendorName property: The name of the vendor that raises the alert. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.innerProperties() == null ? null : this.innerProperties().vendorName(); - } - - /** - * Get the status property: The life cycle status of the alert. - * - * @return the status value. - */ - public AlertStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the extendedLinks property: Links related to the alert. - * - * @return the extendedLinks value. - */ - public List> extendedLinks() { - return this.innerProperties() == null ? null : this.innerProperties().extendedLinks(); - } - - /** - * Get the alertUri property: A direct link to the alert page in Azure Portal. - * - * @return the alertUri value. - */ - public String alertUri() { - return this.innerProperties() == null ? null : this.innerProperties().alertUri(); - } - - /** - * Get the timeGeneratedUtc property: The UTC time the alert was generated in ISO8601 format. - * - * @return the timeGeneratedUtc value. - */ - public OffsetDateTime timeGeneratedUtc() { - return this.innerProperties() == null ? null : this.innerProperties().timeGeneratedUtc(); - } - - /** - * Get the productName property: The name of the product which published this alert (Microsoft Sentinel, Microsoft - * Defender for Identity, Microsoft Defender for Endpoint, Microsoft Defender for Office, Microsoft Defender for - * Cloud Apps, and so on). - * - * @return the productName value. - */ - public String productName() { - return this.innerProperties() == null ? null : this.innerProperties().productName(); - } - - /** - * Get the processingEndTimeUtc property: The UTC processing end time of the alert in ISO8601 format. - * - * @return the processingEndTimeUtc value. - */ - public OffsetDateTime processingEndTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().processingEndTimeUtc(); - } - - /** - * Get the entities property: A list of entities related to the alert. - * - * @return the entities value. - */ - public List entities() { - return this.innerProperties() == null ? null : this.innerProperties().entities(); - } - - /** - * Get the isIncident property: This field determines whether the alert is an incident (a compound grouping of - * several alerts) or a single alert. - * - * @return the isIncident value. - */ - public Boolean isIncident() { - return this.innerProperties() == null ? null : this.innerProperties().isIncident(); - } - - /** - * Get the correlationKey property: Key for corelating related alerts. Alerts with the same correlation key - * considered to be related. - * - * @return the correlationKey value. - */ - public String correlationKey() { - return this.innerProperties() == null ? null : this.innerProperties().correlationKey(); - } - - /** - * Get the extendedProperties property: Custom properties for the alert. - * - * @return the extendedProperties value. - */ - public Map extendedProperties() { - return this.innerProperties() == null ? null : this.innerProperties().extendedProperties(); - } - - /** - * Set the extendedProperties property: Custom properties for the alert. - * - * @param extendedProperties the extendedProperties value to set. - * @return the AlertInner object itself. - */ - public AlertInner withExtendedProperties(Map extendedProperties) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertProperties(); - } - this.innerProperties().withExtendedProperties(extendedProperties); - return this; - } - - /** - * Get the compromisedEntity property: The display name of the resource most related to this alert. - * - * @return the compromisedEntity value. - */ - public String compromisedEntity() { - return this.innerProperties() == null ? null : this.innerProperties().compromisedEntity(); - } - - /** - * Get the techniques property: kill chain related techniques behind the alert. - * - * @return the techniques value. - */ - public List techniques() { - return this.innerProperties() == null ? null : this.innerProperties().techniques(); - } - - /** - * Get the subTechniques property: Kill chain related sub-techniques behind the alert. - * - * @return the subTechniques value. - */ - public List subTechniques() { - return this.innerProperties() == null ? null : this.innerProperties().subTechniques(); - } - - /** - * Get the supportingEvidence property: Changing set of properties depending on the supportingEvidence type. - * - * @return the supportingEvidence value. - */ - public AlertPropertiesSupportingEvidence supportingEvidence() { - return this.innerProperties() == null ? null : this.innerProperties().supportingEvidence(); - } - - /** - * Set the supportingEvidence property: Changing set of properties depending on the supportingEvidence type. - * - * @param supportingEvidence the supportingEvidence value to set. - * @return the AlertInner object itself. - */ - public AlertInner withSupportingEvidence(AlertPropertiesSupportingEvidence supportingEvidence) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertProperties(); - } - this.innerProperties().withSupportingEvidence(supportingEvidence); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java deleted file mode 100644 index 5a65af987b50..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertProperties.java +++ /dev/null @@ -1,489 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.AlertEntity; -import com.azure.resourcemanager.security.models.AlertPropertiesSupportingEvidence; -import com.azure.resourcemanager.security.models.AlertSeverity; -import com.azure.resourcemanager.security.models.AlertStatus; -import com.azure.resourcemanager.security.models.Intent; -import com.azure.resourcemanager.security.models.ResourceIdentifier; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** describes security alert properties. */ -@Fluent -public final class AlertProperties { - /* - * Schema version. - */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) - private String version; - - /* - * Unique identifier for the detection logic (all alert instances from the same detection logic will have the same - * alertType). - */ - @JsonProperty(value = "alertType", access = JsonProperty.Access.WRITE_ONLY) - private String alertType; - - /* - * Unique identifier for the alert. - */ - @JsonProperty(value = "systemAlertId", access = JsonProperty.Access.WRITE_ONLY) - private String systemAlertId; - - /* - * The name of Azure Security Center pricing tier which powering this alert. Learn more: - * https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing - */ - @JsonProperty(value = "productComponentName", access = JsonProperty.Access.WRITE_ONLY) - private String productComponentName; - - /* - * The display name of the alert. - */ - @JsonProperty(value = "alertDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String alertDisplayName; - - /* - * Description of the suspicious activity that was detected. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The risk level of the threat that was detected. Learn more: - * https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. - */ - @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) - private AlertSeverity severity; - - /* - * The kill chain related intent behind the alert. For list of supported values, and explanations of Azure Security - * Center's supported kill chain intents. - */ - @JsonProperty(value = "intent", access = JsonProperty.Access.WRITE_ONLY) - private Intent intent; - - /* - * The UTC time of the first event or activity included in the alert in ISO8601 format. - */ - @JsonProperty(value = "startTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startTimeUtc; - - /* - * The UTC time of the last event or activity included in the alert in ISO8601 format. - */ - @JsonProperty(value = "endTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime endTimeUtc; - - /* - * The resource identifiers that can be used to direct the alert to the right product exposure group (tenant, - * workspace, subscription etc.). There can be multiple identifiers of different type per alert. - */ - @JsonProperty(value = "resourceIdentifiers", access = JsonProperty.Access.WRITE_ONLY) - private List resourceIdentifiers; - - /* - * Manual action items to take to remediate the alert. - */ - @JsonProperty(value = "remediationSteps", access = JsonProperty.Access.WRITE_ONLY) - private List remediationSteps; - - /* - * The name of the vendor that raises the alert. - */ - @JsonProperty(value = "vendorName", access = JsonProperty.Access.WRITE_ONLY) - private String vendorName; - - /* - * The life cycle status of the alert. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private AlertStatus status; - - /* - * Links related to the alert - */ - @JsonProperty(value = "extendedLinks", access = JsonProperty.Access.WRITE_ONLY) - private List> extendedLinks; - - /* - * A direct link to the alert page in Azure Portal. - */ - @JsonProperty(value = "alertUri", access = JsonProperty.Access.WRITE_ONLY) - private String alertUri; - - /* - * The UTC time the alert was generated in ISO8601 format. - */ - @JsonProperty(value = "timeGeneratedUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime timeGeneratedUtc; - - /* - * The name of the product which published this alert (Microsoft Sentinel, Microsoft Defender for Identity, - * Microsoft Defender for Endpoint, Microsoft Defender for Office, Microsoft Defender for Cloud Apps, and so on). - */ - @JsonProperty(value = "productName", access = JsonProperty.Access.WRITE_ONLY) - private String productName; - - /* - * The UTC processing end time of the alert in ISO8601 format. - */ - @JsonProperty(value = "processingEndTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime processingEndTimeUtc; - - /* - * A list of entities related to the alert. - */ - @JsonProperty(value = "entities", access = JsonProperty.Access.WRITE_ONLY) - private List entities; - - /* - * This field determines whether the alert is an incident (a compound grouping of several alerts) or a single - * alert. - */ - @JsonProperty(value = "isIncident", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isIncident; - - /* - * Key for corelating related alerts. Alerts with the same correlation key considered to be related. - */ - @JsonProperty(value = "correlationKey", access = JsonProperty.Access.WRITE_ONLY) - private String correlationKey; - - /* - * Custom properties for the alert. - */ - @JsonProperty(value = "extendedProperties") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map extendedProperties; - - /* - * The display name of the resource most related to this alert. - */ - @JsonProperty(value = "compromisedEntity", access = JsonProperty.Access.WRITE_ONLY) - private String compromisedEntity; - - /* - * kill chain related techniques behind the alert. - */ - @JsonProperty(value = "techniques", access = JsonProperty.Access.WRITE_ONLY) - private List techniques; - - /* - * Kill chain related sub-techniques behind the alert. - */ - @JsonProperty(value = "subTechniques", access = JsonProperty.Access.WRITE_ONLY) - private List subTechniques; - - /* - * Changing set of properties depending on the supportingEvidence type. - */ - @JsonProperty(value = "supportingEvidence") - private AlertPropertiesSupportingEvidence supportingEvidence; - - /** Creates an instance of AlertProperties class. */ - public AlertProperties() { - } - - /** - * Get the version property: Schema version. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Get the alertType property: Unique identifier for the detection logic (all alert instances from the same - * detection logic will have the same alertType). - * - * @return the alertType value. - */ - public String alertType() { - return this.alertType; - } - - /** - * Get the systemAlertId property: Unique identifier for the alert. - * - * @return the systemAlertId value. - */ - public String systemAlertId() { - return this.systemAlertId; - } - - /** - * Get the productComponentName property: The name of Azure Security Center pricing tier which powering this alert. - * Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing. - * - * @return the productComponentName value. - */ - public String productComponentName() { - return this.productComponentName; - } - - /** - * Get the alertDisplayName property: The display name of the alert. - * - * @return the alertDisplayName value. - */ - public String alertDisplayName() { - return this.alertDisplayName; - } - - /** - * Get the description property: Description of the suspicious activity that was detected. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the severity property: The risk level of the threat that was detected. Learn more: - * https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. - * - * @return the severity value. - */ - public AlertSeverity severity() { - return this.severity; - } - - /** - * Get the intent property: The kill chain related intent behind the alert. For list of supported values, and - * explanations of Azure Security Center's supported kill chain intents. - * - * @return the intent value. - */ - public Intent intent() { - return this.intent; - } - - /** - * Get the startTimeUtc property: The UTC time of the first event or activity included in the alert in ISO8601 - * format. - * - * @return the startTimeUtc value. - */ - public OffsetDateTime startTimeUtc() { - return this.startTimeUtc; - } - - /** - * Get the endTimeUtc property: The UTC time of the last event or activity included in the alert in ISO8601 format. - * - * @return the endTimeUtc value. - */ - public OffsetDateTime endTimeUtc() { - return this.endTimeUtc; - } - - /** - * Get the resourceIdentifiers property: The resource identifiers that can be used to direct the alert to the right - * product exposure group (tenant, workspace, subscription etc.). There can be multiple identifiers of different - * type per alert. - * - * @return the resourceIdentifiers value. - */ - public List resourceIdentifiers() { - return this.resourceIdentifiers; - } - - /** - * Get the remediationSteps property: Manual action items to take to remediate the alert. - * - * @return the remediationSteps value. - */ - public List remediationSteps() { - return this.remediationSteps; - } - - /** - * Get the vendorName property: The name of the vendor that raises the alert. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.vendorName; - } - - /** - * Get the status property: The life cycle status of the alert. - * - * @return the status value. - */ - public AlertStatus status() { - return this.status; - } - - /** - * Get the extendedLinks property: Links related to the alert. - * - * @return the extendedLinks value. - */ - public List> extendedLinks() { - return this.extendedLinks; - } - - /** - * Get the alertUri property: A direct link to the alert page in Azure Portal. - * - * @return the alertUri value. - */ - public String alertUri() { - return this.alertUri; - } - - /** - * Get the timeGeneratedUtc property: The UTC time the alert was generated in ISO8601 format. - * - * @return the timeGeneratedUtc value. - */ - public OffsetDateTime timeGeneratedUtc() { - return this.timeGeneratedUtc; - } - - /** - * Get the productName property: The name of the product which published this alert (Microsoft Sentinel, Microsoft - * Defender for Identity, Microsoft Defender for Endpoint, Microsoft Defender for Office, Microsoft Defender for - * Cloud Apps, and so on). - * - * @return the productName value. - */ - public String productName() { - return this.productName; - } - - /** - * Get the processingEndTimeUtc property: The UTC processing end time of the alert in ISO8601 format. - * - * @return the processingEndTimeUtc value. - */ - public OffsetDateTime processingEndTimeUtc() { - return this.processingEndTimeUtc; - } - - /** - * Get the entities property: A list of entities related to the alert. - * - * @return the entities value. - */ - public List entities() { - return this.entities; - } - - /** - * Get the isIncident property: This field determines whether the alert is an incident (a compound grouping of - * several alerts) or a single alert. - * - * @return the isIncident value. - */ - public Boolean isIncident() { - return this.isIncident; - } - - /** - * Get the correlationKey property: Key for corelating related alerts. Alerts with the same correlation key - * considered to be related. - * - * @return the correlationKey value. - */ - public String correlationKey() { - return this.correlationKey; - } - - /** - * Get the extendedProperties property: Custom properties for the alert. - * - * @return the extendedProperties value. - */ - public Map extendedProperties() { - return this.extendedProperties; - } - - /** - * Set the extendedProperties property: Custom properties for the alert. - * - * @param extendedProperties the extendedProperties value to set. - * @return the AlertProperties object itself. - */ - public AlertProperties withExtendedProperties(Map extendedProperties) { - this.extendedProperties = extendedProperties; - return this; - } - - /** - * Get the compromisedEntity property: The display name of the resource most related to this alert. - * - * @return the compromisedEntity value. - */ - public String compromisedEntity() { - return this.compromisedEntity; - } - - /** - * Get the techniques property: kill chain related techniques behind the alert. - * - * @return the techniques value. - */ - public List techniques() { - return this.techniques; - } - - /** - * Get the subTechniques property: Kill chain related sub-techniques behind the alert. - * - * @return the subTechniques value. - */ - public List subTechniques() { - return this.subTechniques; - } - - /** - * Get the supportingEvidence property: Changing set of properties depending on the supportingEvidence type. - * - * @return the supportingEvidence value. - */ - public AlertPropertiesSupportingEvidence supportingEvidence() { - return this.supportingEvidence; - } - - /** - * Set the supportingEvidence property: Changing set of properties depending on the supportingEvidence type. - * - * @param supportingEvidence the supportingEvidence value to set. - * @return the AlertProperties object itself. - */ - public AlertProperties withSupportingEvidence(AlertPropertiesSupportingEvidence supportingEvidence) { - this.supportingEvidence = supportingEvidence; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceIdentifiers() != null) { - resourceIdentifiers().forEach(e -> e.validate()); - } - if (entities() != null) { - entities().forEach(e -> e.validate()); - } - if (supportingEvidence() != null) { - supportingEvidence().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertSyncSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertSyncSettingProperties.java deleted file mode 100644 index fe3186458ebb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertSyncSettingProperties.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The alert sync setting properties. */ -@Fluent -public final class AlertSyncSettingProperties { - /* - * Is the alert sync setting enabled - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /** Creates an instance of AlertSyncSettingProperties class. */ - public AlertSyncSettingProperties() { - } - - /** - * Get the enabled property: Is the alert sync setting enabled. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is the alert sync setting enabled. - * - * @param enabled the enabled value to set. - * @return the AlertSyncSettingProperties object itself. - */ - public AlertSyncSettingProperties withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleInner.java deleted file mode 100644 index 110197b8998b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleInner.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Describes the suppression rule. */ -@Fluent -public final class AlertsSuppressionRuleInner extends ProxyResource { - /* - * describes AlertsSuppressionRule properties - */ - @JsonProperty(value = "properties") - private AlertsSuppressionRuleProperties innerProperties; - - /** Creates an instance of AlertsSuppressionRuleInner class. */ - public AlertsSuppressionRuleInner() { - } - - /** - * Get the innerProperties property: describes AlertsSuppressionRule properties. - * - * @return the innerProperties value. - */ - private AlertsSuppressionRuleProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. - * - * @return the alertType value. - */ - public String alertType() { - return this.innerProperties() == null ? null : this.innerProperties().alertType(); - } - - /** - * Set the alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. - * - * @param alertType the alertType value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withAlertType(String alertType) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withAlertType(alertType); - return this; - } - - /** - * Get the lastModifiedUtc property: The last time this rule was modified. - * - * @return the lastModifiedUtc value. - */ - public OffsetDateTime lastModifiedUtc() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc(); - } - - /** - * Get the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * this field will default to the maximum allowed expiration date. - * - * @return the expirationDateUtc value. - */ - public OffsetDateTime expirationDateUtc() { - return this.innerProperties() == null ? null : this.innerProperties().expirationDateUtc(); - } - - /** - * Set the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * this field will default to the maximum allowed expiration date. - * - * @param expirationDateUtc the expirationDateUtc value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withExpirationDateUtc(OffsetDateTime expirationDateUtc) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withExpirationDateUtc(expirationDateUtc); - return this; - } - - /** - * Get the reason property: The reason for dismissing the alert. - * - * @return the reason value. - */ - public String reason() { - return this.innerProperties() == null ? null : this.innerProperties().reason(); - } - - /** - * Set the reason property: The reason for dismissing the alert. - * - * @param reason the reason value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withReason(String reason) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withReason(reason); - return this; - } - - /** - * Get the state property: Possible states of the rule. - * - * @return the state value. - */ - public RuleState state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Possible states of the rule. - * - * @param state the state value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withState(RuleState state) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withState(state); - return this; - } - - /** - * Get the comment property: Any comment regarding the rule. - * - * @return the comment value. - */ - public String comment() { - return this.innerProperties() == null ? null : this.innerProperties().comment(); - } - - /** - * Set the comment property: Any comment regarding the rule. - * - * @param comment the comment value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withComment(String comment) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withComment(comment); - return this; - } - - /** - * Get the suppressionAlertsScope property: The suppression conditions. - * - * @return the suppressionAlertsScope value. - */ - public SuppressionAlertsScope suppressionAlertsScope() { - return this.innerProperties() == null ? null : this.innerProperties().suppressionAlertsScope(); - } - - /** - * Set the suppressionAlertsScope property: The suppression conditions. - * - * @param suppressionAlertsScope the suppressionAlertsScope value to set. - * @return the AlertsSuppressionRuleInner object itself. - */ - public AlertsSuppressionRuleInner withSuppressionAlertsScope(SuppressionAlertsScope suppressionAlertsScope) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertsSuppressionRuleProperties(); - } - this.innerProperties().withSuppressionAlertsScope(suppressionAlertsScope); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleProperties.java deleted file mode 100644 index 3ec48688de44..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AlertsSuppressionRuleProperties.java +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** describes AlertsSuppressionRule properties. */ -@Fluent -public final class AlertsSuppressionRuleProperties { - /* - * Type of the alert to automatically suppress. For all alert types, use '*' - */ - @JsonProperty(value = "alertType", required = true) - private String alertType; - - /* - * The last time this rule was modified - */ - @JsonProperty(value = "lastModifiedUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedUtc; - - /* - * Expiration date of the rule, if value is not provided or provided as null this field will default to the maximum - * allowed expiration date. - */ - @JsonProperty(value = "expirationDateUtc") - private OffsetDateTime expirationDateUtc; - - /* - * The reason for dismissing the alert - */ - @JsonProperty(value = "reason", required = true) - private String reason; - - /* - * Possible states of the rule - */ - @JsonProperty(value = "state", required = true) - private RuleState state; - - /* - * Any comment regarding the rule - */ - @JsonProperty(value = "comment") - private String comment; - - /* - * The suppression conditions - */ - @JsonProperty(value = "suppressionAlertsScope") - private SuppressionAlertsScope suppressionAlertsScope; - - /** Creates an instance of AlertsSuppressionRuleProperties class. */ - public AlertsSuppressionRuleProperties() { - } - - /** - * Get the alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. - * - * @return the alertType value. - */ - public String alertType() { - return this.alertType; - } - - /** - * Set the alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. - * - * @param alertType the alertType value to set. - * @return the AlertsSuppressionRuleProperties object itself. - */ - public AlertsSuppressionRuleProperties withAlertType(String alertType) { - this.alertType = alertType; - return this; - } - - /** - * Get the lastModifiedUtc property: The last time this rule was modified. - * - * @return the lastModifiedUtc value. - */ - public OffsetDateTime lastModifiedUtc() { - return this.lastModifiedUtc; - } - - /** - * Get the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * this field will default to the maximum allowed expiration date. - * - * @return the expirationDateUtc value. - */ - public OffsetDateTime expirationDateUtc() { - return this.expirationDateUtc; - } - - /** - * Set the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * this field will default to the maximum allowed expiration date. - * - * @param expirationDateUtc the expirationDateUtc value to set. - * @return the AlertsSuppressionRuleProperties object itself. - */ - public AlertsSuppressionRuleProperties withExpirationDateUtc(OffsetDateTime expirationDateUtc) { - this.expirationDateUtc = expirationDateUtc; - return this; - } - - /** - * Get the reason property: The reason for dismissing the alert. - * - * @return the reason value. - */ - public String reason() { - return this.reason; - } - - /** - * Set the reason property: The reason for dismissing the alert. - * - * @param reason the reason value to set. - * @return the AlertsSuppressionRuleProperties object itself. - */ - public AlertsSuppressionRuleProperties withReason(String reason) { - this.reason = reason; - return this; - } - - /** - * Get the state property: Possible states of the rule. - * - * @return the state value. - */ - public RuleState state() { - return this.state; - } - - /** - * Set the state property: Possible states of the rule. - * - * @param state the state value to set. - * @return the AlertsSuppressionRuleProperties object itself. - */ - public AlertsSuppressionRuleProperties withState(RuleState state) { - this.state = state; - return this; - } - - /** - * Get the comment property: Any comment regarding the rule. - * - * @return the comment value. - */ - public String comment() { - return this.comment; - } - - /** - * Set the comment property: Any comment regarding the rule. - * - * @param comment the comment value to set. - * @return the AlertsSuppressionRuleProperties object itself. - */ - public AlertsSuppressionRuleProperties withComment(String comment) { - this.comment = comment; - return this; - } - - /** - * Get the suppressionAlertsScope property: The suppression conditions. - * - * @return the suppressionAlertsScope value. - */ - public SuppressionAlertsScope suppressionAlertsScope() { - return this.suppressionAlertsScope; - } - - /** - * Set the suppressionAlertsScope property: The suppression conditions. - * - * @param suppressionAlertsScope the suppressionAlertsScope value to set. - * @return the AlertsSuppressionRuleProperties object itself. - */ - public AlertsSuppressionRuleProperties withSuppressionAlertsScope(SuppressionAlertsScope suppressionAlertsScope) { - this.suppressionAlertsScope = suppressionAlertsScope; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (alertType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property alertType in model AlertsSuppressionRuleProperties")); - } - if (reason() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property reason in model AlertsSuppressionRuleProperties")); - } - if (state() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property state in model AlertsSuppressionRuleProperties")); - } - if (suppressionAlertsScope() != null) { - suppressionAlertsScope().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AlertsSuppressionRuleProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceInner.java deleted file mode 100644 index 7c222562dfcb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceInner.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.ConnectableResource; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The resource whose properties describes the allowed traffic between Azure resources. */ -@Immutable -public final class AllowedConnectionsResourceInner extends ProxyResource { - /* - * Describes the allowed traffic between Azure resources - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private AllowedConnectionsResourceProperties innerProperties; - - /* - * Location where the resource is stored - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /** Creates an instance of AllowedConnectionsResourceInner class. */ - public AllowedConnectionsResourceInner() { - } - - /** - * Get the innerProperties property: Describes the allowed traffic between Azure resources. - * - * @return the innerProperties value. - */ - private AllowedConnectionsResourceProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the calculatedDateTime property: The UTC time on which the allowed connections resource was calculated. - * - * @return the calculatedDateTime value. - */ - public OffsetDateTime calculatedDateTime() { - return this.innerProperties() == null ? null : this.innerProperties().calculatedDateTime(); - } - - /** - * Get the connectableResources property: List of connectable resources. - * - * @return the connectableResources value. - */ - public List connectableResources() { - return this.innerProperties() == null ? null : this.innerProperties().connectableResources(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceProperties.java deleted file mode 100644 index 26132bd10a55..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AllowedConnectionsResourceProperties.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.security.models.ConnectableResource; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Describes the allowed traffic between Azure resources. */ -@Immutable -public final class AllowedConnectionsResourceProperties { - /* - * The UTC time on which the allowed connections resource was calculated - */ - @JsonProperty(value = "calculatedDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime calculatedDateTime; - - /* - * List of connectable resources - */ - @JsonProperty(value = "connectableResources", access = JsonProperty.Access.WRITE_ONLY) - private List connectableResources; - - /** Creates an instance of AllowedConnectionsResourceProperties class. */ - public AllowedConnectionsResourceProperties() { - } - - /** - * Get the calculatedDateTime property: The UTC time on which the allowed connections resource was calculated. - * - * @return the calculatedDateTime value. - */ - public OffsetDateTime calculatedDateTime() { - return this.calculatedDateTime; - } - - /** - * Get the connectableResources property: List of connectable resources. - * - * @return the connectableResources value. - */ - public List connectableResources() { - return this.connectableResources; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (connectableResources() != null) { - connectableResources().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionProperties.java deleted file mode 100644 index 951e62c71a5c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionProperties.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Describes the properties of an API collection. */ -@Fluent -public final class ApiCollectionProperties { - /* - * The display name of the Azure API Management API. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * Additional data regarding the API collection. - */ - @JsonProperty(value = "additionalData") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map additionalData; - - /** Creates an instance of ApiCollectionProperties class. */ - public ApiCollectionProperties() { - } - - /** - * Get the displayName property: The display name of the Azure API Management API. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the Azure API Management API. - * - * @param displayName the displayName value to set. - * @return the ApiCollectionProperties object itself. - */ - public ApiCollectionProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the additionalData property: Additional data regarding the API collection. - * - * @return the additionalData value. - */ - public Map additionalData() { - return this.additionalData; - } - - /** - * Set the additionalData property: Additional data regarding the API collection. - * - * @param additionalData the additionalData value to set. - * @return the ApiCollectionProperties object itself. - */ - public ApiCollectionProperties withAdditionalData(Map additionalData) { - this.additionalData = additionalData; - 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/ApiCollectionResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionResponseInner.java deleted file mode 100644 index 6224a7ea4eb4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApiCollectionResponseInner.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** An API collection as represented by Defender for APIs. */ -@Fluent -public final class ApiCollectionResponseInner extends ProxyResource { - /* - * Describes the properties of an API collection. - */ - @JsonProperty(value = "properties") - private ApiCollectionProperties innerProperties; - - /** Creates an instance of ApiCollectionResponseInner class. */ - public ApiCollectionResponseInner() { - } - - /** - * Get the innerProperties property: Describes the properties of an API collection. - * - * @return the innerProperties value. - */ - private ApiCollectionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the displayName property: The display name of the Azure API Management API. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The display name of the Azure API Management API. - * - * @param displayName the displayName value to set. - * @return the ApiCollectionResponseInner object itself. - */ - public ApiCollectionResponseInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new ApiCollectionProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the additionalData property: Additional data regarding the API collection. - * - * @return the additionalData value. - */ - public Map additionalData() { - return this.innerProperties() == null ? null : this.innerProperties().additionalData(); - } - - /** - * Set the additionalData property: Additional data regarding the API collection. - * - * @param additionalData the additionalData value to set. - * @return the ApiCollectionResponseInner object itself. - */ - public ApiCollectionResponseInner withAdditionalData(Map additionalData) { - if (this.innerProperties() == null) { - this.innerProperties = new ApiCollectionProperties(); - } - this.innerProperties().withAdditionalData(additionalData); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationInner.java deleted file mode 100644 index 52bda95475ad..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Security Application over a given scope. */ -@Fluent -public final class ApplicationInner extends ProxyResource { - /* - * Properties of a security application - */ - @JsonProperty(value = "properties") - private ApplicationProperties innerProperties; - - /** Creates an instance of ApplicationInner class. */ - public ApplicationInner() { - } - - /** - * Get the innerProperties property: Properties of a security application. - * - * @return the innerProperties value. - */ - private ApplicationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the displayName property: display name of the application. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: display name of the application. - * - * @param displayName the displayName value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the description property: description of the application. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: description of the application. - * - * @param description the description value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - public ApplicationSourceResourceType sourceResourceType() { - return this.innerProperties() == null ? null : this.innerProperties().sourceResourceType(); - } - - /** - * Set the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @param sourceResourceType the sourceResourceType value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withSourceResourceType(ApplicationSourceResourceType sourceResourceType) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withSourceResourceType(sourceResourceType); - return this; - } - - /** - * Get the conditionSets property: The application conditionSets - see examples. - * - * @return the conditionSets value. - */ - public List conditionSets() { - return this.innerProperties() == null ? null : this.innerProperties().conditionSets(); - } - - /** - * Set the conditionSets property: The application conditionSets - see examples. - * - * @param conditionSets the conditionSets value to set. - * @return the ApplicationInner object itself. - */ - public ApplicationInner withConditionSets(List conditionSets) { - if (this.innerProperties() == null) { - this.innerProperties = new ApplicationProperties(); - } - this.innerProperties().withConditionSets(conditionSets); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationProperties.java deleted file mode 100644 index bace1b11b0a5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ApplicationProperties.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes properties of an application. */ -@Fluent -public final class ApplicationProperties { - /* - * display name of the application - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * description of the application - */ - @JsonProperty(value = "description") - private String description; - - /* - * The application source, what it affects, e.g. Assessments - */ - @JsonProperty(value = "sourceResourceType", required = true) - private ApplicationSourceResourceType sourceResourceType; - - /* - * The application conditionSets - see examples - */ - @JsonProperty(value = "conditionSets", required = true) - private List conditionSets; - - /** Creates an instance of ApplicationProperties class. */ - public ApplicationProperties() { - } - - /** - * Get the displayName property: display name of the application. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: display name of the application. - * - * @param displayName the displayName value to set. - * @return the ApplicationProperties object itself. - */ - public ApplicationProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: description of the application. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: description of the application. - * - * @param description the description value to set. - * @return the ApplicationProperties object itself. - */ - public ApplicationProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - public ApplicationSourceResourceType sourceResourceType() { - return this.sourceResourceType; - } - - /** - * Set the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @param sourceResourceType the sourceResourceType value to set. - * @return the ApplicationProperties object itself. - */ - public ApplicationProperties withSourceResourceType(ApplicationSourceResourceType sourceResourceType) { - this.sourceResourceType = sourceResourceType; - return this; - } - - /** - * Get the conditionSets property: The application conditionSets - see examples. - * - * @return the conditionSets value. - */ - public List conditionSets() { - return this.conditionSets; - } - - /** - * Set the conditionSets property: The application conditionSets - see examples. - * - * @param conditionSets the conditionSets value to set. - * @return the ApplicationProperties object itself. - */ - public ApplicationProperties withConditionSets(List conditionSets) { - this.conditionSets = conditionSets; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sourceResourceType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceResourceType in model ApplicationProperties")); - } - if (conditionSets() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property conditionSets in model ApplicationProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ApplicationProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AscLocationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AscLocationInner.java deleted file mode 100644 index 351e2b24190f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AscLocationInner.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ASC location of the subscription is in the "name" field. */ -@Fluent -public final class AscLocationInner extends ProxyResource { - /* - * An empty set of properties - */ - @JsonProperty(value = "properties") - private Object properties; - - /** Creates an instance of AscLocationInner class. */ - public AscLocationInner() { - } - - /** - * Get the properties property: An empty set of properties. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * Set the properties property: An empty set of properties. - * - * @param properties the properties value to set. - * @return the AscLocationInner object itself. - */ - public AscLocationInner withProperties(Object properties) { - this.properties = properties; - return this; - } - - /** - * 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/AutoProvisioningSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingInner.java deleted file mode 100644 index 8360f8b33cc3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Auto provisioning setting. */ -@Fluent -public final class AutoProvisioningSettingInner extends ProxyResource { - /* - * Auto provisioning setting data - */ - @JsonProperty(value = "properties") - private AutoProvisioningSettingProperties innerProperties; - - /** Creates an instance of AutoProvisioningSettingInner class. */ - public AutoProvisioningSettingInner() { - } - - /** - * Get the innerProperties property: Auto provisioning setting data. - * - * @return the innerProperties value. - */ - private AutoProvisioningSettingProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @return the autoProvision value. - */ - public AutoProvision autoProvision() { - return this.innerProperties() == null ? null : this.innerProperties().autoProvision(); - } - - /** - * Set the autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @param autoProvision the autoProvision value to set. - * @return the AutoProvisioningSettingInner object itself. - */ - public AutoProvisioningSettingInner withAutoProvision(AutoProvision autoProvision) { - if (this.innerProperties() == null) { - this.innerProperties = new AutoProvisioningSettingProperties(); - } - this.innerProperties().withAutoProvision(autoProvision); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingProperties.java deleted file mode 100644 index 52a8ebeec012..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutoProvisioningSettingProperties.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** describes properties of an auto provisioning setting. */ -@Fluent -public final class AutoProvisioningSettingProperties { - /* - * Describes what kind of security agent provisioning action to take - */ - @JsonProperty(value = "autoProvision", required = true) - private AutoProvision autoProvision; - - /** Creates an instance of AutoProvisioningSettingProperties class. */ - public AutoProvisioningSettingProperties() { - } - - /** - * Get the autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @return the autoProvision value. - */ - public AutoProvision autoProvision() { - return this.autoProvision; - } - - /** - * Set the autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @param autoProvision the autoProvision value to set. - * @return the AutoProvisioningSettingProperties object itself. - */ - public AutoProvisioningSettingProperties withAutoProvision(AutoProvision autoProvision) { - this.autoProvision = autoProvision; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (autoProvision() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property autoProvision in model AutoProvisioningSettingProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AutoProvisioningSettingProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationInner.java deleted file mode 100644 index 3881c341098c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationInner.java +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.resourcemanager.security.models.AutomationAction; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The security automation resource. */ -@Fluent -public final class AutomationInner extends Resource { - /* - * Security automation data - */ - @JsonProperty(value = "properties") - private AutomationProperties innerProperties; - - /** Creates an instance of AutomationInner class. */ - public AutomationInner() { - } - - /** - * Get the innerProperties property: Security automation data. - * - * @return the innerProperties value. - */ - private AutomationProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public AutomationInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AutomationInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the description property: The security automation description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The security automation description. - * - * @param description the description value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the isEnabled property: Indicates whether the security automation is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.innerProperties() == null ? null : this.innerProperties().isEnabled(); - } - - /** - * Set the isEnabled property: Indicates whether the security automation is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withIsEnabled(Boolean isEnabled) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withIsEnabled(isEnabled); - return this; - } - - /** - * Get the scopes property: A collection of scopes on which the security automations logic is applied. Supported - * scopes are the subscription itself or a resource group under that subscription. The automation will only apply on - * defined scopes. - * - * @return the scopes value. - */ - public List scopes() { - return this.innerProperties() == null ? null : this.innerProperties().scopes(); - } - - /** - * Set the scopes property: A collection of scopes on which the security automations logic is applied. Supported - * scopes are the subscription itself or a resource group under that subscription. The automation will only apply on - * defined scopes. - * - * @param scopes the scopes value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withScopes(List scopes) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withScopes(scopes); - return this; - } - - /** - * Get the sources property: A collection of the source event types which evaluate the security automation set of - * rules. - * - * @return the sources value. - */ - public List sources() { - return this.innerProperties() == null ? null : this.innerProperties().sources(); - } - - /** - * Set the sources property: A collection of the source event types which evaluate the security automation set of - * rules. - * - * @param sources the sources value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withSources(List sources) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withSources(sources); - return this; - } - - /** - * Get the actions property: A collection of the actions which are triggered if all the configured rules - * evaluations, within at least one rule set, are true. - * - * @return the actions value. - */ - public List actions() { - return this.innerProperties() == null ? null : this.innerProperties().actions(); - } - - /** - * Set the actions property: A collection of the actions which are triggered if all the configured rules - * evaluations, within at least one rule set, are true. - * - * @param actions the actions value to set. - * @return the AutomationInner object itself. - */ - public AutomationInner withActions(List actions) { - if (this.innerProperties() == null) { - this.innerProperties = new AutomationProperties(); - } - this.innerProperties().withActions(actions); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationProperties.java deleted file mode 100644 index c84b9645e428..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationProperties.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.AutomationAction; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * A set of properties that defines the behavior of the automation configuration. To learn more about the supported - * security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas. - */ -@Fluent -public final class AutomationProperties { - /* - * The security automation description. - */ - @JsonProperty(value = "description") - private String description; - - /* - * Indicates whether the security automation is enabled. - */ - @JsonProperty(value = "isEnabled") - private Boolean isEnabled; - - /* - * A collection of scopes on which the security automations logic is applied. Supported scopes are the subscription - * itself or a resource group under that subscription. The automation will only apply on defined scopes. - */ - @JsonProperty(value = "scopes") - private List scopes; - - /* - * A collection of the source event types which evaluate the security automation set of rules. - */ - @JsonProperty(value = "sources") - private List sources; - - /* - * A collection of the actions which are triggered if all the configured rules evaluations, within at least one - * rule set, are true. - */ - @JsonProperty(value = "actions") - private List actions; - - /** Creates an instance of AutomationProperties class. */ - public AutomationProperties() { - } - - /** - * Get the description property: The security automation description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The security automation description. - * - * @param description the description value to set. - * @return the AutomationProperties object itself. - */ - public AutomationProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the isEnabled property: Indicates whether the security automation is enabled. - * - * @return the isEnabled value. - */ - public Boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Indicates whether the security automation is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the AutomationProperties object itself. - */ - public AutomationProperties withIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Get the scopes property: A collection of scopes on which the security automations logic is applied. Supported - * scopes are the subscription itself or a resource group under that subscription. The automation will only apply on - * defined scopes. - * - * @return the scopes value. - */ - public List scopes() { - return this.scopes; - } - - /** - * Set the scopes property: A collection of scopes on which the security automations logic is applied. Supported - * scopes are the subscription itself or a resource group under that subscription. The automation will only apply on - * defined scopes. - * - * @param scopes the scopes value to set. - * @return the AutomationProperties object itself. - */ - public AutomationProperties withScopes(List scopes) { - this.scopes = scopes; - return this; - } - - /** - * Get the sources property: A collection of the source event types which evaluate the security automation set of - * rules. - * - * @return the sources value. - */ - public List sources() { - return this.sources; - } - - /** - * Set the sources property: A collection of the source event types which evaluate the security automation set of - * rules. - * - * @param sources the sources value to set. - * @return the AutomationProperties object itself. - */ - public AutomationProperties withSources(List sources) { - this.sources = sources; - return this; - } - - /** - * Get the actions property: A collection of the actions which are triggered if all the configured rules - * evaluations, within at least one rule set, are true. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Set the actions property: A collection of the actions which are triggered if all the configured rules - * evaluations, within at least one rule set, are true. - * - * @param actions the actions value to set. - * @return the AutomationProperties object itself. - */ - public AutomationProperties withActions(List actions) { - this.actions = actions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (scopes() != null) { - scopes().forEach(e -> e.validate()); - } - if (sources() != null) { - sources().forEach(e -> e.validate()); - } - if (actions() != null) { - actions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationValidationStatusInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationValidationStatusInner.java deleted file mode 100644 index a43555c19211..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/AutomationValidationStatusInner.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The security automation model state property bag. */ -@Fluent -public final class AutomationValidationStatusInner { - /* - * Indicates whether the model is valid or not. - */ - @JsonProperty(value = "isValid") - private Boolean isValid; - - /* - * The validation message. - */ - @JsonProperty(value = "message") - private String message; - - /** Creates an instance of AutomationValidationStatusInner class. */ - public AutomationValidationStatusInner() { - } - - /** - * Get the isValid property: Indicates whether the model is valid or not. - * - * @return the isValid value. - */ - public Boolean isValid() { - return this.isValid; - } - - /** - * Set the isValid property: Indicates whether the model is valid or not. - * - * @param isValid the isValid value to set. - * @return the AutomationValidationStatusInner object itself. - */ - public AutomationValidationStatusInner withIsValid(Boolean isValid) { - this.isValid = isValid; - return this; - } - - /** - * Get the message property: The validation message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: The validation message. - * - * @param message the message value to set. - * @return the AutomationValidationStatusInner object itself. - */ - public AutomationValidationStatusInner withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceInner.java deleted file mode 100644 index 4017d627a9d0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceInner.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.ComplianceSegment; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Compliance of a scope. */ -@Immutable -public final class ComplianceInner extends ProxyResource { - /* - * Compliance data - */ - @JsonProperty(value = "properties") - private ComplianceProperties innerProperties; - - /** Creates an instance of ComplianceInner class. */ - public ComplianceInner() { - } - - /** - * Get the innerProperties property: Compliance data. - * - * @return the innerProperties value. - */ - private ComplianceProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the assessmentTimestampUtcDate property: The timestamp when the Compliance calculation was conducted. - * - * @return the assessmentTimestampUtcDate value. - */ - public OffsetDateTime assessmentTimestampUtcDate() { - return this.innerProperties() == null ? null : this.innerProperties().assessmentTimestampUtcDate(); - } - - /** - * Get the resourceCount property: The resource count of the given subscription for which the Compliance calculation - * was conducted (needed for Management Group Compliance calculation). - * - * @return the resourceCount value. - */ - public Integer resourceCount() { - return this.innerProperties() == null ? null : this.innerProperties().resourceCount(); - } - - /** - * Get the assessmentResult property: An array of segment, which is the actually the compliance assessment. - * - * @return the assessmentResult value. - */ - public List assessmentResult() { - return this.innerProperties() == null ? null : this.innerProperties().assessmentResult(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceProperties.java deleted file mode 100644 index 8eb6d80114fc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceProperties.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.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.security.models.ComplianceSegment; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * The Compliance score (percentage) of a Subscription is a sum of all Resources' Compliances under the given - * Subscription. A Resource Compliance is defined as the compliant ('healthy') Policy Definitions out of all Policy - * Definitions applicable to a given resource. - */ -@Immutable -public final class ComplianceProperties { - /* - * The timestamp when the Compliance calculation was conducted. - */ - @JsonProperty(value = "assessmentTimestampUtcDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime assessmentTimestampUtcDate; - - /* - * The resource count of the given subscription for which the Compliance calculation was conducted (needed for - * Management Group Compliance calculation). - */ - @JsonProperty(value = "resourceCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer resourceCount; - - /* - * An array of segment, which is the actually the compliance assessment. - */ - @JsonProperty(value = "assessmentResult", access = JsonProperty.Access.WRITE_ONLY) - private List assessmentResult; - - /** Creates an instance of ComplianceProperties class. */ - public ComplianceProperties() { - } - - /** - * Get the assessmentTimestampUtcDate property: The timestamp when the Compliance calculation was conducted. - * - * @return the assessmentTimestampUtcDate value. - */ - public OffsetDateTime assessmentTimestampUtcDate() { - return this.assessmentTimestampUtcDate; - } - - /** - * Get the resourceCount property: The resource count of the given subscription for which the Compliance calculation - * was conducted (needed for Management Group Compliance calculation). - * - * @return the resourceCount value. - */ - public Integer resourceCount() { - return this.resourceCount; - } - - /** - * Get the assessmentResult property: An array of segment, which is the actually the compliance assessment. - * - * @return the assessmentResult value. - */ - public List assessmentResult() { - return this.assessmentResult; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (assessmentResult() != null) { - assessmentResult().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultInner.java deleted file mode 100644 index 4487e681da9b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultInner.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.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.ResourceStatus; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** a compliance result. */ -@Immutable -public final class ComplianceResultInner extends ProxyResource { - /* - * Compliance result data - */ - @JsonProperty(value = "properties") - private ComplianceResultProperties innerProperties; - - /** Creates an instance of ComplianceResultInner class. */ - public ComplianceResultInner() { - } - - /** - * Get the innerProperties property: Compliance result data. - * - * @return the innerProperties value. - */ - private ComplianceResultProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the resourceStatus property: The status of the resource regarding a single assessment. - * - * @return the resourceStatus value. - */ - public ResourceStatus resourceStatus() { - return this.innerProperties() == null ? null : this.innerProperties().resourceStatus(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultProperties.java deleted file mode 100644 index 743f7fe1a8b7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ComplianceResultProperties.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.security.models.ResourceStatus; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Compliance result data. */ -@Immutable -public final class ComplianceResultProperties { - /* - * The status of the resource regarding a single assessment - */ - @JsonProperty(value = "resourceStatus", access = JsonProperty.Access.WRITE_ONLY) - private ResourceStatus resourceStatus; - - /** Creates an instance of ComplianceResultProperties class. */ - public ComplianceResultProperties() { - } - - /** - * Get the resourceStatus property: The status of the resource regarding a single assessment. - * - * @return the resourceStatus value. - */ - public ResourceStatus resourceStatus() { - return this.resourceStatus; - } - - /** - * 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/ConnectionStringsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectionStringsInner.java deleted file mode 100644 index 4e21ee921fae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectionStringsInner.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.IngestionConnectionString; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Connection string for ingesting security data and logs. */ -@Fluent -public final class ConnectionStringsInner { - /* - * Connection strings - */ - @JsonProperty(value = "value", required = true) - private List value; - - /** Creates an instance of ConnectionStringsInner class. */ - public ConnectionStringsInner() { - } - - /** - * Get the value property: Connection strings. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: Connection strings. - * - * @param value the value value to set. - * @return the ConnectionStringsInner object itself. - */ - public ConnectionStringsInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ConnectionStringsInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ConnectionStringsInner.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingInner.java deleted file mode 100644 index 423238e44dab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingInner.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The connector setting. */ -@Fluent -public final class ConnectorSettingInner extends ProxyResource { - /* - * Connector setting data - */ - @JsonProperty(value = "properties") - private ConnectorSettingProperties innerProperties; - - /** Creates an instance of ConnectorSettingInner class. */ - public ConnectorSettingInner() { - } - - /** - * Get the innerProperties property: Connector setting data. - * - * @return the innerProperties value. - */ - private ConnectorSettingProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only - * for Arc autoProvision (Hybrid Compute). - * - * @return the hybridComputeSettings value. - */ - public HybridComputeSettingsProperties hybridComputeSettings() { - return this.innerProperties() == null ? null : this.innerProperties().hybridComputeSettings(); - } - - /** - * Set the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only - * for Arc autoProvision (Hybrid Compute). - * - * @param hybridComputeSettings the hybridComputeSettings value to set. - * @return the ConnectorSettingInner object itself. - */ - public ConnectorSettingInner withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectorSettingProperties(); - } - this.innerProperties().withHybridComputeSettings(hybridComputeSettings); - return this; - } - - /** - * Get the authenticationDetails property: Settings for authentication management, these settings are relevant only - * for the cloud connector. - * - * @return the authenticationDetails value. - */ - public AuthenticationDetailsProperties authenticationDetails() { - return this.innerProperties() == null ? null : this.innerProperties().authenticationDetails(); - } - - /** - * Set the authenticationDetails property: Settings for authentication management, these settings are relevant only - * for the cloud connector. - * - * @param authenticationDetails the authenticationDetails value to set. - * @return the ConnectorSettingInner object itself. - */ - public ConnectorSettingInner withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails) { - if (this.innerProperties() == null) { - this.innerProperties = new ConnectorSettingProperties(); - } - this.innerProperties().withAuthenticationDetails(authenticationDetails); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingProperties.java deleted file mode 100644 index 5a6a558eed59..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ConnectorSettingProperties.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes properties of a connector setting. */ -@Fluent -public final class ConnectorSettingProperties { - /* - * Settings for hybrid compute management. These settings are relevant only for Arc autoProvision (Hybrid Compute). - */ - @JsonProperty(value = "hybridComputeSettings") - private HybridComputeSettingsProperties hybridComputeSettings; - - /* - * Settings for authentication management, these settings are relevant only for the cloud connector. - */ - @JsonProperty(value = "authenticationDetails") - private AuthenticationDetailsProperties authenticationDetails; - - /** Creates an instance of ConnectorSettingProperties class. */ - public ConnectorSettingProperties() { - } - - /** - * Get the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only - * for Arc autoProvision (Hybrid Compute). - * - * @return the hybridComputeSettings value. - */ - public HybridComputeSettingsProperties hybridComputeSettings() { - return this.hybridComputeSettings; - } - - /** - * Set the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only - * for Arc autoProvision (Hybrid Compute). - * - * @param hybridComputeSettings the hybridComputeSettings value to set. - * @return the ConnectorSettingProperties object itself. - */ - public ConnectorSettingProperties withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings) { - this.hybridComputeSettings = hybridComputeSettings; - return this; - } - - /** - * Get the authenticationDetails property: Settings for authentication management, these settings are relevant only - * for the cloud connector. - * - * @return the authenticationDetails value. - */ - public AuthenticationDetailsProperties authenticationDetails() { - return this.authenticationDetails; - } - - /** - * Set the authenticationDetails property: Settings for authentication management, these settings are relevant only - * for the cloud connector. - * - * @param authenticationDetails the authenticationDetails value to set. - * @return the ConnectorSettingProperties object itself. - */ - public ConnectorSettingProperties withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails) { - this.authenticationDetails = authenticationDetails; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (hybridComputeSettings() != null) { - hybridComputeSettings().validate(); - } - if (authenticationDetails() != null) { - authenticationDetails().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.java deleted file mode 100644 index 77f1347c266e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationInner.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.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Custom Assessment Automation. */ -@Fluent -public final class CustomAssessmentAutomationInner extends ProxyResource { - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * describes Custom Assessment Automation properties. - */ - @JsonProperty(value = "properties") - private CustomAssessmentAutomationProperties innerProperties; - - /** Creates an instance of CustomAssessmentAutomationInner class. */ - public CustomAssessmentAutomationInner() { - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the innerProperties property: describes Custom Assessment Automation properties. - * - * @return the innerProperties value. - */ - private CustomAssessmentAutomationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the compressedQuery property: GZip encoded KQL query representing the assessment automation results required. - * - * @return the compressedQuery value. - */ - public String compressedQuery() { - return this.innerProperties() == null ? null : this.innerProperties().compressedQuery(); - } - - /** - * Set the compressedQuery property: GZip encoded KQL query representing the assessment automation results required. - * - * @param compressedQuery the compressedQuery value to set. - * @return the CustomAssessmentAutomationInner object itself. - */ - public CustomAssessmentAutomationInner withCompressedQuery(String compressedQuery) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomAssessmentAutomationProperties(); - } - this.innerProperties().withCompressedQuery(compressedQuery); - return this; - } - - /** - * Get the supportedCloud property: Relevant cloud for the custom assessment automation. - * - * @return the supportedCloud value. - */ - public SupportedCloudEnum supportedCloud() { - return this.innerProperties() == null ? null : this.innerProperties().supportedCloud(); - } - - /** - * Set the supportedCloud property: Relevant cloud for the custom assessment automation. - * - * @param supportedCloud the supportedCloud value to set. - * @return the CustomAssessmentAutomationInner object itself. - */ - public CustomAssessmentAutomationInner withSupportedCloud(SupportedCloudEnum supportedCloud) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomAssessmentAutomationProperties(); - } - this.innerProperties().withSupportedCloud(supportedCloud); - return this; - } - - /** - * Get the severity property: The severity to relate to the assessments generated by this assessment automation. - * - * @return the severity value. - */ - public SeverityEnum severity() { - return this.innerProperties() == null ? null : this.innerProperties().severity(); - } - - /** - * Set the severity property: The severity to relate to the assessments generated by this assessment automation. - * - * @param severity the severity value to set. - * @return the CustomAssessmentAutomationInner object itself. - */ - public CustomAssessmentAutomationInner withSeverity(SeverityEnum severity) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomAssessmentAutomationProperties(); - } - this.innerProperties().withSeverity(severity); - return this; - } - - /** - * Get the displayName property: The display name of the assessments generated by this assessment automation. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The display name of the assessments generated by this assessment automation. - * - * @param displayName the displayName value to set. - * @return the CustomAssessmentAutomationInner object itself. - */ - public CustomAssessmentAutomationInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomAssessmentAutomationProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the description property: The description to relate to the assessments generated by this assessment - * automation. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The description to relate to the assessments generated by this assessment - * automation. - * - * @param description the description value to set. - * @return the CustomAssessmentAutomationInner object itself. - */ - public CustomAssessmentAutomationInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomAssessmentAutomationProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the remediationDescription property: The remediation description to relate to the assessments generated by - * this assessment automation. - * - * @return the remediationDescription value. - */ - public String remediationDescription() { - return this.innerProperties() == null ? null : this.innerProperties().remediationDescription(); - } - - /** - * Set the remediationDescription property: The remediation description to relate to the assessments generated by - * this assessment automation. - * - * @param remediationDescription the remediationDescription value to set. - * @return the CustomAssessmentAutomationInner object itself. - */ - public CustomAssessmentAutomationInner withRemediationDescription(String remediationDescription) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomAssessmentAutomationProperties(); - } - this.innerProperties().withRemediationDescription(remediationDescription); - return this; - } - - /** - * Get the assessmentKey property: The assessment metadata key used when an assessment is generated for this - * assessment automation. - * - * @return the assessmentKey value. - */ - public String assessmentKey() { - return this.innerProperties() == null ? null : this.innerProperties().assessmentKey(); - } - - /** - * Set the assessmentKey property: The assessment metadata key used when an assessment is generated for this - * assessment automation. - * - * @param assessmentKey the assessmentKey value to set. - * @return the CustomAssessmentAutomationInner object itself. - */ - public CustomAssessmentAutomationInner withAssessmentKey(String assessmentKey) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomAssessmentAutomationProperties(); - } - this.innerProperties().withAssessmentKey(assessmentKey); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationProperties.java deleted file mode 100644 index 9e8384522a94..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationProperties.java +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** describes the Custom Assessment Automation properties. */ -@Fluent -public final class CustomAssessmentAutomationProperties { - /* - * GZip encoded KQL query representing the assessment automation results required. - */ - @JsonProperty(value = "compressedQuery") - private String compressedQuery; - - /* - * Relevant cloud for the custom assessment automation. - */ - @JsonProperty(value = "supportedCloud") - private SupportedCloudEnum supportedCloud = SupportedCloudEnum.AWS; - - /* - * The severity to relate to the assessments generated by this assessment automation. - */ - @JsonProperty(value = "severity") - private SeverityEnum severity = SeverityEnum.LOW; - - /* - * The display name of the assessments generated by this assessment automation. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The description to relate to the assessments generated by this assessment automation. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The remediation description to relate to the assessments generated by this assessment automation. - */ - @JsonProperty(value = "remediationDescription") - private String remediationDescription; - - /* - * The assessment metadata key used when an assessment is generated for this assessment automation. - */ - @JsonProperty(value = "assessmentKey") - private String assessmentKey; - - /** Creates an instance of CustomAssessmentAutomationProperties class. */ - public CustomAssessmentAutomationProperties() { - } - - /** - * Get the compressedQuery property: GZip encoded KQL query representing the assessment automation results required. - * - * @return the compressedQuery value. - */ - public String compressedQuery() { - return this.compressedQuery; - } - - /** - * Set the compressedQuery property: GZip encoded KQL query representing the assessment automation results required. - * - * @param compressedQuery the compressedQuery value to set. - * @return the CustomAssessmentAutomationProperties object itself. - */ - public CustomAssessmentAutomationProperties withCompressedQuery(String compressedQuery) { - this.compressedQuery = compressedQuery; - return this; - } - - /** - * Get the supportedCloud property: Relevant cloud for the custom assessment automation. - * - * @return the supportedCloud value. - */ - public SupportedCloudEnum supportedCloud() { - return this.supportedCloud; - } - - /** - * Set the supportedCloud property: Relevant cloud for the custom assessment automation. - * - * @param supportedCloud the supportedCloud value to set. - * @return the CustomAssessmentAutomationProperties object itself. - */ - public CustomAssessmentAutomationProperties withSupportedCloud(SupportedCloudEnum supportedCloud) { - this.supportedCloud = supportedCloud; - return this; - } - - /** - * Get the severity property: The severity to relate to the assessments generated by this assessment automation. - * - * @return the severity value. - */ - public SeverityEnum severity() { - return this.severity; - } - - /** - * Set the severity property: The severity to relate to the assessments generated by this assessment automation. - * - * @param severity the severity value to set. - * @return the CustomAssessmentAutomationProperties object itself. - */ - public CustomAssessmentAutomationProperties withSeverity(SeverityEnum severity) { - this.severity = severity; - return this; - } - - /** - * Get the displayName property: The display name of the assessments generated by this assessment automation. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the assessments generated by this assessment automation. - * - * @param displayName the displayName value to set. - * @return the CustomAssessmentAutomationProperties object itself. - */ - public CustomAssessmentAutomationProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: The description to relate to the assessments generated by this assessment - * automation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description to relate to the assessments generated by this assessment - * automation. - * - * @param description the description value to set. - * @return the CustomAssessmentAutomationProperties object itself. - */ - public CustomAssessmentAutomationProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the remediationDescription property: The remediation description to relate to the assessments generated by - * this assessment automation. - * - * @return the remediationDescription value. - */ - public String remediationDescription() { - return this.remediationDescription; - } - - /** - * Set the remediationDescription property: The remediation description to relate to the assessments generated by - * this assessment automation. - * - * @param remediationDescription the remediationDescription value to set. - * @return the CustomAssessmentAutomationProperties object itself. - */ - public CustomAssessmentAutomationProperties withRemediationDescription(String remediationDescription) { - this.remediationDescription = remediationDescription; - return this; - } - - /** - * Get the assessmentKey property: The assessment metadata key used when an assessment is generated for this - * assessment automation. - * - * @return the assessmentKey value. - */ - public String assessmentKey() { - return this.assessmentKey; - } - - /** - * Set the assessmentKey property: The assessment metadata key used when an assessment is generated for this - * assessment automation. - * - * @param assessmentKey the assessmentKey value to set. - * @return the CustomAssessmentAutomationProperties object itself. - */ - public CustomAssessmentAutomationProperties withAssessmentKey(String assessmentKey) { - this.assessmentKey = assessmentKey; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationRequestProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationRequestProperties.java deleted file mode 100644 index 524a5c5db165..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomAssessmentAutomationRequestProperties.java +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** describes the Custom Assessment Automation properties. */ -@Fluent -public final class CustomAssessmentAutomationRequestProperties { - /* - * Base 64 encoded KQL query representing the assessment automation results required. - */ - @JsonProperty(value = "compressedQuery") - private String compressedQuery; - - /* - * Relevant cloud for the custom assessment automation. - */ - @JsonProperty(value = "supportedCloud") - private SupportedCloudEnum supportedCloud = SupportedCloudEnum.AWS; - - /* - * The severity to relate to the assessments generated by this assessment automation. - */ - @JsonProperty(value = "severity") - private SeverityEnum severity = SeverityEnum.LOW; - - /* - * The display name of the assessments generated by this assessment automation. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The description to relate to the assessments generated by this assessment automation. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The remediation description to relate to the assessments generated by this assessment automation. - */ - @JsonProperty(value = "remediationDescription") - private String remediationDescription; - - /** Creates an instance of CustomAssessmentAutomationRequestProperties class. */ - public CustomAssessmentAutomationRequestProperties() { - } - - /** - * Get the compressedQuery property: Base 64 encoded KQL query representing the assessment automation results - * required. - * - * @return the compressedQuery value. - */ - public String compressedQuery() { - return this.compressedQuery; - } - - /** - * Set the compressedQuery property: Base 64 encoded KQL query representing the assessment automation results - * required. - * - * @param compressedQuery the compressedQuery value to set. - * @return the CustomAssessmentAutomationRequestProperties object itself. - */ - public CustomAssessmentAutomationRequestProperties withCompressedQuery(String compressedQuery) { - this.compressedQuery = compressedQuery; - return this; - } - - /** - * Get the supportedCloud property: Relevant cloud for the custom assessment automation. - * - * @return the supportedCloud value. - */ - public SupportedCloudEnum supportedCloud() { - return this.supportedCloud; - } - - /** - * Set the supportedCloud property: Relevant cloud for the custom assessment automation. - * - * @param supportedCloud the supportedCloud value to set. - * @return the CustomAssessmentAutomationRequestProperties object itself. - */ - public CustomAssessmentAutomationRequestProperties withSupportedCloud(SupportedCloudEnum supportedCloud) { - this.supportedCloud = supportedCloud; - return this; - } - - /** - * Get the severity property: The severity to relate to the assessments generated by this assessment automation. - * - * @return the severity value. - */ - public SeverityEnum severity() { - return this.severity; - } - - /** - * Set the severity property: The severity to relate to the assessments generated by this assessment automation. - * - * @param severity the severity value to set. - * @return the CustomAssessmentAutomationRequestProperties object itself. - */ - public CustomAssessmentAutomationRequestProperties withSeverity(SeverityEnum severity) { - this.severity = severity; - return this; - } - - /** - * Get the displayName property: The display name of the assessments generated by this assessment automation. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The display name of the assessments generated by this assessment automation. - * - * @param displayName the displayName value to set. - * @return the CustomAssessmentAutomationRequestProperties object itself. - */ - public CustomAssessmentAutomationRequestProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: The description to relate to the assessments generated by this assessment - * automation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description to relate to the assessments generated by this assessment - * automation. - * - * @param description the description value to set. - * @return the CustomAssessmentAutomationRequestProperties object itself. - */ - public CustomAssessmentAutomationRequestProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the remediationDescription property: The remediation description to relate to the assessments generated by - * this assessment automation. - * - * @return the remediationDescription value. - */ - public String remediationDescription() { - return this.remediationDescription; - } - - /** - * Set the remediationDescription property: The remediation description to relate to the assessments generated by - * this assessment automation. - * - * @param remediationDescription the remediationDescription value to set. - * @return the CustomAssessmentAutomationRequestProperties object itself. - */ - public CustomAssessmentAutomationRequestProperties withRemediationDescription(String remediationDescription) { - this.remediationDescription = remediationDescription; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentInner.java deleted file mode 100644 index 0ac905684d25..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentInner.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Custom entity store assignment. */ -@Fluent -public final class CustomEntityStoreAssignmentInner extends ProxyResource { - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * describes custom entity store assignment properties. - */ - @JsonProperty(value = "properties") - private CustomEntityStoreAssignmentProperties innerProperties; - - /** Creates an instance of CustomEntityStoreAssignmentInner class. */ - public CustomEntityStoreAssignmentInner() { - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the innerProperties property: describes custom entity store assignment properties. - * - * @return the innerProperties value. - */ - private CustomEntityStoreAssignmentProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the principal property: The principal assigned with entity store. Format of principal is: [AAD - * type]=[PrincipalObjectId];[TenantId]. - * - * @return the principal value. - */ - public String principal() { - return this.innerProperties() == null ? null : this.innerProperties().principal(); - } - - /** - * Set the principal property: The principal assigned with entity store. Format of principal is: [AAD - * type]=[PrincipalObjectId];[TenantId]. - * - * @param principal the principal value to set. - * @return the CustomEntityStoreAssignmentInner object itself. - */ - public CustomEntityStoreAssignmentInner withPrincipal(String principal) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomEntityStoreAssignmentProperties(); - } - this.innerProperties().withPrincipal(principal); - return this; - } - - /** - * Get the entityStoreDatabaseLink property: The link to entity store database. - * - * @return the entityStoreDatabaseLink value. - */ - public String entityStoreDatabaseLink() { - return this.innerProperties() == null ? null : this.innerProperties().entityStoreDatabaseLink(); - } - - /** - * Set the entityStoreDatabaseLink property: The link to entity store database. - * - * @param entityStoreDatabaseLink the entityStoreDatabaseLink value to set. - * @return the CustomEntityStoreAssignmentInner object itself. - */ - public CustomEntityStoreAssignmentInner withEntityStoreDatabaseLink(String entityStoreDatabaseLink) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomEntityStoreAssignmentProperties(); - } - this.innerProperties().withEntityStoreDatabaseLink(entityStoreDatabaseLink); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentProperties.java deleted file mode 100644 index cf2b86ebd137..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentProperties.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** describes the custom entity store assignment properties. */ -@Fluent -public final class CustomEntityStoreAssignmentProperties { - /* - * The principal assigned with entity store. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId] - */ - @JsonProperty(value = "principal") - private String principal; - - /* - * The link to entity store database. - */ - @JsonProperty(value = "entityStoreDatabaseLink") - private String entityStoreDatabaseLink; - - /** Creates an instance of CustomEntityStoreAssignmentProperties class. */ - public CustomEntityStoreAssignmentProperties() { - } - - /** - * Get the principal property: The principal assigned with entity store. Format of principal is: [AAD - * type]=[PrincipalObjectId];[TenantId]. - * - * @return the principal value. - */ - public String principal() { - return this.principal; - } - - /** - * Set the principal property: The principal assigned with entity store. Format of principal is: [AAD - * type]=[PrincipalObjectId];[TenantId]. - * - * @param principal the principal value to set. - * @return the CustomEntityStoreAssignmentProperties object itself. - */ - public CustomEntityStoreAssignmentProperties withPrincipal(String principal) { - this.principal = principal; - return this; - } - - /** - * Get the entityStoreDatabaseLink property: The link to entity store database. - * - * @return the entityStoreDatabaseLink value. - */ - public String entityStoreDatabaseLink() { - return this.entityStoreDatabaseLink; - } - - /** - * Set the entityStoreDatabaseLink property: The link to entity store database. - * - * @param entityStoreDatabaseLink the entityStoreDatabaseLink value to set. - * @return the CustomEntityStoreAssignmentProperties object itself. - */ - public CustomEntityStoreAssignmentProperties withEntityStoreDatabaseLink(String entityStoreDatabaseLink) { - this.entityStoreDatabaseLink = entityStoreDatabaseLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentRequestProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentRequestProperties.java deleted file mode 100644 index fc9ebcd59cab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/CustomEntityStoreAssignmentRequestProperties.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** describes properties of custom entity store assignment request. */ -@Fluent -public final class CustomEntityStoreAssignmentRequestProperties { - /* - * The principal assigned with entity store. If not provided, will use caller principal. Format of principal is: - * [AAD type]=[PrincipalObjectId];[TenantId] - */ - @JsonProperty(value = "principal") - private String principal; - - /** Creates an instance of CustomEntityStoreAssignmentRequestProperties class. */ - public CustomEntityStoreAssignmentRequestProperties() { - } - - /** - * Get the principal property: The principal assigned with entity store. If not provided, will use caller principal. - * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. - * - * @return the principal value. - */ - public String principal() { - return this.principal; - } - - /** - * Set the principal property: The principal assigned with entity store. If not provided, will use caller principal. - * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. - * - * @param principal the principal value to set. - * @return the CustomEntityStoreAssignmentRequestProperties object itself. - */ - public CustomEntityStoreAssignmentRequestProperties withPrincipal(String principal) { - this.principal = principal; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DataExportSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DataExportSettingProperties.java deleted file mode 100644 index 5f8daf7eabc5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DataExportSettingProperties.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The data export setting properties. */ -@Fluent -public final class DataExportSettingProperties { - /* - * Is the data export setting enabled - */ - @JsonProperty(value = "enabled", required = true) - private boolean enabled; - - /** Creates an instance of DataExportSettingProperties class. */ - public DataExportSettingProperties() { - } - - /** - * Get the enabled property: Is the data export setting enabled. - * - * @return the enabled value. - */ - public boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is the data export setting enabled. - * - * @param enabled the enabled value to set. - * @return the DataExportSettingProperties object itself. - */ - public DataExportSettingProperties withEnabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupInner.java deleted file mode 100644 index 29aa17350b73..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupInner.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.AllowlistCustomAlertRule; -import com.azure.resourcemanager.security.models.DenylistCustomAlertRule; -import com.azure.resourcemanager.security.models.ThresholdCustomAlertRule; -import com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The device security group resource. */ -@Fluent -public final class DeviceSecurityGroupInner extends ProxyResource { - /* - * Device Security group data - */ - @JsonProperty(value = "properties") - private DeviceSecurityGroupProperties innerProperties; - - /** Creates an instance of DeviceSecurityGroupInner class. */ - public DeviceSecurityGroupInner() { - } - - /** - * Get the innerProperties property: Device Security group data. - * - * @return the innerProperties value. - */ - private DeviceSecurityGroupProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the thresholdRules property: The list of custom alert threshold rules. - * - * @return the thresholdRules value. - */ - public List thresholdRules() { - return this.innerProperties() == null ? null : this.innerProperties().thresholdRules(); - } - - /** - * Set the thresholdRules property: The list of custom alert threshold rules. - * - * @param thresholdRules the thresholdRules value to set. - * @return the DeviceSecurityGroupInner object itself. - */ - public DeviceSecurityGroupInner withThresholdRules(List thresholdRules) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceSecurityGroupProperties(); - } - this.innerProperties().withThresholdRules(thresholdRules); - return this; - } - - /** - * Get the timeWindowRules property: The list of custom alert time-window rules. - * - * @return the timeWindowRules value. - */ - public List timeWindowRules() { - return this.innerProperties() == null ? null : this.innerProperties().timeWindowRules(); - } - - /** - * Set the timeWindowRules property: The list of custom alert time-window rules. - * - * @param timeWindowRules the timeWindowRules value to set. - * @return the DeviceSecurityGroupInner object itself. - */ - public DeviceSecurityGroupInner withTimeWindowRules(List timeWindowRules) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceSecurityGroupProperties(); - } - this.innerProperties().withTimeWindowRules(timeWindowRules); - return this; - } - - /** - * Get the allowlistRules property: The allow-list custom alert rules. - * - * @return the allowlistRules value. - */ - public List allowlistRules() { - return this.innerProperties() == null ? null : this.innerProperties().allowlistRules(); - } - - /** - * Set the allowlistRules property: The allow-list custom alert rules. - * - * @param allowlistRules the allowlistRules value to set. - * @return the DeviceSecurityGroupInner object itself. - */ - public DeviceSecurityGroupInner withAllowlistRules(List allowlistRules) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceSecurityGroupProperties(); - } - this.innerProperties().withAllowlistRules(allowlistRules); - return this; - } - - /** - * Get the denylistRules property: The deny-list custom alert rules. - * - * @return the denylistRules value. - */ - public List denylistRules() { - return this.innerProperties() == null ? null : this.innerProperties().denylistRules(); - } - - /** - * Set the denylistRules property: The deny-list custom alert rules. - * - * @param denylistRules the denylistRules value to set. - * @return the DeviceSecurityGroupInner object itself. - */ - public DeviceSecurityGroupInner withDenylistRules(List denylistRules) { - if (this.innerProperties() == null) { - this.innerProperties = new DeviceSecurityGroupProperties(); - } - this.innerProperties().withDenylistRules(denylistRules); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupProperties.java deleted file mode 100644 index 0ee8520c518c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DeviceSecurityGroupProperties.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.AllowlistCustomAlertRule; -import com.azure.resourcemanager.security.models.DenylistCustomAlertRule; -import com.azure.resourcemanager.security.models.ThresholdCustomAlertRule; -import com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** describes properties of a security group. */ -@Fluent -public final class DeviceSecurityGroupProperties { - /* - * The list of custom alert threshold rules. - */ - @JsonProperty(value = "thresholdRules") - private List thresholdRules; - - /* - * The list of custom alert time-window rules. - */ - @JsonProperty(value = "timeWindowRules") - private List timeWindowRules; - - /* - * The allow-list custom alert rules. - */ - @JsonProperty(value = "allowlistRules") - private List allowlistRules; - - /* - * The deny-list custom alert rules. - */ - @JsonProperty(value = "denylistRules") - private List denylistRules; - - /** Creates an instance of DeviceSecurityGroupProperties class. */ - public DeviceSecurityGroupProperties() { - } - - /** - * Get the thresholdRules property: The list of custom alert threshold rules. - * - * @return the thresholdRules value. - */ - public List thresholdRules() { - return this.thresholdRules; - } - - /** - * Set the thresholdRules property: The list of custom alert threshold rules. - * - * @param thresholdRules the thresholdRules value to set. - * @return the DeviceSecurityGroupProperties object itself. - */ - public DeviceSecurityGroupProperties withThresholdRules(List thresholdRules) { - this.thresholdRules = thresholdRules; - return this; - } - - /** - * Get the timeWindowRules property: The list of custom alert time-window rules. - * - * @return the timeWindowRules value. - */ - public List timeWindowRules() { - return this.timeWindowRules; - } - - /** - * Set the timeWindowRules property: The list of custom alert time-window rules. - * - * @param timeWindowRules the timeWindowRules value to set. - * @return the DeviceSecurityGroupProperties object itself. - */ - public DeviceSecurityGroupProperties withTimeWindowRules(List timeWindowRules) { - this.timeWindowRules = timeWindowRules; - return this; - } - - /** - * Get the allowlistRules property: The allow-list custom alert rules. - * - * @return the allowlistRules value. - */ - public List allowlistRules() { - return this.allowlistRules; - } - - /** - * Set the allowlistRules property: The allow-list custom alert rules. - * - * @param allowlistRules the allowlistRules value to set. - * @return the DeviceSecurityGroupProperties object itself. - */ - public DeviceSecurityGroupProperties withAllowlistRules(List allowlistRules) { - this.allowlistRules = allowlistRules; - return this; - } - - /** - * Get the denylistRules property: The deny-list custom alert rules. - * - * @return the denylistRules value. - */ - public List denylistRules() { - return this.denylistRules; - } - - /** - * Set the denylistRules property: The deny-list custom alert rules. - * - * @param denylistRules the denylistRules value to set. - * @return the DeviceSecurityGroupProperties object itself. - */ - public DeviceSecurityGroupProperties withDenylistRules(List denylistRules) { - this.denylistRules = denylistRules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (thresholdRules() != null) { - thresholdRules().forEach(e -> e.validate()); - } - if (timeWindowRules() != null) { - timeWindowRules().forEach(e -> e.validate()); - } - if (allowlistRules() != null) { - allowlistRules().forEach(e -> e.validate()); - } - if (denylistRules() != null) { - denylistRules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionInner.java deleted file mode 100644 index b98b3bfd5ad5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionInner.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DiscoveredSecuritySolution model. */ -@Fluent -public final class DiscoveredSecuritySolutionInner extends ProxyResource { - /* - * The properties property. - */ - @JsonProperty(value = "properties", required = true) - private DiscoveredSecuritySolutionProperties innerProperties = new DiscoveredSecuritySolutionProperties(); - - /* - * Location where the resource is stored - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /** Creates an instance of DiscoveredSecuritySolutionInner class. */ - public DiscoveredSecuritySolutionInner() { - } - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private DiscoveredSecuritySolutionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the securityFamily property: The security family of the discovered solution. - * - * @return the securityFamily value. - */ - public SecurityFamily securityFamily() { - return this.innerProperties() == null ? null : this.innerProperties().securityFamily(); - } - - /** - * Set the securityFamily property: The security family of the discovered solution. - * - * @param securityFamily the securityFamily value to set. - * @return the DiscoveredSecuritySolutionInner object itself. - */ - public DiscoveredSecuritySolutionInner withSecurityFamily(SecurityFamily securityFamily) { - if (this.innerProperties() == null) { - this.innerProperties = new DiscoveredSecuritySolutionProperties(); - } - this.innerProperties().withSecurityFamily(securityFamily); - return this; - } - - /** - * Get the offer property: The security solutions' image offer. - * - * @return the offer value. - */ - public String offer() { - return this.innerProperties() == null ? null : this.innerProperties().offer(); - } - - /** - * Set the offer property: The security solutions' image offer. - * - * @param offer the offer value to set. - * @return the DiscoveredSecuritySolutionInner object itself. - */ - public DiscoveredSecuritySolutionInner withOffer(String offer) { - if (this.innerProperties() == null) { - this.innerProperties = new DiscoveredSecuritySolutionProperties(); - } - this.innerProperties().withOffer(offer); - return this; - } - - /** - * Get the publisher property: The security solutions' image publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Set the publisher property: The security solutions' image publisher. - * - * @param publisher the publisher value to set. - * @return the DiscoveredSecuritySolutionInner object itself. - */ - public DiscoveredSecuritySolutionInner withPublisher(String publisher) { - if (this.innerProperties() == null) { - this.innerProperties = new DiscoveredSecuritySolutionProperties(); - } - this.innerProperties().withPublisher(publisher); - return this; - } - - /** - * Get the sku property: The security solutions' image sku. - * - * @return the sku value. - */ - public String sku() { - return this.innerProperties() == null ? null : this.innerProperties().sku(); - } - - /** - * Set the sku property: The security solutions' image sku. - * - * @param sku the sku value to set. - * @return the DiscoveredSecuritySolutionInner object itself. - */ - public DiscoveredSecuritySolutionInner withSku(String sku) { - if (this.innerProperties() == null) { - this.innerProperties = new DiscoveredSecuritySolutionProperties(); - } - this.innerProperties().withSku(sku); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model DiscoveredSecuritySolutionInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredSecuritySolutionInner.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionProperties.java deleted file mode 100644 index ff76f3379b9d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/DiscoveredSecuritySolutionProperties.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The DiscoveredSecuritySolutionProperties model. */ -@Fluent -public final class DiscoveredSecuritySolutionProperties { - /* - * The security family of the discovered solution - */ - @JsonProperty(value = "securityFamily", required = true) - private SecurityFamily securityFamily; - - /* - * The security solutions' image offer - */ - @JsonProperty(value = "offer", required = true) - private String offer; - - /* - * The security solutions' image publisher - */ - @JsonProperty(value = "publisher", required = true) - private String publisher; - - /* - * The security solutions' image sku - */ - @JsonProperty(value = "sku", required = true) - private String sku; - - /** Creates an instance of DiscoveredSecuritySolutionProperties class. */ - public DiscoveredSecuritySolutionProperties() { - } - - /** - * Get the securityFamily property: The security family of the discovered solution. - * - * @return the securityFamily value. - */ - public SecurityFamily securityFamily() { - return this.securityFamily; - } - - /** - * Set the securityFamily property: The security family of the discovered solution. - * - * @param securityFamily the securityFamily value to set. - * @return the DiscoveredSecuritySolutionProperties object itself. - */ - public DiscoveredSecuritySolutionProperties withSecurityFamily(SecurityFamily securityFamily) { - this.securityFamily = securityFamily; - return this; - } - - /** - * Get the offer property: The security solutions' image offer. - * - * @return the offer value. - */ - public String offer() { - return this.offer; - } - - /** - * Set the offer property: The security solutions' image offer. - * - * @param offer the offer value to set. - * @return the DiscoveredSecuritySolutionProperties object itself. - */ - public DiscoveredSecuritySolutionProperties withOffer(String offer) { - this.offer = offer; - return this; - } - - /** - * Get the publisher property: The security solutions' image publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The security solutions' image publisher. - * - * @param publisher the publisher value to set. - * @return the DiscoveredSecuritySolutionProperties object itself. - */ - public DiscoveredSecuritySolutionProperties withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the sku property: The security solutions' image sku. - * - * @return the sku value. - */ - public String sku() { - return this.sku; - } - - /** - * Set the sku property: The security solutions' image sku. - * - * @param sku the sku value to set. - * @return the DiscoveredSecuritySolutionProperties object itself. - */ - public DiscoveredSecuritySolutionProperties withSku(String sku) { - this.sku = sku; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (securityFamily() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property securityFamily in model DiscoveredSecuritySolutionProperties")); - } - if (offer() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property offer in model DiscoveredSecuritySolutionProperties")); - } - if (publisher() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publisher in model DiscoveredSecuritySolutionProperties")); - } - if (sku() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sku in model DiscoveredSecuritySolutionProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredSecuritySolutionProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ExternalSecuritySolutionInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ExternalSecuritySolutionInner.java deleted file mode 100644 index 7c61d67956c5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ExternalSecuritySolutionInner.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.AadExternalSecuritySolution; -import com.azure.resourcemanager.security.models.AtaExternalSecuritySolution; -import com.azure.resourcemanager.security.models.CefExternalSecuritySolution; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * Represents a security solution external to Microsoft Defender for Cloud which sends information to an OMS workspace - * and whose data is displayed by Microsoft Defender for Cloud. - */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = ExternalSecuritySolutionInner.class) -@JsonTypeName("ExternalSecuritySolution") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "CEF", value = CefExternalSecuritySolution.class), - @JsonSubTypes.Type(name = "ATA", value = AtaExternalSecuritySolution.class), - @JsonSubTypes.Type(name = "AAD", value = AadExternalSecuritySolution.class) -}) -@Immutable -public class ExternalSecuritySolutionInner extends ProxyResource { - /* - * Location where the resource is stored - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /** Creates an instance of ExternalSecuritySolutionInner class. */ - public ExternalSecuritySolutionInner() { - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentInner.java deleted file mode 100644 index f880104179cc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentInner.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Governance assignment over a given scope. */ -@Fluent -public final class GovernanceAssignmentInner extends ProxyResource { - /* - * The properties of a governance assignment - */ - @JsonProperty(value = "properties") - private GovernanceAssignmentProperties innerProperties; - - /** Creates an instance of GovernanceAssignmentInner class. */ - public GovernanceAssignmentInner() { - } - - /** - * Get the innerProperties property: The properties of a governance assignment. - * - * @return the innerProperties value. - */ - private GovernanceAssignmentProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the owner property: The Owner for the governance assignment - e.g. user@contoso.com - see example. - * - * @return the owner value. - */ - public String owner() { - return this.innerProperties() == null ? null : this.innerProperties().owner(); - } - - /** - * Set the owner property: The Owner for the governance assignment - e.g. user@contoso.com - see example. - * - * @param owner the owner value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withOwner(String owner) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withOwner(owner); - return this; - } - - /** - * Get the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * - * @return the remediationDueDate value. - */ - public OffsetDateTime remediationDueDate() { - return this.innerProperties() == null ? null : this.innerProperties().remediationDueDate(); - } - - /** - * Set the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * - * @param remediationDueDate the remediationDueDate value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withRemediationDueDate(OffsetDateTime remediationDueDate) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withRemediationDueDate(remediationDueDate); - return this; - } - - /** - * Get the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * - * @return the remediationEta value. - */ - public RemediationEta remediationEta() { - return this.innerProperties() == null ? null : this.innerProperties().remediationEta(); - } - - /** - * Set the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * - * @param remediationEta the remediationEta value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withRemediationEta(RemediationEta remediationEta) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withRemediationEta(remediationEta); - return this; - } - - /** - * Get the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * - * @return the isGracePeriod value. - */ - public Boolean isGracePeriod() { - return this.innerProperties() == null ? null : this.innerProperties().isGracePeriod(); - } - - /** - * Set the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * - * @param isGracePeriod the isGracePeriod value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withIsGracePeriod(Boolean isGracePeriod) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withIsGracePeriod(isGracePeriod); - return this; - } - - /** - * Get the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @return the governanceEmailNotification value. - */ - public GovernanceEmailNotification governanceEmailNotification() { - return this.innerProperties() == null ? null : this.innerProperties().governanceEmailNotification(); - } - - /** - * Set the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification the governanceEmailNotification value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withGovernanceEmailNotification( - GovernanceEmailNotification governanceEmailNotification) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withGovernanceEmailNotification(governanceEmailNotification); - return this; - } - - /** - * Get the additionalData property: The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * - * @return the additionalData value. - */ - public GovernanceAssignmentAdditionalData additionalData() { - return this.innerProperties() == null ? null : this.innerProperties().additionalData(); - } - - /** - * Set the additionalData property: The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * - * @param additionalData the additionalData value to set. - * @return the GovernanceAssignmentInner object itself. - */ - public GovernanceAssignmentInner withAdditionalData(GovernanceAssignmentAdditionalData additionalData) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceAssignmentProperties(); - } - this.innerProperties().withAdditionalData(additionalData); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentProperties.java deleted file mode 100644 index 4fe799c62798..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceAssignmentProperties.java +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Describes properties of an governance assignment. */ -@Fluent -public final class GovernanceAssignmentProperties { - /* - * The Owner for the governance assignment - e.g. user@contoso.com - see example - */ - @JsonProperty(value = "owner") - private String owner; - - /* - * The remediation due-date - after this date Secure Score will be affected (in case of active grace-period) - */ - @JsonProperty(value = "remediationDueDate", required = true) - private OffsetDateTime remediationDueDate; - - /* - * The ETA (estimated time of arrival) for remediation (optional), see example - */ - @JsonProperty(value = "remediationEta") - private RemediationEta remediationEta; - - /* - * Defines whether there is a grace period on the governance assignment - */ - @JsonProperty(value = "isGracePeriod") - private Boolean isGracePeriod; - - /* - * The email notifications settings for the governance rule, states whether to disable notifications for mangers - * and owners - */ - @JsonProperty(value = "governanceEmailNotification") - private GovernanceEmailNotification governanceEmailNotification; - - /* - * The additional data for the governance assignment - e.g. links to ticket (optional), see example - */ - @JsonProperty(value = "additionalData") - private GovernanceAssignmentAdditionalData additionalData; - - /** Creates an instance of GovernanceAssignmentProperties class. */ - public GovernanceAssignmentProperties() { - } - - /** - * Get the owner property: The Owner for the governance assignment - e.g. user@contoso.com - see example. - * - * @return the owner value. - */ - public String owner() { - return this.owner; - } - - /** - * Set the owner property: The Owner for the governance assignment - e.g. user@contoso.com - see example. - * - * @param owner the owner value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withOwner(String owner) { - this.owner = owner; - return this; - } - - /** - * Get the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * - * @return the remediationDueDate value. - */ - public OffsetDateTime remediationDueDate() { - return this.remediationDueDate; - } - - /** - * Set the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * - * @param remediationDueDate the remediationDueDate value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withRemediationDueDate(OffsetDateTime remediationDueDate) { - this.remediationDueDate = remediationDueDate; - return this; - } - - /** - * Get the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * - * @return the remediationEta value. - */ - public RemediationEta remediationEta() { - return this.remediationEta; - } - - /** - * Set the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * - * @param remediationEta the remediationEta value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withRemediationEta(RemediationEta remediationEta) { - this.remediationEta = remediationEta; - return this; - } - - /** - * Get the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * - * @return the isGracePeriod value. - */ - public Boolean isGracePeriod() { - return this.isGracePeriod; - } - - /** - * Set the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * - * @param isGracePeriod the isGracePeriod value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withIsGracePeriod(Boolean isGracePeriod) { - this.isGracePeriod = isGracePeriod; - return this; - } - - /** - * Get the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @return the governanceEmailNotification value. - */ - public GovernanceEmailNotification governanceEmailNotification() { - return this.governanceEmailNotification; - } - - /** - * Set the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification the governanceEmailNotification value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withGovernanceEmailNotification( - GovernanceEmailNotification governanceEmailNotification) { - this.governanceEmailNotification = governanceEmailNotification; - return this; - } - - /** - * Get the additionalData property: The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * - * @return the additionalData value. - */ - public GovernanceAssignmentAdditionalData additionalData() { - return this.additionalData; - } - - /** - * Set the additionalData property: The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * - * @param additionalData the additionalData value to set. - * @return the GovernanceAssignmentProperties object itself. - */ - public GovernanceAssignmentProperties withAdditionalData(GovernanceAssignmentAdditionalData additionalData) { - this.additionalData = additionalData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (remediationDueDate() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property remediationDueDate in model GovernanceAssignmentProperties")); - } - if (remediationEta() != null) { - remediationEta().validate(); - } - if (governanceEmailNotification() != null) { - governanceEmailNotification().validate(); - } - if (additionalData() != null) { - additionalData().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(GovernanceAssignmentProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleInner.java deleted file mode 100644 index 62781d9a3ac8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleInner.java +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Governance rule over a given scope. */ -@Fluent -public final class GovernanceRuleInner extends ProxyResource { - /* - * Properties of a governance rule - */ - @JsonProperty(value = "properties") - private GovernanceRuleProperties innerProperties; - - /** Creates an instance of GovernanceRuleInner class. */ - public GovernanceRuleInner() { - } - - /** - * Get the innerProperties property: Properties of a governance rule. - * - * @return the innerProperties value. - */ - private GovernanceRuleProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tenantId property: The tenantId (GUID). - * - * @return the tenantId value. - */ - public String tenantId() { - return this.innerProperties() == null ? null : this.innerProperties().tenantId(); - } - - /** - * Get the displayName property: Display name of the governance rule. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Display name of the governance rule. - * - * @param displayName the displayName value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the description property: Description of the governance rule. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Description of the governance rule. - * - * @param description the description value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the remediationTimeframe property: Governance rule remediation timeframe - this is the time that will affect - * on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @return the remediationTimeframe value. - */ - public String remediationTimeframe() { - return this.innerProperties() == null ? null : this.innerProperties().remediationTimeframe(); - } - - /** - * Set the remediationTimeframe property: Governance rule remediation timeframe - this is the time that will affect - * on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @param remediationTimeframe the remediationTimeframe value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withRemediationTimeframe(String remediationTimeframe) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withRemediationTimeframe(remediationTimeframe); - return this; - } - - /** - * Get the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @return the isGracePeriod value. - */ - public Boolean isGracePeriod() { - return this.innerProperties() == null ? null : this.innerProperties().isGracePeriod(); - } - - /** - * Set the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @param isGracePeriod the isGracePeriod value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withIsGracePeriod(Boolean isGracePeriod) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withIsGracePeriod(isGracePeriod); - return this; - } - - /** - * Get the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * - * @return the rulePriority value. - */ - public Integer rulePriority() { - return this.innerProperties() == null ? null : this.innerProperties().rulePriority(); - } - - /** - * Set the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * - * @param rulePriority the rulePriority value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withRulePriority(Integer rulePriority) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withRulePriority(rulePriority); - return this; - } - - /** - * Get the isDisabled property: Defines whether the rule is active/inactive. - * - * @return the isDisabled value. - */ - public Boolean isDisabled() { - return this.innerProperties() == null ? null : this.innerProperties().isDisabled(); - } - - /** - * Set the isDisabled property: Defines whether the rule is active/inactive. - * - * @param isDisabled the isDisabled value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withIsDisabled(Boolean isDisabled) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withIsDisabled(isDisabled); - return this; - } - - /** - * Get the ruleType property: The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * - * @return the ruleType value. - */ - public GovernanceRuleType ruleType() { - return this.innerProperties() == null ? null : this.innerProperties().ruleType(); - } - - /** - * Set the ruleType property: The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * - * @param ruleType the ruleType value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withRuleType(GovernanceRuleType ruleType) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withRuleType(ruleType); - return this; - } - - /** - * Get the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - public GovernanceRuleSourceResourceType sourceResourceType() { - return this.innerProperties() == null ? null : this.innerProperties().sourceResourceType(); - } - - /** - * Set the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * - * @param sourceResourceType the sourceResourceType value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withSourceResourceType(sourceResourceType); - return this; - } - - /** - * Get the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @return the excludedScopes value. - */ - public List excludedScopes() { - return this.innerProperties() == null ? null : this.innerProperties().excludedScopes(); - } - - /** - * Set the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @param excludedScopes the excludedScopes value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withExcludedScopes(List excludedScopes) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withExcludedScopes(excludedScopes); - return this; - } - - /** - * Get the conditionSets property: The governance rule conditionSets - see examples. - * - * @return the conditionSets value. - */ - public List conditionSets() { - return this.innerProperties() == null ? null : this.innerProperties().conditionSets(); - } - - /** - * Set the conditionSets property: The governance rule conditionSets - see examples. - * - * @param conditionSets the conditionSets value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withConditionSets(List conditionSets) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withConditionSets(conditionSets); - return this; - } - - /** - * Get the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * - * @return the includeMemberScopes value. - */ - public Boolean includeMemberScopes() { - return this.innerProperties() == null ? null : this.innerProperties().includeMemberScopes(); - } - - /** - * Set the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * - * @param includeMemberScopes the includeMemberScopes value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withIncludeMemberScopes(Boolean includeMemberScopes) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withIncludeMemberScopes(includeMemberScopes); - return this; - } - - /** - * Get the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - see - * example. - * - * @return the ownerSource value. - */ - public GovernanceRuleOwnerSource ownerSource() { - return this.innerProperties() == null ? null : this.innerProperties().ownerSource(); - } - - /** - * Set the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - see - * example. - * - * @param ownerSource the ownerSource value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withOwnerSource(GovernanceRuleOwnerSource ownerSource) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withOwnerSource(ownerSource); - return this; - } - - /** - * Get the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @return the governanceEmailNotification value. - */ - public GovernanceRuleEmailNotification governanceEmailNotification() { - return this.innerProperties() == null ? null : this.innerProperties().governanceEmailNotification(); - } - - /** - * Set the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification the governanceEmailNotification value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withGovernanceEmailNotification( - GovernanceRuleEmailNotification governanceEmailNotification) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withGovernanceEmailNotification(governanceEmailNotification); - return this; - } - - /** - * Get the metadata property: The governance rule metadata. - * - * @return the metadata value. - */ - public GovernanceRuleMetadata metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Set the metadata property: The governance rule metadata. - * - * @param metadata the metadata value to set. - * @return the GovernanceRuleInner object itself. - */ - public GovernanceRuleInner withMetadata(GovernanceRuleMetadata metadata) { - if (this.innerProperties() == null) { - this.innerProperties = new GovernanceRuleProperties(); - } - this.innerProperties().withMetadata(metadata); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleProperties.java deleted file mode 100644 index d54629e94239..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GovernanceRuleProperties.java +++ /dev/null @@ -1,464 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes properties of an governance rule. */ -@Fluent -public final class GovernanceRuleProperties { - /* - * The tenantId (GUID) - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * Display name of the governance rule - */ - @JsonProperty(value = "displayName", required = true) - private String displayName; - - /* - * Description of the governance rule - */ - @JsonProperty(value = "description") - private String description; - - /* - * Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. - * 7.00:00:00 - means 7 days - */ - @JsonProperty(value = "remediationTimeframe") - private String remediationTimeframe; - - /* - * Defines whether there is a grace period on the governance rule - */ - @JsonProperty(value = "isGracePeriod") - private Boolean isGracePeriod; - - /* - * The governance rule priority, priority to the lower number. Rules with the same priority on the same scope will - * not be allowed - */ - @JsonProperty(value = "rulePriority", required = true) - private int rulePriority; - - /* - * Defines whether the rule is active/inactive - */ - @JsonProperty(value = "isDisabled") - private Boolean isDisabled; - - /* - * The rule type of the governance rule, defines the source of the rule e.g. Integrated - */ - @JsonProperty(value = "ruleType", required = true) - private GovernanceRuleType ruleType; - - /* - * The governance rule source, what the rule affects, e.g. Assessments - */ - @JsonProperty(value = "sourceResourceType", required = true) - private GovernanceRuleSourceResourceType sourceResourceType; - - /* - * Excluded scopes, filter out the descendants of the scope (on management scopes) - */ - @JsonProperty(value = "excludedScopes") - private List excludedScopes; - - /* - * The governance rule conditionSets - see examples - */ - @JsonProperty(value = "conditionSets", required = true) - private List conditionSets; - - /* - * Defines whether the rule is management scope rule (master connector as a single scope or management scope) - */ - @JsonProperty(value = "includeMemberScopes") - private Boolean includeMemberScopes; - - /* - * The owner source for the governance rule - e.g. Manually by user@contoso.com - see example - */ - @JsonProperty(value = "ownerSource", required = true) - private GovernanceRuleOwnerSource ownerSource; - - /* - * The email notifications settings for the governance rule, states whether to disable notifications for mangers - * and owners - */ - @JsonProperty(value = "governanceEmailNotification") - private GovernanceRuleEmailNotification governanceEmailNotification; - - /* - * The governance rule metadata - */ - @JsonProperty(value = "metadata") - private GovernanceRuleMetadata metadata; - - /** Creates an instance of GovernanceRuleProperties class. */ - public GovernanceRuleProperties() { - } - - /** - * Get the tenantId property: The tenantId (GUID). - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the displayName property: Display name of the governance rule. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Display name of the governance rule. - * - * @param displayName the displayName value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: Description of the governance rule. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Description of the governance rule. - * - * @param description the description value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the remediationTimeframe property: Governance rule remediation timeframe - this is the time that will affect - * on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @return the remediationTimeframe value. - */ - public String remediationTimeframe() { - return this.remediationTimeframe; - } - - /** - * Set the remediationTimeframe property: Governance rule remediation timeframe - this is the time that will affect - * on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @param remediationTimeframe the remediationTimeframe value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withRemediationTimeframe(String remediationTimeframe) { - this.remediationTimeframe = remediationTimeframe; - return this; - } - - /** - * Get the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @return the isGracePeriod value. - */ - public Boolean isGracePeriod() { - return this.isGracePeriod; - } - - /** - * Set the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @param isGracePeriod the isGracePeriod value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withIsGracePeriod(Boolean isGracePeriod) { - this.isGracePeriod = isGracePeriod; - return this; - } - - /** - * Get the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * - * @return the rulePriority value. - */ - public int rulePriority() { - return this.rulePriority; - } - - /** - * Set the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * - * @param rulePriority the rulePriority value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withRulePriority(int rulePriority) { - this.rulePriority = rulePriority; - return this; - } - - /** - * Get the isDisabled property: Defines whether the rule is active/inactive. - * - * @return the isDisabled value. - */ - public Boolean isDisabled() { - return this.isDisabled; - } - - /** - * Set the isDisabled property: Defines whether the rule is active/inactive. - * - * @param isDisabled the isDisabled value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withIsDisabled(Boolean isDisabled) { - this.isDisabled = isDisabled; - return this; - } - - /** - * Get the ruleType property: The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * - * @return the ruleType value. - */ - public GovernanceRuleType ruleType() { - return this.ruleType; - } - - /** - * Set the ruleType property: The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * - * @param ruleType the ruleType value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withRuleType(GovernanceRuleType ruleType) { - this.ruleType = ruleType; - return this; - } - - /** - * Get the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - public GovernanceRuleSourceResourceType sourceResourceType() { - return this.sourceResourceType; - } - - /** - * Set the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * - * @param sourceResourceType the sourceResourceType value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType) { - this.sourceResourceType = sourceResourceType; - return this; - } - - /** - * Get the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @return the excludedScopes value. - */ - public List excludedScopes() { - return this.excludedScopes; - } - - /** - * Set the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management scopes). - * - * @param excludedScopes the excludedScopes value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withExcludedScopes(List excludedScopes) { - this.excludedScopes = excludedScopes; - return this; - } - - /** - * Get the conditionSets property: The governance rule conditionSets - see examples. - * - * @return the conditionSets value. - */ - public List conditionSets() { - return this.conditionSets; - } - - /** - * Set the conditionSets property: The governance rule conditionSets - see examples. - * - * @param conditionSets the conditionSets value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withConditionSets(List conditionSets) { - this.conditionSets = conditionSets; - return this; - } - - /** - * Get the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * - * @return the includeMemberScopes value. - */ - public Boolean includeMemberScopes() { - return this.includeMemberScopes; - } - - /** - * Set the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * - * @param includeMemberScopes the includeMemberScopes value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withIncludeMemberScopes(Boolean includeMemberScopes) { - this.includeMemberScopes = includeMemberScopes; - return this; - } - - /** - * Get the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - see - * example. - * - * @return the ownerSource value. - */ - public GovernanceRuleOwnerSource ownerSource() { - return this.ownerSource; - } - - /** - * Set the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - see - * example. - * - * @param ownerSource the ownerSource value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withOwnerSource(GovernanceRuleOwnerSource ownerSource) { - this.ownerSource = ownerSource; - return this; - } - - /** - * Get the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @return the governanceEmailNotification value. - */ - public GovernanceRuleEmailNotification governanceEmailNotification() { - return this.governanceEmailNotification; - } - - /** - * Set the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification the governanceEmailNotification value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withGovernanceEmailNotification( - GovernanceRuleEmailNotification governanceEmailNotification) { - this.governanceEmailNotification = governanceEmailNotification; - return this; - } - - /** - * Get the metadata property: The governance rule metadata. - * - * @return the metadata value. - */ - public GovernanceRuleMetadata metadata() { - return this.metadata; - } - - /** - * Set the metadata property: The governance rule metadata. - * - * @param metadata the metadata value to set. - * @return the GovernanceRuleProperties object itself. - */ - public GovernanceRuleProperties withMetadata(GovernanceRuleMetadata metadata) { - this.metadata = metadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (displayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model GovernanceRuleProperties")); - } - if (ruleType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ruleType in model GovernanceRuleProperties")); - } - if (sourceResourceType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property sourceResourceType in model GovernanceRuleProperties")); - } - if (conditionSets() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property conditionSets in model GovernanceRuleProperties")); - } - if (ownerSource() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ownerSource in model GovernanceRuleProperties")); - } else { - ownerSource().validate(); - } - if (governanceEmailNotification() != null) { - governanceEmailNotification().validate(); - } - if (metadata() != null) { - metadata().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(GovernanceRuleProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java deleted file mode 100644 index 31f24ba0c299..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportInner.java +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.EnvironmentDetails; -import com.azure.resourcemanager.security.models.HealthDataClassification; -import com.azure.resourcemanager.security.models.Issue; -import com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated; -import com.azure.resourcemanager.security.models.StatusAutoGenerated; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The health report resource. */ -@Fluent -public final class HealthReportInner extends ProxyResource { - /* - * Properties of a health report - */ - @JsonProperty(value = "properties") - private HealthReportProperties innerProperties; - - /** Creates an instance of HealthReportInner class. */ - public HealthReportInner() { - } - - /** - * Get the innerProperties property: Properties of a health report. - * - * @return the innerProperties value. - */ - private HealthReportProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the resourceDetails property: The resource details of the health report. - * - * @return the resourceDetails value. - */ - public ResourceDetailsAutoGenerated resourceDetails() { - return this.innerProperties() == null ? null : this.innerProperties().resourceDetails(); - } - - /** - * Set the resourceDetails property: The resource details of the health report. - * - * @param resourceDetails the resourceDetails value to set. - * @return the HealthReportInner object itself. - */ - public HealthReportInner withResourceDetails(ResourceDetailsAutoGenerated resourceDetails) { - if (this.innerProperties() == null) { - this.innerProperties = new HealthReportProperties(); - } - this.innerProperties().withResourceDetails(resourceDetails); - return this; - } - - /** - * Get the environmentDetails property: The environment details of the resource. - * - * @return the environmentDetails value. - */ - public EnvironmentDetails environmentDetails() { - return this.innerProperties() == null ? null : this.innerProperties().environmentDetails(); - } - - /** - * Set the environmentDetails property: The environment details of the resource. - * - * @param environmentDetails the environmentDetails value to set. - * @return the HealthReportInner object itself. - */ - public HealthReportInner withEnvironmentDetails(EnvironmentDetails environmentDetails) { - if (this.innerProperties() == null) { - this.innerProperties = new HealthReportProperties(); - } - this.innerProperties().withEnvironmentDetails(environmentDetails); - return this; - } - - /** - * Get the healthDataClassification property: The classification of the health report. - * - * @return the healthDataClassification value. - */ - public HealthDataClassification healthDataClassification() { - return this.innerProperties() == null ? null : this.innerProperties().healthDataClassification(); - } - - /** - * Set the healthDataClassification property: The classification of the health report. - * - * @param healthDataClassification the healthDataClassification value to set. - * @return the HealthReportInner object itself. - */ - public HealthReportInner withHealthDataClassification(HealthDataClassification healthDataClassification) { - if (this.innerProperties() == null) { - this.innerProperties = new HealthReportProperties(); - } - this.innerProperties().withHealthDataClassification(healthDataClassification); - return this; - } - - /** - * Get the status property: The status of the health report. - * - * @return the status value. - */ - public StatusAutoGenerated status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: The status of the health report. - * - * @param status the status value to set. - * @return the HealthReportInner object itself. - */ - public HealthReportInner withStatus(StatusAutoGenerated status) { - if (this.innerProperties() == null) { - this.innerProperties = new HealthReportProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * - * @return the affectedDefendersPlans value. - */ - public List affectedDefendersPlans() { - return this.innerProperties() == null ? null : this.innerProperties().affectedDefendersPlans(); - } - - /** - * Set the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * - * @param affectedDefendersPlans the affectedDefendersPlans value to set. - * @return the HealthReportInner object itself. - */ - public HealthReportInner withAffectedDefendersPlans(List affectedDefendersPlans) { - if (this.innerProperties() == null) { - this.innerProperties = new HealthReportProperties(); - } - this.innerProperties().withAffectedDefendersPlans(affectedDefendersPlans); - return this; - } - - /** - * Get the issues property: A collection of the issues in the report. - * - * @return the issues value. - */ - public List issues() { - return this.innerProperties() == null ? null : this.innerProperties().issues(); - } - - /** - * Set the issues property: A collection of the issues in the report. - * - * @param issues the issues value to set. - * @return the HealthReportInner object itself. - */ - public HealthReportInner withIssues(List issues) { - if (this.innerProperties() == null) { - this.innerProperties = new HealthReportProperties(); - } - this.innerProperties().withIssues(issues); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java deleted file mode 100644 index 98ee1832e128..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/HealthReportProperties.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.EnvironmentDetails; -import com.azure.resourcemanager.security.models.HealthDataClassification; -import com.azure.resourcemanager.security.models.Issue; -import com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated; -import com.azure.resourcemanager.security.models.StatusAutoGenerated; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes properties of the health report. */ -@Fluent -public final class HealthReportProperties { - /* - * The resource details of the health report - */ - @JsonProperty(value = "resourceDetails") - private ResourceDetailsAutoGenerated resourceDetails; - - /* - * The environment details of the resource - */ - @JsonProperty(value = "environmentDetails") - private EnvironmentDetails environmentDetails; - - /* - * The classification of the health report - */ - @JsonProperty(value = "healthDataClassification") - private HealthDataClassification healthDataClassification; - - /* - * The status of the health report - */ - @JsonProperty(value = "status") - private StatusAutoGenerated status; - - /* - * The affected defenders plans by unhealthy report - */ - @JsonProperty(value = "affectedDefendersPlans") - private List affectedDefendersPlans; - - /* - * A collection of the issues in the report - */ - @JsonProperty(value = "issues") - private List issues; - - /** Creates an instance of HealthReportProperties class. */ - public HealthReportProperties() { - } - - /** - * Get the resourceDetails property: The resource details of the health report. - * - * @return the resourceDetails value. - */ - public ResourceDetailsAutoGenerated resourceDetails() { - return this.resourceDetails; - } - - /** - * Set the resourceDetails property: The resource details of the health report. - * - * @param resourceDetails the resourceDetails value to set. - * @return the HealthReportProperties object itself. - */ - public HealthReportProperties withResourceDetails(ResourceDetailsAutoGenerated resourceDetails) { - this.resourceDetails = resourceDetails; - return this; - } - - /** - * Get the environmentDetails property: The environment details of the resource. - * - * @return the environmentDetails value. - */ - public EnvironmentDetails environmentDetails() { - return this.environmentDetails; - } - - /** - * Set the environmentDetails property: The environment details of the resource. - * - * @param environmentDetails the environmentDetails value to set. - * @return the HealthReportProperties object itself. - */ - public HealthReportProperties withEnvironmentDetails(EnvironmentDetails environmentDetails) { - this.environmentDetails = environmentDetails; - return this; - } - - /** - * Get the healthDataClassification property: The classification of the health report. - * - * @return the healthDataClassification value. - */ - public HealthDataClassification healthDataClassification() { - return this.healthDataClassification; - } - - /** - * Set the healthDataClassification property: The classification of the health report. - * - * @param healthDataClassification the healthDataClassification value to set. - * @return the HealthReportProperties object itself. - */ - public HealthReportProperties withHealthDataClassification(HealthDataClassification healthDataClassification) { - this.healthDataClassification = healthDataClassification; - return this; - } - - /** - * Get the status property: The status of the health report. - * - * @return the status value. - */ - public StatusAutoGenerated status() { - return this.status; - } - - /** - * Set the status property: The status of the health report. - * - * @param status the status value to set. - * @return the HealthReportProperties object itself. - */ - public HealthReportProperties withStatus(StatusAutoGenerated status) { - this.status = status; - return this; - } - - /** - * Get the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * - * @return the affectedDefendersPlans value. - */ - public List affectedDefendersPlans() { - return this.affectedDefendersPlans; - } - - /** - * Set the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * - * @param affectedDefendersPlans the affectedDefendersPlans value to set. - * @return the HealthReportProperties object itself. - */ - public HealthReportProperties withAffectedDefendersPlans(List affectedDefendersPlans) { - this.affectedDefendersPlans = affectedDefendersPlans; - return this; - } - - /** - * Get the issues property: A collection of the issues in the report. - * - * @return the issues value. - */ - public List issues() { - return this.issues; - } - - /** - * Set the issues property: A collection of the issues in the report. - * - * @param issues the issues value to set. - * @return the HealthReportProperties object itself. - */ - public HealthReportProperties withIssues(List issues) { - this.issues = issues; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (resourceDetails() != null) { - resourceDetails().validate(); - } - if (environmentDetails() != null) { - environmentDetails().validate(); - } - if (healthDataClassification() != null) { - healthDataClassification().validate(); - } - if (status() != null) { - status().validate(); - } - if (issues() != null) { - issues().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java deleted file mode 100644 index f146e90386f2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyInner.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.InformationType; -import com.azure.resourcemanager.security.models.SensitivityLabel; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** Information protection policy. */ -@Fluent -public final class InformationProtectionPolicyInner extends ProxyResource { - /* - * Information protection policy data - */ - @JsonProperty(value = "properties") - private InformationProtectionPolicyProperties innerProperties; - - /** Creates an instance of InformationProtectionPolicyInner class. */ - public InformationProtectionPolicyInner() { - } - - /** - * Get the innerProperties property: Information protection policy data. - * - * @return the innerProperties value. - */ - private InformationProtectionPolicyProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the lastModifiedUtc property: Describes the last UTC time the policy was modified. - * - * @return the lastModifiedUtc value. - */ - public OffsetDateTime lastModifiedUtc() { - return this.innerProperties() == null ? null : this.innerProperties().lastModifiedUtc(); - } - - /** - * Get the version property: Describes the version of the policy. - * - * @return the version value. - */ - public String version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Get the labels property: Dictionary of sensitivity labels. - * - * @return the labels value. - */ - public Map labels() { - return this.innerProperties() == null ? null : this.innerProperties().labels(); - } - - /** - * Set the labels property: Dictionary of sensitivity labels. - * - * @param labels the labels value to set. - * @return the InformationProtectionPolicyInner object itself. - */ - public InformationProtectionPolicyInner withLabels(Map labels) { - if (this.innerProperties() == null) { - this.innerProperties = new InformationProtectionPolicyProperties(); - } - this.innerProperties().withLabels(labels); - return this; - } - - /** - * Get the informationTypes property: The sensitivity information types. - * - * @return the informationTypes value. - */ - public Map informationTypes() { - return this.innerProperties() == null ? null : this.innerProperties().informationTypes(); - } - - /** - * Set the informationTypes property: The sensitivity information types. - * - * @param informationTypes the informationTypes value to set. - * @return the InformationProtectionPolicyInner object itself. - */ - public InformationProtectionPolicyInner withInformationTypes(Map informationTypes) { - if (this.innerProperties() == null) { - this.innerProperties = new InformationProtectionPolicyProperties(); - } - this.innerProperties().withInformationTypes(informationTypes); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyProperties.java deleted file mode 100644 index 6cbcb454c196..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/InformationProtectionPolicyProperties.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.InformationType; -import com.azure.resourcemanager.security.models.SensitivityLabel; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.Map; - -/** describes properties of an information protection policy. */ -@Fluent -public final class InformationProtectionPolicyProperties { - /* - * Describes the last UTC time the policy was modified. - */ - @JsonProperty(value = "lastModifiedUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastModifiedUtc; - - /* - * Describes the version of the policy. - */ - @JsonProperty(value = "version", access = JsonProperty.Access.WRITE_ONLY) - private String version; - - /* - * Dictionary of sensitivity labels. - */ - @JsonProperty(value = "labels") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map labels; - - /* - * The sensitivity information types. - */ - @JsonProperty(value = "informationTypes") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map informationTypes; - - /** Creates an instance of InformationProtectionPolicyProperties class. */ - public InformationProtectionPolicyProperties() { - } - - /** - * Get the lastModifiedUtc property: Describes the last UTC time the policy was modified. - * - * @return the lastModifiedUtc value. - */ - public OffsetDateTime lastModifiedUtc() { - return this.lastModifiedUtc; - } - - /** - * Get the version property: Describes the version of the policy. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Get the labels property: Dictionary of sensitivity labels. - * - * @return the labels value. - */ - public Map labels() { - return this.labels; - } - - /** - * Set the labels property: Dictionary of sensitivity labels. - * - * @param labels the labels value to set. - * @return the InformationProtectionPolicyProperties object itself. - */ - public InformationProtectionPolicyProperties withLabels(Map labels) { - this.labels = labels; - return this; - } - - /** - * Get the informationTypes property: The sensitivity information types. - * - * @return the informationTypes value. - */ - public Map informationTypes() { - return this.informationTypes; - } - - /** - * Set the informationTypes property: The sensitivity information types. - * - * @param informationTypes the informationTypes value to set. - * @return the InformationProtectionPolicyProperties object itself. - */ - public InformationProtectionPolicyProperties withInformationTypes(Map informationTypes) { - this.informationTypes = informationTypes; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (labels() != null) { - labels() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - if (informationTypes() != null) { - informationTypes() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingInner.java deleted file mode 100644 index 6bf368c4d201..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingInner.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configures how to correlate scan data and logs with resources associated with the subscription. */ -@Fluent -public final class IngestionSettingInner extends ProxyResource { - /* - * Ingestion setting data - */ - @JsonProperty(value = "properties") - private Object properties; - - /** Creates an instance of IngestionSettingInner class. */ - public IngestionSettingInner() { - } - - /** - * Get the properties property: Ingestion setting data. - * - * @return the properties value. - */ - public Object properties() { - return this.properties; - } - - /** - * Set the properties property: Ingestion setting data. - * - * @param properties the properties value to set. - * @return the IngestionSettingInner object itself. - */ - public IngestionSettingInner withProperties(Object properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingTokenInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingTokenInner.java deleted file mode 100644 index dd95c8c94ce6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IngestionSettingTokenInner.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configures how to correlate scan data and logs with resources associated with the subscription. */ -@Immutable -public final class IngestionSettingTokenInner { - /* - * The token is used for correlating security data and logs with the resources in the subscription. - */ - @JsonProperty(value = "token", access = JsonProperty.Access.WRITE_ONLY) - private String token; - - /** Creates an instance of IngestionSettingTokenInner class. */ - public IngestionSettingTokenInner() { - } - - /** - * Get the token property: The token is used for correlating security data and logs with the resources in the - * subscription. - * - * @return the token value. - */ - public String token() { - return this.token; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java deleted file mode 100644 index d6ac39d9089d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertInner.java +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem; -import com.azure.resourcemanager.security.models.ReportedSeverity; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.LocalDate; -import java.util.List; -import java.util.Map; - -/** Security Solution Aggregated Alert information. */ -@Fluent -public final class IoTSecurityAggregatedAlertInner extends ProxyResource { - /* - * IoT Security solution aggregated alert details. - */ - @JsonProperty(value = "properties") - private IoTSecurityAggregatedAlertProperties innerProperties; - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** Creates an instance of IoTSecurityAggregatedAlertInner class. */ - public IoTSecurityAggregatedAlertInner() { - } - - /** - * Get the innerProperties property: IoT Security solution aggregated alert details. - * - * @return the innerProperties value. - */ - private IoTSecurityAggregatedAlertProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the IoTSecurityAggregatedAlertInner object itself. - */ - public IoTSecurityAggregatedAlertInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the alertType property: Name of the alert type. - * - * @return the alertType value. - */ - public String alertType() { - return this.innerProperties() == null ? null : this.innerProperties().alertType(); - } - - /** - * Get the alertDisplayName property: Display name of the alert type. - * - * @return the alertDisplayName value. - */ - public String alertDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().alertDisplayName(); - } - - /** - * Get the aggregatedDateUtc property: Date of detection. - * - * @return the aggregatedDateUtc value. - */ - public LocalDate aggregatedDateUtc() { - return this.innerProperties() == null ? null : this.innerProperties().aggregatedDateUtc(); - } - - /** - * Get the vendorName property: Name of the organization that raised the alert. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.innerProperties() == null ? null : this.innerProperties().vendorName(); - } - - /** - * Get the reportedSeverity property: Assessed alert severity. - * - * @return the reportedSeverity value. - */ - public ReportedSeverity reportedSeverity() { - return this.innerProperties() == null ? null : this.innerProperties().reportedSeverity(); - } - - /** - * Get the remediationSteps property: Recommended steps for remediation. - * - * @return the remediationSteps value. - */ - public String remediationSteps() { - return this.innerProperties() == null ? null : this.innerProperties().remediationSteps(); - } - - /** - * Get the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the count property: Number of alerts occurrences within the aggregated time window. - * - * @return the count value. - */ - public Long count() { - return this.innerProperties() == null ? null : this.innerProperties().count(); - } - - /** - * Get the effectedResourceType property: Azure resource ID of the resource that received the alerts. - * - * @return the effectedResourceType value. - */ - public String effectedResourceType() { - return this.innerProperties() == null ? null : this.innerProperties().effectedResourceType(); - } - - /** - * Get the systemSource property: The type of the alerted resource (Azure, Non-Azure). - * - * @return the systemSource value. - */ - public String systemSource() { - return this.innerProperties() == null ? null : this.innerProperties().systemSource(); - } - - /** - * Get the actionTaken property: IoT Security solution alert response. - * - * @return the actionTaken value. - */ - public String actionTaken() { - return this.innerProperties() == null ? null : this.innerProperties().actionTaken(); - } - - /** - * Get the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. - * - * @return the logAnalyticsQuery value. - */ - public String logAnalyticsQuery() { - return this.innerProperties() == null ? null : this.innerProperties().logAnalyticsQuery(); - } - - /** - * Get the topDevicesList property: 10 devices with the highest number of occurrences of this alert type, on this - * day. - * - * @return the topDevicesList value. - */ - public List topDevicesList() { - return this.innerProperties() == null ? null : this.innerProperties().topDevicesList(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertProperties.java deleted file mode 100644 index 7413ba8442db..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedAlertProperties.java +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem; -import com.azure.resourcemanager.security.models.ReportedSeverity; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.LocalDate; -import java.util.List; - -/** IoT Security solution aggregated alert details. */ -@Immutable -public final class IoTSecurityAggregatedAlertProperties { - /* - * Name of the alert type. - */ - @JsonProperty(value = "alertType", access = JsonProperty.Access.WRITE_ONLY) - private String alertType; - - /* - * Display name of the alert type. - */ - @JsonProperty(value = "alertDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String alertDisplayName; - - /* - * Date of detection. - */ - @JsonProperty(value = "aggregatedDateUtc", access = JsonProperty.Access.WRITE_ONLY) - private LocalDate aggregatedDateUtc; - - /* - * Name of the organization that raised the alert. - */ - @JsonProperty(value = "vendorName", access = JsonProperty.Access.WRITE_ONLY) - private String vendorName; - - /* - * Assessed alert severity. - */ - @JsonProperty(value = "reportedSeverity", access = JsonProperty.Access.WRITE_ONLY) - private ReportedSeverity reportedSeverity; - - /* - * Recommended steps for remediation. - */ - @JsonProperty(value = "remediationSteps", access = JsonProperty.Access.WRITE_ONLY) - private String remediationSteps; - - /* - * Description of the suspected vulnerability and meaning. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * Number of alerts occurrences within the aggregated time window. - */ - @JsonProperty(value = "count", access = JsonProperty.Access.WRITE_ONLY) - private Long count; - - /* - * Azure resource ID of the resource that received the alerts. - */ - @JsonProperty(value = "effectedResourceType", access = JsonProperty.Access.WRITE_ONLY) - private String effectedResourceType; - - /* - * The type of the alerted resource (Azure, Non-Azure). - */ - @JsonProperty(value = "systemSource", access = JsonProperty.Access.WRITE_ONLY) - private String systemSource; - - /* - * IoT Security solution alert response. - */ - @JsonProperty(value = "actionTaken", access = JsonProperty.Access.WRITE_ONLY) - private String actionTaken; - - /* - * Log analytics query for getting the list of affected devices/alerts. - */ - @JsonProperty(value = "logAnalyticsQuery", access = JsonProperty.Access.WRITE_ONLY) - private String logAnalyticsQuery; - - /* - * 10 devices with the highest number of occurrences of this alert type, on this day. - */ - @JsonProperty(value = "topDevicesList", access = JsonProperty.Access.WRITE_ONLY) - private List topDevicesList; - - /** Creates an instance of IoTSecurityAggregatedAlertProperties class. */ - public IoTSecurityAggregatedAlertProperties() { - } - - /** - * Get the alertType property: Name of the alert type. - * - * @return the alertType value. - */ - public String alertType() { - return this.alertType; - } - - /** - * Get the alertDisplayName property: Display name of the alert type. - * - * @return the alertDisplayName value. - */ - public String alertDisplayName() { - return this.alertDisplayName; - } - - /** - * Get the aggregatedDateUtc property: Date of detection. - * - * @return the aggregatedDateUtc value. - */ - public LocalDate aggregatedDateUtc() { - return this.aggregatedDateUtc; - } - - /** - * Get the vendorName property: Name of the organization that raised the alert. - * - * @return the vendorName value. - */ - public String vendorName() { - return this.vendorName; - } - - /** - * Get the reportedSeverity property: Assessed alert severity. - * - * @return the reportedSeverity value. - */ - public ReportedSeverity reportedSeverity() { - return this.reportedSeverity; - } - - /** - * Get the remediationSteps property: Recommended steps for remediation. - * - * @return the remediationSteps value. - */ - public String remediationSteps() { - return this.remediationSteps; - } - - /** - * Get the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the count property: Number of alerts occurrences within the aggregated time window. - * - * @return the count value. - */ - public Long count() { - return this.count; - } - - /** - * Get the effectedResourceType property: Azure resource ID of the resource that received the alerts. - * - * @return the effectedResourceType value. - */ - public String effectedResourceType() { - return this.effectedResourceType; - } - - /** - * Get the systemSource property: The type of the alerted resource (Azure, Non-Azure). - * - * @return the systemSource value. - */ - public String systemSource() { - return this.systemSource; - } - - /** - * Get the actionTaken property: IoT Security solution alert response. - * - * @return the actionTaken value. - */ - public String actionTaken() { - return this.actionTaken; - } - - /** - * Get the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. - * - * @return the logAnalyticsQuery value. - */ - public String logAnalyticsQuery() { - return this.logAnalyticsQuery; - } - - /** - * Get the topDevicesList property: 10 devices with the highest number of occurrences of this alert type, on this - * day. - * - * @return the topDevicesList value. - */ - public List topDevicesList() { - return this.topDevicesList; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (topDevicesList() != null) { - topDevicesList().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java deleted file mode 100644 index 9d9a7c3beb31..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationInner.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.ReportedSeverity; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** IoT Security solution recommendation information. */ -@Fluent -public final class IoTSecurityAggregatedRecommendationInner extends ProxyResource { - /* - * Security Solution data - */ - @JsonProperty(value = "properties") - private IoTSecurityAggregatedRecommendationProperties innerProperties; - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** Creates an instance of IoTSecurityAggregatedRecommendationInner class. */ - public IoTSecurityAggregatedRecommendationInner() { - } - - /** - * Get the innerProperties property: Security Solution data. - * - * @return the innerProperties value. - */ - private IoTSecurityAggregatedRecommendationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the IoTSecurityAggregatedRecommendationInner object itself. - */ - public IoTSecurityAggregatedRecommendationInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the recommendationName property: Name of the recommendation. - * - * @return the recommendationName value. - */ - public String recommendationName() { - return this.innerProperties() == null ? null : this.innerProperties().recommendationName(); - } - - /** - * Set the recommendationName property: Name of the recommendation. - * - * @param recommendationName the recommendationName value to set. - * @return the IoTSecurityAggregatedRecommendationInner object itself. - */ - public IoTSecurityAggregatedRecommendationInner withRecommendationName(String recommendationName) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecurityAggregatedRecommendationProperties(); - } - this.innerProperties().withRecommendationName(recommendationName); - return this; - } - - /** - * Get the recommendationDisplayName property: Display name of the recommendation type. - * - * @return the recommendationDisplayName value. - */ - public String recommendationDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().recommendationDisplayName(); - } - - /** - * Get the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the recommendationTypeId property: Recommendation-type GUID. - * - * @return the recommendationTypeId value. - */ - public String recommendationTypeId() { - return this.innerProperties() == null ? null : this.innerProperties().recommendationTypeId(); - } - - /** - * Get the detectedBy property: Name of the organization that made the recommendation. - * - * @return the detectedBy value. - */ - public String detectedBy() { - return this.innerProperties() == null ? null : this.innerProperties().detectedBy(); - } - - /** - * Get the remediationSteps property: Recommended steps for remediation. - * - * @return the remediationSteps value. - */ - public String remediationSteps() { - return this.innerProperties() == null ? null : this.innerProperties().remediationSteps(); - } - - /** - * Get the reportedSeverity property: Assessed recommendation severity. - * - * @return the reportedSeverity value. - */ - public ReportedSeverity reportedSeverity() { - return this.innerProperties() == null ? null : this.innerProperties().reportedSeverity(); - } - - /** - * Get the healthyDevices property: Number of healthy devices within the IoT Security solution. - * - * @return the healthyDevices value. - */ - public Long healthyDevices() { - return this.innerProperties() == null ? null : this.innerProperties().healthyDevices(); - } - - /** - * Get the unhealthyDeviceCount property: Number of unhealthy devices within the IoT Security solution. - * - * @return the unhealthyDeviceCount value. - */ - public Long unhealthyDeviceCount() { - return this.innerProperties() == null ? null : this.innerProperties().unhealthyDeviceCount(); - } - - /** - * Get the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. - * - * @return the logAnalyticsQuery value. - */ - public String logAnalyticsQuery() { - return this.innerProperties() == null ? null : this.innerProperties().logAnalyticsQuery(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationProperties.java deleted file mode 100644 index 9ee966078183..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecurityAggregatedRecommendationProperties.java +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.ReportedSeverity; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IoT Security solution aggregated recommendation information. */ -@Fluent -public final class IoTSecurityAggregatedRecommendationProperties { - /* - * Name of the recommendation. - */ - @JsonProperty(value = "recommendationName") - private String recommendationName; - - /* - * Display name of the recommendation type. - */ - @JsonProperty(value = "recommendationDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String recommendationDisplayName; - - /* - * Description of the suspected vulnerability and meaning. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * Recommendation-type GUID. - */ - @JsonProperty(value = "recommendationTypeId", access = JsonProperty.Access.WRITE_ONLY) - private String recommendationTypeId; - - /* - * Name of the organization that made the recommendation. - */ - @JsonProperty(value = "detectedBy", access = JsonProperty.Access.WRITE_ONLY) - private String detectedBy; - - /* - * Recommended steps for remediation - */ - @JsonProperty(value = "remediationSteps", access = JsonProperty.Access.WRITE_ONLY) - private String remediationSteps; - - /* - * Assessed recommendation severity. - */ - @JsonProperty(value = "reportedSeverity", access = JsonProperty.Access.WRITE_ONLY) - private ReportedSeverity reportedSeverity; - - /* - * Number of healthy devices within the IoT Security solution. - */ - @JsonProperty(value = "healthyDevices", access = JsonProperty.Access.WRITE_ONLY) - private Long healthyDevices; - - /* - * Number of unhealthy devices within the IoT Security solution. - */ - @JsonProperty(value = "unhealthyDeviceCount", access = JsonProperty.Access.WRITE_ONLY) - private Long unhealthyDeviceCount; - - /* - * Log analytics query for getting the list of affected devices/alerts. - */ - @JsonProperty(value = "logAnalyticsQuery", access = JsonProperty.Access.WRITE_ONLY) - private String logAnalyticsQuery; - - /** Creates an instance of IoTSecurityAggregatedRecommendationProperties class. */ - public IoTSecurityAggregatedRecommendationProperties() { - } - - /** - * Get the recommendationName property: Name of the recommendation. - * - * @return the recommendationName value. - */ - public String recommendationName() { - return this.recommendationName; - } - - /** - * Set the recommendationName property: Name of the recommendation. - * - * @param recommendationName the recommendationName value to set. - * @return the IoTSecurityAggregatedRecommendationProperties object itself. - */ - public IoTSecurityAggregatedRecommendationProperties withRecommendationName(String recommendationName) { - this.recommendationName = recommendationName; - return this; - } - - /** - * Get the recommendationDisplayName property: Display name of the recommendation type. - * - * @return the recommendationDisplayName value. - */ - public String recommendationDisplayName() { - return this.recommendationDisplayName; - } - - /** - * Get the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the recommendationTypeId property: Recommendation-type GUID. - * - * @return the recommendationTypeId value. - */ - public String recommendationTypeId() { - return this.recommendationTypeId; - } - - /** - * Get the detectedBy property: Name of the organization that made the recommendation. - * - * @return the detectedBy value. - */ - public String detectedBy() { - return this.detectedBy; - } - - /** - * Get the remediationSteps property: Recommended steps for remediation. - * - * @return the remediationSteps value. - */ - public String remediationSteps() { - return this.remediationSteps; - } - - /** - * Get the reportedSeverity property: Assessed recommendation severity. - * - * @return the reportedSeverity value. - */ - public ReportedSeverity reportedSeverity() { - return this.reportedSeverity; - } - - /** - * Get the healthyDevices property: Number of healthy devices within the IoT Security solution. - * - * @return the healthyDevices value. - */ - public Long healthyDevices() { - return this.healthyDevices; - } - - /** - * Get the unhealthyDeviceCount property: Number of unhealthy devices within the IoT Security solution. - * - * @return the unhealthyDeviceCount value. - */ - public Long unhealthyDeviceCount() { - return this.unhealthyDeviceCount; - } - - /** - * Get the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. - * - * @return the logAnalyticsQuery value. - */ - public String logAnalyticsQuery() { - return this.logAnalyticsQuery; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelInner.java deleted file mode 100644 index fb70db188a5e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelInner.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem; -import com.azure.resourcemanager.security.models.IoTSeverityMetrics; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Security analytics of your IoT Security solution. */ -@Fluent -public final class IoTSecuritySolutionAnalyticsModelInner extends ProxyResource { - /* - * Security Solution Aggregated Alert data - */ - @JsonProperty(value = "properties") - private IoTSecuritySolutionAnalyticsModelProperties innerProperties; - - /** Creates an instance of IoTSecuritySolutionAnalyticsModelInner class. */ - public IoTSecuritySolutionAnalyticsModelInner() { - } - - /** - * Get the innerProperties property: Security Solution Aggregated Alert data. - * - * @return the innerProperties value. - */ - private IoTSecuritySolutionAnalyticsModelProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the metrics property: Security analytics of your IoT Security solution. - * - * @return the metrics value. - */ - public IoTSeverityMetrics metrics() { - return this.innerProperties() == null ? null : this.innerProperties().metrics(); - } - - /** - * Get the unhealthyDeviceCount property: Number of unhealthy devices within your IoT Security solution. - * - * @return the unhealthyDeviceCount value. - */ - public Long unhealthyDeviceCount() { - return this.innerProperties() == null ? null : this.innerProperties().unhealthyDeviceCount(); - } - - /** - * Get the devicesMetrics property: List of device metrics by the aggregation date. - * - * @return the devicesMetrics value. - */ - public List devicesMetrics() { - return this.innerProperties() == null ? null : this.innerProperties().devicesMetrics(); - } - - /** - * Get the topAlertedDevices property: List of the 3 devices with the most alerts. - * - * @return the topAlertedDevices value. - */ - public List topAlertedDevices() { - return this.innerProperties() == null ? null : this.innerProperties().topAlertedDevices(); - } - - /** - * Set the topAlertedDevices property: List of the 3 devices with the most alerts. - * - * @param topAlertedDevices the topAlertedDevices value to set. - * @return the IoTSecuritySolutionAnalyticsModelInner object itself. - */ - public IoTSecuritySolutionAnalyticsModelInner withTopAlertedDevices( - List topAlertedDevices) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionAnalyticsModelProperties(); - } - this.innerProperties().withTopAlertedDevices(topAlertedDevices); - return this; - } - - /** - * Get the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts. - * - * @return the mostPrevalentDeviceAlerts value. - */ - public List mostPrevalentDeviceAlerts() { - return this.innerProperties() == null ? null : this.innerProperties().mostPrevalentDeviceAlerts(); - } - - /** - * Set the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts. - * - * @param mostPrevalentDeviceAlerts the mostPrevalentDeviceAlerts value to set. - * @return the IoTSecuritySolutionAnalyticsModelInner object itself. - */ - public IoTSecuritySolutionAnalyticsModelInner withMostPrevalentDeviceAlerts( - List mostPrevalentDeviceAlerts) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionAnalyticsModelProperties(); - } - this.innerProperties().withMostPrevalentDeviceAlerts(mostPrevalentDeviceAlerts); - return this; - } - - /** - * Get the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations. - * - * @return the mostPrevalentDeviceRecommendations value. - */ - public List mostPrevalentDeviceRecommendations() { - return this.innerProperties() == null ? null : this.innerProperties().mostPrevalentDeviceRecommendations(); - } - - /** - * Set the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations. - * - * @param mostPrevalentDeviceRecommendations the mostPrevalentDeviceRecommendations value to set. - * @return the IoTSecuritySolutionAnalyticsModelInner object itself. - */ - public IoTSecuritySolutionAnalyticsModelInner withMostPrevalentDeviceRecommendations( - List mostPrevalentDeviceRecommendations) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionAnalyticsModelProperties(); - } - this.innerProperties().withMostPrevalentDeviceRecommendations(mostPrevalentDeviceRecommendations); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelListInner.java deleted file mode 100644 index 05ebcd73f079..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelListInner.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of Security analytics of your IoT Security solution. */ -@Fluent -public final class IoTSecuritySolutionAnalyticsModelListInner { - /* - * List of Security analytics of your IoT Security solution - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * When there is too much alert data for one page, use this URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of IoTSecuritySolutionAnalyticsModelListInner class. */ - public IoTSecuritySolutionAnalyticsModelListInner() { - } - - /** - * Get the value property: List of Security analytics of your IoT Security solution. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Security analytics of your IoT Security solution. - * - * @param value the value value to set. - * @return the IoTSecuritySolutionAnalyticsModelListInner object itself. - */ - public IoTSecuritySolutionAnalyticsModelListInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: When there is too much alert data 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 IoTSecuritySolutionAnalyticsModelListInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IoTSecuritySolutionAnalyticsModelListInner.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelProperties.java deleted file mode 100644 index 6ca28aeb9f29..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionAnalyticsModelProperties.java +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem; -import com.azure.resourcemanager.security.models.IoTSeverityMetrics; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Security analytics properties of your IoT Security solution. */ -@Fluent -public final class IoTSecuritySolutionAnalyticsModelProperties { - /* - * Security analytics of your IoT Security solution. - */ - @JsonProperty(value = "metrics", access = JsonProperty.Access.WRITE_ONLY) - private IoTSeverityMetrics metrics; - - /* - * Number of unhealthy devices within your IoT Security solution. - */ - @JsonProperty(value = "unhealthyDeviceCount", access = JsonProperty.Access.WRITE_ONLY) - private Long unhealthyDeviceCount; - - /* - * List of device metrics by the aggregation date. - */ - @JsonProperty(value = "devicesMetrics", access = JsonProperty.Access.WRITE_ONLY) - private List devicesMetrics; - - /* - * List of the 3 devices with the most alerts. - */ - @JsonProperty(value = "topAlertedDevices") - private List topAlertedDevices; - - /* - * List of the 3 most prevalent device alerts. - */ - @JsonProperty(value = "mostPrevalentDeviceAlerts") - private List mostPrevalentDeviceAlerts; - - /* - * List of the 3 most prevalent device recommendations. - */ - @JsonProperty(value = "mostPrevalentDeviceRecommendations") - private List mostPrevalentDeviceRecommendations; - - /** Creates an instance of IoTSecuritySolutionAnalyticsModelProperties class. */ - public IoTSecuritySolutionAnalyticsModelProperties() { - } - - /** - * Get the metrics property: Security analytics of your IoT Security solution. - * - * @return the metrics value. - */ - public IoTSeverityMetrics metrics() { - return this.metrics; - } - - /** - * Get the unhealthyDeviceCount property: Number of unhealthy devices within your IoT Security solution. - * - * @return the unhealthyDeviceCount value. - */ - public Long unhealthyDeviceCount() { - return this.unhealthyDeviceCount; - } - - /** - * Get the devicesMetrics property: List of device metrics by the aggregation date. - * - * @return the devicesMetrics value. - */ - public List devicesMetrics() { - return this.devicesMetrics; - } - - /** - * Get the topAlertedDevices property: List of the 3 devices with the most alerts. - * - * @return the topAlertedDevices value. - */ - public List topAlertedDevices() { - return this.topAlertedDevices; - } - - /** - * Set the topAlertedDevices property: List of the 3 devices with the most alerts. - * - * @param topAlertedDevices the topAlertedDevices value to set. - * @return the IoTSecuritySolutionAnalyticsModelProperties object itself. - */ - public IoTSecuritySolutionAnalyticsModelProperties withTopAlertedDevices( - List topAlertedDevices) { - this.topAlertedDevices = topAlertedDevices; - return this; - } - - /** - * Get the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts. - * - * @return the mostPrevalentDeviceAlerts value. - */ - public List mostPrevalentDeviceAlerts() { - return this.mostPrevalentDeviceAlerts; - } - - /** - * Set the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts. - * - * @param mostPrevalentDeviceAlerts the mostPrevalentDeviceAlerts value to set. - * @return the IoTSecuritySolutionAnalyticsModelProperties object itself. - */ - public IoTSecuritySolutionAnalyticsModelProperties withMostPrevalentDeviceAlerts( - List mostPrevalentDeviceAlerts) { - this.mostPrevalentDeviceAlerts = mostPrevalentDeviceAlerts; - return this; - } - - /** - * Get the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations. - * - * @return the mostPrevalentDeviceRecommendations value. - */ - public List mostPrevalentDeviceRecommendations() { - return this.mostPrevalentDeviceRecommendations; - } - - /** - * Set the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations. - * - * @param mostPrevalentDeviceRecommendations the mostPrevalentDeviceRecommendations value to set. - * @return the IoTSecuritySolutionAnalyticsModelProperties object itself. - */ - public IoTSecuritySolutionAnalyticsModelProperties withMostPrevalentDeviceRecommendations( - List mostPrevalentDeviceRecommendations) { - this.mostPrevalentDeviceRecommendations = mostPrevalentDeviceRecommendations; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (metrics() != null) { - metrics().validate(); - } - if (devicesMetrics() != null) { - devicesMetrics().forEach(e -> e.validate()); - } - if (topAlertedDevices() != null) { - topAlertedDevices().forEach(e -> e.validate()); - } - if (mostPrevalentDeviceAlerts() != null) { - mostPrevalentDeviceAlerts().forEach(e -> e.validate()); - } - if (mostPrevalentDeviceRecommendations() != null) { - mostPrevalentDeviceRecommendations().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java deleted file mode 100644 index 6659bf29c42b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionModelInner.java +++ /dev/null @@ -1,364 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.models.AdditionalWorkspacesProperties; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** IoT Security solution configuration and resource information. */ -@Fluent -public final class IoTSecuritySolutionModelInner extends ProxyResource { - /* - * The resource location. - */ - @JsonProperty(value = "location") - private String location; - - /* - * Security Solution data - */ - @JsonProperty(value = "properties") - private IoTSecuritySolutionProperties innerProperties; - - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Resource tags - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** Creates an instance of IoTSecuritySolutionModelInner class. */ - public IoTSecuritySolutionModelInner() { - } - - /** - * Get the location property: The resource location. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The resource location. - * - * @param location the location value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the innerProperties property: Security Solution data. - * - * @return the innerProperties value. - */ - private IoTSecuritySolutionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the workspace property: Workspace resource ID. - * - * @return the workspace value. - */ - public String workspace() { - return this.innerProperties() == null ? null : this.innerProperties().workspace(); - } - - /** - * Set the workspace property: Workspace resource ID. - * - * @param workspace the workspace value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withWorkspace(String workspace) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withWorkspace(workspace); - return this; - } - - /** - * Get the displayName property: Resource display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: Resource display name. - * - * @param displayName the displayName value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the status property: Status of the IoT Security solution. - * - * @return the status value. - */ - public SecuritySolutionStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: Status of the IoT Security solution. - * - * @param status the status value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withStatus(SecuritySolutionStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the export property: List of additional options for exporting to workspace data. - * - * @return the export value. - */ - public List export() { - return this.innerProperties() == null ? null : this.innerProperties().export(); - } - - /** - * Set the export property: List of additional options for exporting to workspace data. - * - * @param export the export value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withExport(List export) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withExport(export); - return this; - } - - /** - * Get the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the system. - * - * @return the disabledDataSources value. - */ - public List disabledDataSources() { - return this.innerProperties() == null ? null : this.innerProperties().disabledDataSources(); - } - - /** - * Set the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the system. - * - * @param disabledDataSources the disabledDataSources value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withDisabledDataSources(List disabledDataSources) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withDisabledDataSources(disabledDataSources); - return this; - } - - /** - * Get the iotHubs property: IoT Hub resource IDs. - * - * @return the iotHubs value. - */ - public List iotHubs() { - return this.innerProperties() == null ? null : this.innerProperties().iotHubs(); - } - - /** - * Set the iotHubs property: IoT Hub resource IDs. - * - * @param iotHubs the iotHubs value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withIotHubs(List iotHubs) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withIotHubs(iotHubs); - return this; - } - - /** - * Get the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @return the userDefinedResources value. - */ - public UserDefinedResourcesProperties userDefinedResources() { - return this.innerProperties() == null ? null : this.innerProperties().userDefinedResources(); - } - - /** - * Set the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @param userDefinedResources the userDefinedResources value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withUserDefinedResources(userDefinedResources); - return this; - } - - /** - * Get the autoDiscoveredResources property: List of resources that were automatically discovered as relevant to the - * security solution. - * - * @return the autoDiscoveredResources value. - */ - public List autoDiscoveredResources() { - return this.innerProperties() == null ? null : this.innerProperties().autoDiscoveredResources(); - } - - /** - * Get the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @return the recommendationsConfiguration value. - */ - public List recommendationsConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().recommendationsConfiguration(); - } - - /** - * Set the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @param recommendationsConfiguration the recommendationsConfiguration value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withRecommendationsConfiguration( - List recommendationsConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withRecommendationsConfiguration(recommendationsConfiguration); - return this; - } - - /** - * Get the unmaskedIpLoggingStatus property: Unmasked IP address logging status. - * - * @return the unmaskedIpLoggingStatus value. - */ - public UnmaskedIpLoggingStatus unmaskedIpLoggingStatus() { - return this.innerProperties() == null ? null : this.innerProperties().unmaskedIpLoggingStatus(); - } - - /** - * Set the unmaskedIpLoggingStatus property: Unmasked IP address logging status. - * - * @param unmaskedIpLoggingStatus the unmaskedIpLoggingStatus value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus unmaskedIpLoggingStatus) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withUnmaskedIpLoggingStatus(unmaskedIpLoggingStatus); - return this; - } - - /** - * Get the additionalWorkspaces property: List of additional workspaces. - * - * @return the additionalWorkspaces value. - */ - public List additionalWorkspaces() { - return this.innerProperties() == null ? null : this.innerProperties().additionalWorkspaces(); - } - - /** - * Set the additionalWorkspaces property: List of additional workspaces. - * - * @param additionalWorkspaces the additionalWorkspaces value to set. - * @return the IoTSecuritySolutionModelInner object itself. - */ - public IoTSecuritySolutionModelInner withAdditionalWorkspaces( - List additionalWorkspaces) { - if (this.innerProperties() == null) { - this.innerProperties = new IoTSecuritySolutionProperties(); - } - this.innerProperties().withAdditionalWorkspaces(additionalWorkspaces); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionProperties.java deleted file mode 100644 index daddad737073..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/IoTSecuritySolutionProperties.java +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.AdditionalWorkspacesProperties; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Security Solution setting data. */ -@Fluent -public final class IoTSecuritySolutionProperties { - /* - * Workspace resource ID - */ - @JsonProperty(value = "workspace") - private String workspace; - - /* - * Resource display name. - */ - @JsonProperty(value = "displayName", required = true) - private String displayName; - - /* - * Status of the IoT Security solution. - */ - @JsonProperty(value = "status") - private SecuritySolutionStatus status; - - /* - * List of additional options for exporting to workspace data. - */ - @JsonProperty(value = "export") - private List export; - - /* - * Disabled data sources. Disabling these data sources compromises the system. - */ - @JsonProperty(value = "disabledDataSources") - private List disabledDataSources; - - /* - * IoT Hub resource IDs - */ - @JsonProperty(value = "iotHubs", required = true) - private List iotHubs; - - /* - * Properties of the IoT Security solution's user defined resources. - */ - @JsonProperty(value = "userDefinedResources") - private UserDefinedResourcesProperties userDefinedResources; - - /* - * List of resources that were automatically discovered as relevant to the security solution. - */ - @JsonProperty(value = "autoDiscoveredResources", access = JsonProperty.Access.WRITE_ONLY) - private List autoDiscoveredResources; - - /* - * List of the configuration status for each recommendation type. - */ - @JsonProperty(value = "recommendationsConfiguration") - private List recommendationsConfiguration; - - /* - * Unmasked IP address logging status - */ - @JsonProperty(value = "unmaskedIpLoggingStatus") - private UnmaskedIpLoggingStatus unmaskedIpLoggingStatus; - - /* - * List of additional workspaces - */ - @JsonProperty(value = "additionalWorkspaces") - private List additionalWorkspaces; - - /** Creates an instance of IoTSecuritySolutionProperties class. */ - public IoTSecuritySolutionProperties() { - } - - /** - * Get the workspace property: Workspace resource ID. - * - * @return the workspace value. - */ - public String workspace() { - return this.workspace; - } - - /** - * Set the workspace property: Workspace resource ID. - * - * @param workspace the workspace value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withWorkspace(String workspace) { - this.workspace = workspace; - return this; - } - - /** - * Get the displayName property: Resource display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: Resource display name. - * - * @param displayName the displayName value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the status property: Status of the IoT Security solution. - * - * @return the status value. - */ - public SecuritySolutionStatus status() { - return this.status; - } - - /** - * Set the status property: Status of the IoT Security solution. - * - * @param status the status value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withStatus(SecuritySolutionStatus status) { - this.status = status; - return this; - } - - /** - * Get the export property: List of additional options for exporting to workspace data. - * - * @return the export value. - */ - public List export() { - return this.export; - } - - /** - * Set the export property: List of additional options for exporting to workspace data. - * - * @param export the export value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withExport(List export) { - this.export = export; - return this; - } - - /** - * Get the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the system. - * - * @return the disabledDataSources value. - */ - public List disabledDataSources() { - return this.disabledDataSources; - } - - /** - * Set the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the system. - * - * @param disabledDataSources the disabledDataSources value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withDisabledDataSources(List disabledDataSources) { - this.disabledDataSources = disabledDataSources; - return this; - } - - /** - * Get the iotHubs property: IoT Hub resource IDs. - * - * @return the iotHubs value. - */ - public List iotHubs() { - return this.iotHubs; - } - - /** - * Set the iotHubs property: IoT Hub resource IDs. - * - * @param iotHubs the iotHubs value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withIotHubs(List iotHubs) { - this.iotHubs = iotHubs; - return this; - } - - /** - * Get the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @return the userDefinedResources value. - */ - public UserDefinedResourcesProperties userDefinedResources() { - return this.userDefinedResources; - } - - /** - * Set the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @param userDefinedResources the userDefinedResources value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources) { - this.userDefinedResources = userDefinedResources; - return this; - } - - /** - * Get the autoDiscoveredResources property: List of resources that were automatically discovered as relevant to the - * security solution. - * - * @return the autoDiscoveredResources value. - */ - public List autoDiscoveredResources() { - return this.autoDiscoveredResources; - } - - /** - * Get the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @return the recommendationsConfiguration value. - */ - public List recommendationsConfiguration() { - return this.recommendationsConfiguration; - } - - /** - * Set the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @param recommendationsConfiguration the recommendationsConfiguration value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withRecommendationsConfiguration( - List recommendationsConfiguration) { - this.recommendationsConfiguration = recommendationsConfiguration; - return this; - } - - /** - * Get the unmaskedIpLoggingStatus property: Unmasked IP address logging status. - * - * @return the unmaskedIpLoggingStatus value. - */ - public UnmaskedIpLoggingStatus unmaskedIpLoggingStatus() { - return this.unmaskedIpLoggingStatus; - } - - /** - * Set the unmaskedIpLoggingStatus property: Unmasked IP address logging status. - * - * @param unmaskedIpLoggingStatus the unmaskedIpLoggingStatus value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus unmaskedIpLoggingStatus) { - this.unmaskedIpLoggingStatus = unmaskedIpLoggingStatus; - return this; - } - - /** - * Get the additionalWorkspaces property: List of additional workspaces. - * - * @return the additionalWorkspaces value. - */ - public List additionalWorkspaces() { - return this.additionalWorkspaces; - } - - /** - * Set the additionalWorkspaces property: List of additional workspaces. - * - * @param additionalWorkspaces the additionalWorkspaces value to set. - * @return the IoTSecuritySolutionProperties object itself. - */ - public IoTSecuritySolutionProperties withAdditionalWorkspaces( - List additionalWorkspaces) { - this.additionalWorkspaces = additionalWorkspaces; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (displayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model IoTSecuritySolutionProperties")); - } - if (iotHubs() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property iotHubs in model IoTSecuritySolutionProperties")); - } - if (userDefinedResources() != null) { - userDefinedResources().validate(); - } - if (recommendationsConfiguration() != null) { - recommendationsConfiguration().forEach(e -> e.validate()); - } - if (additionalWorkspaces() != null) { - additionalWorkspaces().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IoTSecuritySolutionProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyInner.java deleted file mode 100644 index 7b307820330e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyInner.java +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The JitNetworkAccessPolicy model. */ -@Fluent -public final class JitNetworkAccessPolicyInner extends ProxyResource { - /* - * The properties property. - */ - @JsonProperty(value = "properties", required = true) - private JitNetworkAccessPolicyProperties innerProperties = new JitNetworkAccessPolicyProperties(); - - /* - * Kind of the resource - */ - @JsonProperty(value = "kind") - private String kind; - - /* - * Location where the resource is stored - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /** Creates an instance of JitNetworkAccessPolicyInner class. */ - public JitNetworkAccessPolicyInner() { - } - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private JitNetworkAccessPolicyProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the kind property: Kind of the resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of the resource. - * - * @param kind the kind value to set. - * @return the JitNetworkAccessPolicyInner object itself. - */ - public JitNetworkAccessPolicyInner withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.innerProperties() == null ? null : this.innerProperties().virtualMachines(); - } - - /** - * Set the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. - * - * @param virtualMachines the virtualMachines value to set. - * @return the JitNetworkAccessPolicyInner object itself. - */ - public JitNetworkAccessPolicyInner withVirtualMachines(List virtualMachines) { - if (this.innerProperties() == null) { - this.innerProperties = new JitNetworkAccessPolicyProperties(); - } - this.innerProperties().withVirtualMachines(virtualMachines); - return this; - } - - /** - * Get the requests property: The requests property. - * - * @return the requests value. - */ - public List requests() { - return this.innerProperties() == null ? null : this.innerProperties().requests(); - } - - /** - * Set the requests property: The requests property. - * - * @param requests the requests value to set. - * @return the JitNetworkAccessPolicyInner object itself. - */ - public JitNetworkAccessPolicyInner withRequests(List requests) { - if (this.innerProperties() == null) { - this.innerProperties = new JitNetworkAccessPolicyProperties(); - } - this.innerProperties().withRequests(requests); - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the Just-in-Time policy. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model JitNetworkAccessPolicyInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessPolicyInner.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyProperties.java deleted file mode 100644 index 4d120daa9177..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessPolicyProperties.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The JitNetworkAccessPolicyProperties model. */ -@Fluent -public final class JitNetworkAccessPolicyProperties { - /* - * Configurations for Microsoft.Compute/virtualMachines resource type. - */ - @JsonProperty(value = "virtualMachines", required = true) - private List virtualMachines; - - /* - * The requests property. - */ - @JsonProperty(value = "requests") - private List requests; - - /* - * Gets the provisioning state of the Just-in-Time policy. - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private String provisioningState; - - /** Creates an instance of JitNetworkAccessPolicyProperties class. */ - public JitNetworkAccessPolicyProperties() { - } - - /** - * Get the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.virtualMachines; - } - - /** - * Set the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. - * - * @param virtualMachines the virtualMachines value to set. - * @return the JitNetworkAccessPolicyProperties object itself. - */ - public JitNetworkAccessPolicyProperties withVirtualMachines( - List virtualMachines) { - this.virtualMachines = virtualMachines; - return this; - } - - /** - * Get the requests property: The requests property. - * - * @return the requests value. - */ - public List requests() { - return this.requests; - } - - /** - * Set the requests property: The requests property. - * - * @param requests the requests value to set. - * @return the JitNetworkAccessPolicyProperties object itself. - */ - public JitNetworkAccessPolicyProperties withRequests(List requests) { - this.requests = requests; - return this; - } - - /** - * Get the provisioningState property: Gets the provisioning state of the Just-in-Time policy. - * - * @return the provisioningState value. - */ - public String provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualMachines() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property virtualMachines in model JitNetworkAccessPolicyProperties")); - } else { - virtualMachines().forEach(e -> e.validate()); - } - if (requests() != null) { - requests().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessPolicyProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessRequestInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessRequestInner.java deleted file mode 100644 index 6864965bacb3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/JitNetworkAccessRequestInner.java +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestVirtualMachine; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The JitNetworkAccessRequest model. */ -@Fluent -public final class JitNetworkAccessRequestInner { - /* - * The virtualMachines property. - */ - @JsonProperty(value = "virtualMachines", required = true) - private List virtualMachines; - - /* - * The start time of the request in UTC - */ - @JsonProperty(value = "startTimeUtc", required = true) - private OffsetDateTime startTimeUtc; - - /* - * The identity of the person who made the request - */ - @JsonProperty(value = "requestor", required = true) - private String requestor; - - /* - * The justification for making the initiate request - */ - @JsonProperty(value = "justification") - private String justification; - - /** Creates an instance of JitNetworkAccessRequestInner class. */ - public JitNetworkAccessRequestInner() { - } - - /** - * Get the virtualMachines property: The virtualMachines property. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.virtualMachines; - } - - /** - * Set the virtualMachines property: The virtualMachines property. - * - * @param virtualMachines the virtualMachines value to set. - * @return the JitNetworkAccessRequestInner object itself. - */ - public JitNetworkAccessRequestInner withVirtualMachines( - List virtualMachines) { - this.virtualMachines = virtualMachines; - return this; - } - - /** - * Get the startTimeUtc property: The start time of the request in UTC. - * - * @return the startTimeUtc value. - */ - public OffsetDateTime startTimeUtc() { - return this.startTimeUtc; - } - - /** - * Set the startTimeUtc property: The start time of the request in UTC. - * - * @param startTimeUtc the startTimeUtc value to set. - * @return the JitNetworkAccessRequestInner object itself. - */ - public JitNetworkAccessRequestInner withStartTimeUtc(OffsetDateTime startTimeUtc) { - this.startTimeUtc = startTimeUtc; - return this; - } - - /** - * Get the requestor property: The identity of the person who made the request. - * - * @return the requestor value. - */ - public String requestor() { - return this.requestor; - } - - /** - * Set the requestor property: The identity of the person who made the request. - * - * @param requestor the requestor value to set. - * @return the JitNetworkAccessRequestInner object itself. - */ - public JitNetworkAccessRequestInner withRequestor(String requestor) { - this.requestor = requestor; - return this; - } - - /** - * Get the justification property: The justification for making the initiate request. - * - * @return the justification value. - */ - public String justification() { - return this.justification; - } - - /** - * Set the justification property: The justification for making the initiate request. - * - * @param justification the justification value to set. - * @return the JitNetworkAccessRequestInner object itself. - */ - public JitNetworkAccessRequestInner withJustification(String justification) { - this.justification = justification; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualMachines() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property virtualMachines in model JitNetworkAccessRequestInner")); - } else { - virtualMachines().forEach(e -> e.validate()); - } - if (startTimeUtc() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property startTimeUtc in model JitNetworkAccessRequestInner")); - } - if (requestor() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property requestor in model JitNetworkAccessRequestInner")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessRequestInner.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataInner.java deleted file mode 100644 index bd385f7c835d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataInner.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The resource of the configuration or data needed to onboard the machine to MDE. */ -@Fluent -public final class MdeOnboardingDataInner extends ProxyResource { - /* - * Properties of the MDE configuration or data parameter needed to onboard the machine to MDE - */ - @JsonProperty(value = "properties") - private MdeOnboardingDataProperties innerProperties; - - /** Creates an instance of MdeOnboardingDataInner class. */ - public MdeOnboardingDataInner() { - } - - /** - * Get the innerProperties property: Properties of the MDE configuration or data parameter needed to onboard the - * machine to MDE. - * - * @return the innerProperties value. - */ - private MdeOnboardingDataProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the onboardingPackageWindows property: The onboarding package used to onboard Windows machines to MDE, coded - * in base64. This can also be used for onboarding using the dedicated VM Extension. - * - * @return the onboardingPackageWindows value. - */ - public byte[] onboardingPackageWindows() { - return this.innerProperties() == null ? new byte[0] : this.innerProperties().onboardingPackageWindows(); - } - - /** - * Set the onboardingPackageWindows property: The onboarding package used to onboard Windows machines to MDE, coded - * in base64. This can also be used for onboarding using the dedicated VM Extension. - * - * @param onboardingPackageWindows the onboardingPackageWindows value to set. - * @return the MdeOnboardingDataInner object itself. - */ - public MdeOnboardingDataInner withOnboardingPackageWindows(byte[] onboardingPackageWindows) { - if (this.innerProperties() == null) { - this.innerProperties = new MdeOnboardingDataProperties(); - } - this.innerProperties().withOnboardingPackageWindows(onboardingPackageWindows); - return this; - } - - /** - * Get the onboardingPackageLinux property: The onboarding package used to onboard Linux machines to MDE, coded in - * base64. This can also be used for onboarding using the dedicated VM Extension. - * - * @return the onboardingPackageLinux value. - */ - public byte[] onboardingPackageLinux() { - return this.innerProperties() == null ? new byte[0] : this.innerProperties().onboardingPackageLinux(); - } - - /** - * Set the onboardingPackageLinux property: The onboarding package used to onboard Linux machines to MDE, coded in - * base64. This can also be used for onboarding using the dedicated VM Extension. - * - * @param onboardingPackageLinux the onboardingPackageLinux value to set. - * @return the MdeOnboardingDataInner object itself. - */ - public MdeOnboardingDataInner withOnboardingPackageLinux(byte[] onboardingPackageLinux) { - if (this.innerProperties() == null) { - this.innerProperties = new MdeOnboardingDataProperties(); - } - this.innerProperties().withOnboardingPackageLinux(onboardingPackageLinux); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataListInner.java deleted file mode 100644 index b6650c04d95d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataListInner.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.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of all MDE onboarding data resources. */ -@Fluent -public final class MdeOnboardingDataListInner { - /* - * List of the resources of the configuration or data needed to onboard the machine to MDE - */ - @JsonProperty(value = "value") - private List value; - - /** Creates an instance of MdeOnboardingDataListInner class. */ - public MdeOnboardingDataListInner() { - } - - /** - * Get the value property: List of the resources of the configuration or data needed to onboard the machine to MDE. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of the resources of the configuration or data needed to onboard the machine to MDE. - * - * @param value the value value to set. - * @return the MdeOnboardingDataListInner object itself. - */ - public MdeOnboardingDataListInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataProperties.java deleted file mode 100644 index b1bae4df584b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/MdeOnboardingDataProperties.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.CoreUtils; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Properties of the MDE configuration or data parameter needed to onboard the machine to MDE. */ -@Fluent -public final class MdeOnboardingDataProperties { - /* - * The onboarding package used to onboard Windows machines to MDE, coded in base64. This can also be used for - * onboarding using the dedicated VM Extension - */ - @JsonProperty(value = "onboardingPackageWindows") - private byte[] onboardingPackageWindows; - - /* - * The onboarding package used to onboard Linux machines to MDE, coded in base64. This can also be used for - * onboarding using the dedicated VM Extension - */ - @JsonProperty(value = "onboardingPackageLinux") - private byte[] onboardingPackageLinux; - - /** Creates an instance of MdeOnboardingDataProperties class. */ - public MdeOnboardingDataProperties() { - } - - /** - * Get the onboardingPackageWindows property: The onboarding package used to onboard Windows machines to MDE, coded - * in base64. This can also be used for onboarding using the dedicated VM Extension. - * - * @return the onboardingPackageWindows value. - */ - public byte[] onboardingPackageWindows() { - return CoreUtils.clone(this.onboardingPackageWindows); - } - - /** - * Set the onboardingPackageWindows property: The onboarding package used to onboard Windows machines to MDE, coded - * in base64. This can also be used for onboarding using the dedicated VM Extension. - * - * @param onboardingPackageWindows the onboardingPackageWindows value to set. - * @return the MdeOnboardingDataProperties object itself. - */ - public MdeOnboardingDataProperties withOnboardingPackageWindows(byte[] onboardingPackageWindows) { - this.onboardingPackageWindows = CoreUtils.clone(onboardingPackageWindows); - return this; - } - - /** - * Get the onboardingPackageLinux property: The onboarding package used to onboard Linux machines to MDE, coded in - * base64. This can also be used for onboarding using the dedicated VM Extension. - * - * @return the onboardingPackageLinux value. - */ - public byte[] onboardingPackageLinux() { - return CoreUtils.clone(this.onboardingPackageLinux); - } - - /** - * Set the onboardingPackageLinux property: The onboarding package used to onboard Linux machines to MDE, coded in - * base64. This can also be used for onboarding using the dedicated VM Extension. - * - * @param onboardingPackageLinux the onboardingPackageLinux value to set. - * @return the MdeOnboardingDataProperties object itself. - */ - public MdeOnboardingDataProperties withOnboardingPackageLinux(byte[] onboardingPackageLinux) { - this.onboardingPackageLinux = CoreUtils.clone(onboardingPackageLinux); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationInner.java deleted file mode 100644 index e681d61a3dd2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationInner.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Possible operation in the REST API of Microsoft.Security. */ -@Fluent -public final class OperationInner { - /* - * Name of the operation - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Where the operation is originated - */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) - private String origin; - - /* - * Security operation display - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /** Creates an instance of OperationInner class. */ - public OperationInner() { - } - - /** - * Get the name property: Name of the operation. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the origin property: Where the operation is originated. - * - * @return the origin value. - */ - public String origin() { - return this.origin; - } - - /** - * Get the display property: Security operation display. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Security operation display. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.java deleted file mode 100644 index c4ca79253a77..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/OperationResultAutoGeneratedInner.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.security.models.OperationResult; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Long run operation status of governance rule over a given scope. */ -@Immutable -public final class OperationResultAutoGeneratedInner { - /* - * The status of the long run operation result of governance rule - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private OperationResult status; - - /** Creates an instance of OperationResultAutoGeneratedInner class. */ - public OperationResultAutoGeneratedInner() { - } - - /** - * Get the status property: The status of the long run operation result of governance rule. - * - * @return the status value. - */ - public OperationResult status() { - return this.status; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingInner.java deleted file mode 100644 index 99e866421998..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingInner.java +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.Extension; -import com.azure.resourcemanager.security.models.PricingTier; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.List; - -/** - * Microsoft Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced - * security capabilities, while the free tier offers basic security features. - */ -@Fluent -public final class PricingInner extends ProxyResource { - /* - * Pricing data - */ - @JsonProperty(value = "properties") - private PricingProperties innerProperties; - - /** Creates an instance of PricingInner class. */ - public PricingInner() { - } - - /** - * Get the innerProperties property: Pricing data. - * - * @return the innerProperties value. - */ - private PricingProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the pricingTier property: The pricing tier value. Microsoft Defender for Cloud is provided in two pricing - * tiers: free and standard. The standard tier offers advanced security capabilities, while the free tier offers - * basic security features. - * - * @return the pricingTier value. - */ - public PricingTier pricingTier() { - return this.innerProperties() == null ? null : this.innerProperties().pricingTier(); - } - - /** - * Set the pricingTier property: The pricing tier value. Microsoft Defender for Cloud is provided in two pricing - * tiers: free and standard. The standard tier offers advanced security capabilities, while the free tier offers - * basic security features. - * - * @param pricingTier the pricingTier value to set. - * @return the PricingInner object itself. - */ - public PricingInner withPricingTier(PricingTier pricingTier) { - if (this.innerProperties() == null) { - this.innerProperties = new PricingProperties(); - } - this.innerProperties().withPricingTier(pricingTier); - return this; - } - - /** - * Get the subPlan property: The sub-plan selected for a Standard pricing configuration, when more than one sub-plan - * is available. Each sub-plan enables a set of security features. When not specified, full plan is applied. - * - * @return the subPlan value. - */ - public String subPlan() { - return this.innerProperties() == null ? null : this.innerProperties().subPlan(); - } - - /** - * Set the subPlan property: The sub-plan selected for a Standard pricing configuration, when more than one sub-plan - * is available. Each sub-plan enables a set of security features. When not specified, full plan is applied. - * - * @param subPlan the subPlan value to set. - * @return the PricingInner object itself. - */ - public PricingInner withSubPlan(String subPlan) { - if (this.innerProperties() == null) { - this.innerProperties = new PricingProperties(); - } - this.innerProperties().withSubPlan(subPlan); - return this; - } - - /** - * Get the freeTrialRemainingTime property: The duration left for the subscriptions free trial period - in ISO 8601 - * format (e.g. P3Y6M4DT12H30M5S). - * - * @return the freeTrialRemainingTime value. - */ - public Duration freeTrialRemainingTime() { - return this.innerProperties() == null ? null : this.innerProperties().freeTrialRemainingTime(); - } - - /** - * Get the enablementTime property: Optional. If `pricingTier` is `Standard` then this property holds the date of - * the last time the `pricingTier` was set to `Standard`, when available (e.g 2023-03-01T12:42:42.1921106Z). - * - * @return the enablementTime value. - */ - public OffsetDateTime enablementTime() { - return this.innerProperties() == null ? null : this.innerProperties().enablementTime(); - } - - /** - * Get the deprecated property: Optional. True if the plan is deprecated. If there are replacing plans they will - * appear in `replacedBy` property. - * - * @return the deprecated value. - */ - public Boolean deprecated() { - return this.innerProperties() == null ? null : this.innerProperties().deprecated(); - } - - /** - * Get the replacedBy property: Optional. List of plans that replace this plan. This property exists only if this - * plan is deprecated. - * - * @return the replacedBy value. - */ - public List replacedBy() { - return this.innerProperties() == null ? null : this.innerProperties().replacedBy(); - } - - /** - * Get the extensions property: Optional. List of extensions offered under a plan. - * - * @return the extensions value. - */ - public List extensions() { - return this.innerProperties() == null ? null : this.innerProperties().extensions(); - } - - /** - * Set the extensions property: Optional. List of extensions offered under a plan. - * - * @param extensions the extensions value to set. - * @return the PricingInner object itself. - */ - public PricingInner withExtensions(List extensions) { - if (this.innerProperties() == null) { - this.innerProperties = new PricingProperties(); - } - this.innerProperties().withExtensions(extensions); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingListInner.java deleted file mode 100644 index 51b2670b30a2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingListInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of pricing configurations response. */ -@Fluent -public final class PricingListInner { - /* - * List of pricing configurations - */ - @JsonProperty(value = "value", required = true) - private List value; - - /** Creates an instance of PricingListInner class. */ - public PricingListInner() { - } - - /** - * Get the value property: List of pricing configurations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of pricing configurations. - * - * @param value the value value to set. - * @return the PricingListInner object itself. - */ - public PricingListInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model PricingListInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PricingListInner.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingProperties.java deleted file mode 100644 index 681894d02f72..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/PricingProperties.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.Extension; -import com.azure.resourcemanager.security.models.PricingTier; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.List; - -/** Pricing properties for the relevant scope. */ -@Fluent -public final class PricingProperties { - /* - * The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard. The - * standard tier offers advanced security capabilities, while the free tier offers basic security features. - */ - @JsonProperty(value = "pricingTier", required = true) - private PricingTier pricingTier; - - /* - * The sub-plan selected for a Standard pricing configuration, when more than one sub-plan is available. Each - * sub-plan enables a set of security features. When not specified, full plan is applied. - */ - @JsonProperty(value = "subPlan") - private String subPlan; - - /* - * The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). - */ - @JsonProperty(value = "freeTrialRemainingTime", access = JsonProperty.Access.WRITE_ONLY) - private Duration freeTrialRemainingTime; - - /* - * Optional. If `pricingTier` is `Standard` then this property holds the date of the last time the `pricingTier` - * was set to `Standard`, when available (e.g 2023-03-01T12:42:42.1921106Z). - */ - @JsonProperty(value = "enablementTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime enablementTime; - - /* - * Optional. True if the plan is deprecated. If there are replacing plans they will appear in `replacedBy` property - */ - @JsonProperty(value = "deprecated", access = JsonProperty.Access.WRITE_ONLY) - private Boolean deprecated; - - /* - * Optional. List of plans that replace this plan. This property exists only if this plan is deprecated. - */ - @JsonProperty(value = "replacedBy", access = JsonProperty.Access.WRITE_ONLY) - private List replacedBy; - - /* - * Optional. List of extensions offered under a plan. - */ - @JsonProperty(value = "extensions") - private List extensions; - - /** Creates an instance of PricingProperties class. */ - public PricingProperties() { - } - - /** - * Get the pricingTier property: The pricing tier value. Microsoft Defender for Cloud is provided in two pricing - * tiers: free and standard. The standard tier offers advanced security capabilities, while the free tier offers - * basic security features. - * - * @return the pricingTier value. - */ - public PricingTier pricingTier() { - return this.pricingTier; - } - - /** - * Set the pricingTier property: The pricing tier value. Microsoft Defender for Cloud is provided in two pricing - * tiers: free and standard. The standard tier offers advanced security capabilities, while the free tier offers - * basic security features. - * - * @param pricingTier the pricingTier value to set. - * @return the PricingProperties object itself. - */ - public PricingProperties withPricingTier(PricingTier pricingTier) { - this.pricingTier = pricingTier; - return this; - } - - /** - * Get the subPlan property: The sub-plan selected for a Standard pricing configuration, when more than one sub-plan - * is available. Each sub-plan enables a set of security features. When not specified, full plan is applied. - * - * @return the subPlan value. - */ - public String subPlan() { - return this.subPlan; - } - - /** - * Set the subPlan property: The sub-plan selected for a Standard pricing configuration, when more than one sub-plan - * is available. Each sub-plan enables a set of security features. When not specified, full plan is applied. - * - * @param subPlan the subPlan value to set. - * @return the PricingProperties object itself. - */ - public PricingProperties withSubPlan(String subPlan) { - this.subPlan = subPlan; - return this; - } - - /** - * Get the freeTrialRemainingTime property: The duration left for the subscriptions free trial period - in ISO 8601 - * format (e.g. P3Y6M4DT12H30M5S). - * - * @return the freeTrialRemainingTime value. - */ - public Duration freeTrialRemainingTime() { - return this.freeTrialRemainingTime; - } - - /** - * Get the enablementTime property: Optional. If `pricingTier` is `Standard` then this property holds the date of - * the last time the `pricingTier` was set to `Standard`, when available (e.g 2023-03-01T12:42:42.1921106Z). - * - * @return the enablementTime value. - */ - public OffsetDateTime enablementTime() { - return this.enablementTime; - } - - /** - * Get the deprecated property: Optional. True if the plan is deprecated. If there are replacing plans they will - * appear in `replacedBy` property. - * - * @return the deprecated value. - */ - public Boolean deprecated() { - return this.deprecated; - } - - /** - * Get the replacedBy property: Optional. List of plans that replace this plan. This property exists only if this - * plan is deprecated. - * - * @return the replacedBy value. - */ - public List replacedBy() { - return this.replacedBy; - } - - /** - * Get the extensions property: Optional. List of extensions offered under a plan. - * - * @return the extensions value. - */ - public List extensions() { - return this.extensions; - } - - /** - * Set the extensions property: Optional. List of extensions offered under a plan. - * - * @param extensions the extensions value to set. - * @return the PricingProperties object itself. - */ - public PricingProperties withExtensions(List extensions) { - this.extensions = extensions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (pricingTier() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property pricingTier in model PricingProperties")); - } - if (extensions() != null) { - extensions().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(PricingProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentInner.java deleted file mode 100644 index 308a6f823cec..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentInner.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.State; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Regulatory compliance assessment details and state. */ -@Fluent -public final class RegulatoryComplianceAssessmentInner extends ProxyResource { - /* - * Regulatory compliance assessment data - */ - @JsonProperty(value = "properties") - private RegulatoryComplianceAssessmentProperties innerProperties; - - /** Creates an instance of RegulatoryComplianceAssessmentInner class. */ - public RegulatoryComplianceAssessmentInner() { - } - - /** - * Get the innerProperties property: Regulatory compliance assessment data. - * - * @return the innerProperties value. - */ - private RegulatoryComplianceAssessmentProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the description property: The description of the regulatory compliance assessment. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the assessmentType property: The expected type of assessment contained in the AssessmentDetailsLink. - * - * @return the assessmentType value. - */ - public String assessmentType() { - return this.innerProperties() == null ? null : this.innerProperties().assessmentType(); - } - - /** - * Get the assessmentDetailsLink property: Link to more detailed assessment results data. The response type will be - * according to the assessmentType field. - * - * @return the assessmentDetailsLink value. - */ - public String assessmentDetailsLink() { - return this.innerProperties() == null ? null : this.innerProperties().assessmentDetailsLink(); - } - - /** - * Get the state property: Aggregative state based on the assessment's scanned resources states. - * - * @return the state value. - */ - public State state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Aggregative state based on the assessment's scanned resources states. - * - * @param state the state value to set. - * @return the RegulatoryComplianceAssessmentInner object itself. - */ - public RegulatoryComplianceAssessmentInner withState(State state) { - if (this.innerProperties() == null) { - this.innerProperties = new RegulatoryComplianceAssessmentProperties(); - } - this.innerProperties().withState(state); - return this; - } - - /** - * Get the passedResources property: The given assessment's related resources count with passed state. - * - * @return the passedResources value. - */ - public Integer passedResources() { - return this.innerProperties() == null ? null : this.innerProperties().passedResources(); - } - - /** - * Get the failedResources property: The given assessment's related resources count with failed state. - * - * @return the failedResources value. - */ - public Integer failedResources() { - return this.innerProperties() == null ? null : this.innerProperties().failedResources(); - } - - /** - * Get the skippedResources property: The given assessment's related resources count with skipped state. - * - * @return the skippedResources value. - */ - public Integer skippedResources() { - return this.innerProperties() == null ? null : this.innerProperties().skippedResources(); - } - - /** - * Get the unsupportedResources property: The given assessment's related resources count with unsupported state. - * - * @return the unsupportedResources value. - */ - public Integer unsupportedResources() { - return this.innerProperties() == null ? null : this.innerProperties().unsupportedResources(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentProperties.java deleted file mode 100644 index 71a2f73ca151..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceAssessmentProperties.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.State; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Regulatory compliance assessment data. */ -@Fluent -public final class RegulatoryComplianceAssessmentProperties { - /* - * The description of the regulatory compliance assessment - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The expected type of assessment contained in the AssessmentDetailsLink - */ - @JsonProperty(value = "assessmentType", access = JsonProperty.Access.WRITE_ONLY) - private String assessmentType; - - /* - * Link to more detailed assessment results data. The response type will be according to the assessmentType field - */ - @JsonProperty(value = "assessmentDetailsLink", access = JsonProperty.Access.WRITE_ONLY) - private String assessmentDetailsLink; - - /* - * Aggregative state based on the assessment's scanned resources states - */ - @JsonProperty(value = "state") - private State state; - - /* - * The given assessment's related resources count with passed state. - */ - @JsonProperty(value = "passedResources", access = JsonProperty.Access.WRITE_ONLY) - private Integer passedResources; - - /* - * The given assessment's related resources count with failed state. - */ - @JsonProperty(value = "failedResources", access = JsonProperty.Access.WRITE_ONLY) - private Integer failedResources; - - /* - * The given assessment's related resources count with skipped state. - */ - @JsonProperty(value = "skippedResources", access = JsonProperty.Access.WRITE_ONLY) - private Integer skippedResources; - - /* - * The given assessment's related resources count with unsupported state. - */ - @JsonProperty(value = "unsupportedResources", access = JsonProperty.Access.WRITE_ONLY) - private Integer unsupportedResources; - - /** Creates an instance of RegulatoryComplianceAssessmentProperties class. */ - public RegulatoryComplianceAssessmentProperties() { - } - - /** - * Get the description property: The description of the regulatory compliance assessment. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the assessmentType property: The expected type of assessment contained in the AssessmentDetailsLink. - * - * @return the assessmentType value. - */ - public String assessmentType() { - return this.assessmentType; - } - - /** - * Get the assessmentDetailsLink property: Link to more detailed assessment results data. The response type will be - * according to the assessmentType field. - * - * @return the assessmentDetailsLink value. - */ - public String assessmentDetailsLink() { - return this.assessmentDetailsLink; - } - - /** - * Get the state property: Aggregative state based on the assessment's scanned resources states. - * - * @return the state value. - */ - public State state() { - return this.state; - } - - /** - * Set the state property: Aggregative state based on the assessment's scanned resources states. - * - * @param state the state value to set. - * @return the RegulatoryComplianceAssessmentProperties object itself. - */ - public RegulatoryComplianceAssessmentProperties withState(State state) { - this.state = state; - return this; - } - - /** - * Get the passedResources property: The given assessment's related resources count with passed state. - * - * @return the passedResources value. - */ - public Integer passedResources() { - return this.passedResources; - } - - /** - * Get the failedResources property: The given assessment's related resources count with failed state. - * - * @return the failedResources value. - */ - public Integer failedResources() { - return this.failedResources; - } - - /** - * Get the skippedResources property: The given assessment's related resources count with skipped state. - * - * @return the skippedResources value. - */ - public Integer skippedResources() { - return this.skippedResources; - } - - /** - * Get the unsupportedResources property: The given assessment's related resources count with unsupported state. - * - * @return the unsupportedResources value. - */ - public Integer unsupportedResources() { - return this.unsupportedResources; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlInner.java deleted file mode 100644 index 44b3715c5fc6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlInner.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.State; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Regulatory compliance control details and state. */ -@Fluent -public final class RegulatoryComplianceControlInner extends ProxyResource { - /* - * Regulatory compliance control data - */ - @JsonProperty(value = "properties") - private RegulatoryComplianceControlProperties innerProperties; - - /** Creates an instance of RegulatoryComplianceControlInner class. */ - public RegulatoryComplianceControlInner() { - } - - /** - * Get the innerProperties property: Regulatory compliance control data. - * - * @return the innerProperties value. - */ - private RegulatoryComplianceControlProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the description property: The description of the regulatory compliance control. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the state property: Aggregative state based on the control's supported assessments states. - * - * @return the state value. - */ - public State state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Aggregative state based on the control's supported assessments states. - * - * @param state the state value to set. - * @return the RegulatoryComplianceControlInner object itself. - */ - public RegulatoryComplianceControlInner withState(State state) { - if (this.innerProperties() == null) { - this.innerProperties = new RegulatoryComplianceControlProperties(); - } - this.innerProperties().withState(state); - return this; - } - - /** - * Get the passedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a passed state. - * - * @return the passedAssessments value. - */ - public Integer passedAssessments() { - return this.innerProperties() == null ? null : this.innerProperties().passedAssessments(); - } - - /** - * Get the failedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a failed state. - * - * @return the failedAssessments value. - */ - public Integer failedAssessments() { - return this.innerProperties() == null ? null : this.innerProperties().failedAssessments(); - } - - /** - * Get the skippedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a skipped state. - * - * @return the skippedAssessments value. - */ - public Integer skippedAssessments() { - return this.innerProperties() == null ? null : this.innerProperties().skippedAssessments(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlProperties.java deleted file mode 100644 index fc016649b89a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceControlProperties.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.State; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Regulatory compliance control data. */ -@Fluent -public final class RegulatoryComplianceControlProperties { - /* - * The description of the regulatory compliance control - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * Aggregative state based on the control's supported assessments states - */ - @JsonProperty(value = "state") - private State state; - - /* - * The number of supported regulatory compliance assessments of the given control with a passed state - */ - @JsonProperty(value = "passedAssessments", access = JsonProperty.Access.WRITE_ONLY) - private Integer passedAssessments; - - /* - * The number of supported regulatory compliance assessments of the given control with a failed state - */ - @JsonProperty(value = "failedAssessments", access = JsonProperty.Access.WRITE_ONLY) - private Integer failedAssessments; - - /* - * The number of supported regulatory compliance assessments of the given control with a skipped state - */ - @JsonProperty(value = "skippedAssessments", access = JsonProperty.Access.WRITE_ONLY) - private Integer skippedAssessments; - - /** Creates an instance of RegulatoryComplianceControlProperties class. */ - public RegulatoryComplianceControlProperties() { - } - - /** - * Get the description property: The description of the regulatory compliance control. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the state property: Aggregative state based on the control's supported assessments states. - * - * @return the state value. - */ - public State state() { - return this.state; - } - - /** - * Set the state property: Aggregative state based on the control's supported assessments states. - * - * @param state the state value to set. - * @return the RegulatoryComplianceControlProperties object itself. - */ - public RegulatoryComplianceControlProperties withState(State state) { - this.state = state; - return this; - } - - /** - * Get the passedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a passed state. - * - * @return the passedAssessments value. - */ - public Integer passedAssessments() { - return this.passedAssessments; - } - - /** - * Get the failedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a failed state. - * - * @return the failedAssessments value. - */ - public Integer failedAssessments() { - return this.failedAssessments; - } - - /** - * Get the skippedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a skipped state. - * - * @return the skippedAssessments value. - */ - public Integer skippedAssessments() { - return this.skippedAssessments; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardInner.java deleted file mode 100644 index 462389336ec0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardInner.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.State; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Regulatory compliance standard details and state. */ -@Fluent -public final class RegulatoryComplianceStandardInner extends ProxyResource { - /* - * Regulatory compliance standard data - */ - @JsonProperty(value = "properties") - private RegulatoryComplianceStandardProperties innerProperties; - - /** Creates an instance of RegulatoryComplianceStandardInner class. */ - public RegulatoryComplianceStandardInner() { - } - - /** - * Get the innerProperties property: Regulatory compliance standard data. - * - * @return the innerProperties value. - */ - private RegulatoryComplianceStandardProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the state property: Aggregative state based on the standard's supported controls states. - * - * @return the state value. - */ - public State state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Set the state property: Aggregative state based on the standard's supported controls states. - * - * @param state the state value to set. - * @return the RegulatoryComplianceStandardInner object itself. - */ - public RegulatoryComplianceStandardInner withState(State state) { - if (this.innerProperties() == null) { - this.innerProperties = new RegulatoryComplianceStandardProperties(); - } - this.innerProperties().withState(state); - return this; - } - - /** - * Get the passedControls property: The number of supported regulatory compliance controls of the given standard - * with a passed state. - * - * @return the passedControls value. - */ - public Integer passedControls() { - return this.innerProperties() == null ? null : this.innerProperties().passedControls(); - } - - /** - * Get the failedControls property: The number of supported regulatory compliance controls of the given standard - * with a failed state. - * - * @return the failedControls value. - */ - public Integer failedControls() { - return this.innerProperties() == null ? null : this.innerProperties().failedControls(); - } - - /** - * Get the skippedControls property: The number of supported regulatory compliance controls of the given standard - * with a skipped state. - * - * @return the skippedControls value. - */ - public Integer skippedControls() { - return this.innerProperties() == null ? null : this.innerProperties().skippedControls(); - } - - /** - * Get the unsupportedControls property: The number of regulatory compliance controls of the given standard which - * are unsupported by automated assessments. - * - * @return the unsupportedControls value. - */ - public Integer unsupportedControls() { - return this.innerProperties() == null ? null : this.innerProperties().unsupportedControls(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardProperties.java deleted file mode 100644 index a70b722ae82f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RegulatoryComplianceStandardProperties.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.State; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Regulatory compliance standard data. */ -@Fluent -public final class RegulatoryComplianceStandardProperties { - /* - * Aggregative state based on the standard's supported controls states - */ - @JsonProperty(value = "state") - private State state; - - /* - * The number of supported regulatory compliance controls of the given standard with a passed state - */ - @JsonProperty(value = "passedControls", access = JsonProperty.Access.WRITE_ONLY) - private Integer passedControls; - - /* - * The number of supported regulatory compliance controls of the given standard with a failed state - */ - @JsonProperty(value = "failedControls", access = JsonProperty.Access.WRITE_ONLY) - private Integer failedControls; - - /* - * The number of supported regulatory compliance controls of the given standard with a skipped state - */ - @JsonProperty(value = "skippedControls", access = JsonProperty.Access.WRITE_ONLY) - private Integer skippedControls; - - /* - * The number of regulatory compliance controls of the given standard which are unsupported by automated - * assessments - */ - @JsonProperty(value = "unsupportedControls", access = JsonProperty.Access.WRITE_ONLY) - private Integer unsupportedControls; - - /** Creates an instance of RegulatoryComplianceStandardProperties class. */ - public RegulatoryComplianceStandardProperties() { - } - - /** - * Get the state property: Aggregative state based on the standard's supported controls states. - * - * @return the state value. - */ - public State state() { - return this.state; - } - - /** - * Set the state property: Aggregative state based on the standard's supported controls states. - * - * @param state the state value to set. - * @return the RegulatoryComplianceStandardProperties object itself. - */ - public RegulatoryComplianceStandardProperties withState(State state) { - this.state = state; - return this; - } - - /** - * Get the passedControls property: The number of supported regulatory compliance controls of the given standard - * with a passed state. - * - * @return the passedControls value. - */ - public Integer passedControls() { - return this.passedControls; - } - - /** - * Get the failedControls property: The number of supported regulatory compliance controls of the given standard - * with a failed state. - * - * @return the failedControls value. - */ - public Integer failedControls() { - return this.failedControls; - } - - /** - * Get the skippedControls property: The number of supported regulatory compliance controls of the given standard - * with a skipped state. - * - * @return the skippedControls value. - */ - public Integer skippedControls() { - return this.skippedControls; - } - - /** - * Get the unsupportedControls property: The number of regulatory compliance controls of the given standard which - * are unsupported by automated assessments. - * - * @return the unsupportedControls value. - */ - public Integer unsupportedControls() { - return this.unsupportedControls; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RuleResultsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RuleResultsInner.java deleted file mode 100644 index 2737512d5442..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RuleResultsInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.RuleResultsProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Rule results. */ -@Fluent -public final class RuleResultsInner extends ProxyResource { - /* - * Rule results properties. - */ - @JsonProperty(value = "properties") - private RuleResultsProperties properties; - - /** Creates an instance of RuleResultsInner class. */ - public RuleResultsInner() { - } - - /** - * Get the properties property: Rule results properties. - * - * @return the properties value. - */ - public RuleResultsProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Rule results properties. - * - * @param properties the properties value to set. - * @return the RuleResultsInner object itself. - */ - public RuleResultsInner withProperties(RuleResultsProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RulesResultsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RulesResultsInner.java deleted file mode 100644 index 2463dd2b01fa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/RulesResultsInner.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.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of rules results. */ -@Fluent -public final class RulesResultsInner { - /* - * List of rule results. - */ - @JsonProperty(value = "value") - private List value; - - /** Creates an instance of RulesResultsInner class. */ - public RulesResultsInner() { - } - - /** - * Get the value property: List of rule results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of rule results. - * - * @param value the value value to set. - * @return the RulesResultsInner object itself. - */ - public RulesResultsInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanInner.java deleted file mode 100644 index 55dba8acba1d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.ScanProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A vulnerability assessment scan record. */ -@Fluent -public final class ScanInner extends ProxyResource { - /* - * A vulnerability assessment scan record properties. - */ - @JsonProperty(value = "properties") - private ScanProperties properties; - - /** Creates an instance of ScanInner class. */ - public ScanInner() { - } - - /** - * Get the properties property: A vulnerability assessment scan record properties. - * - * @return the properties value. - */ - public ScanProperties properties() { - return this.properties; - } - - /** - * Set the properties property: A vulnerability assessment scan record properties. - * - * @param properties the properties value to set. - * @return the ScanInner object itself. - */ - public ScanInner withProperties(ScanProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultInner.java deleted file mode 100644 index 2878009933cd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.ScanResultProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A vulnerability assessment scan result for a single rule. */ -@Fluent -public final class ScanResultInner extends ProxyResource { - /* - * A vulnerability assessment scan result properties for a single rule. - */ - @JsonProperty(value = "properties") - private ScanResultProperties properties; - - /** Creates an instance of ScanResultInner class. */ - public ScanResultInner() { - } - - /** - * Get the properties property: A vulnerability assessment scan result properties for a single rule. - * - * @return the properties value. - */ - public ScanResultProperties properties() { - return this.properties; - } - - /** - * Set the properties property: A vulnerability assessment scan result properties for a single rule. - * - * @param properties the properties value to set. - * @return the ScanResultInner object itself. - */ - public ScanResultInner withProperties(ScanResultProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultsInner.java deleted file mode 100644 index 5a1807b5830c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScanResultsInner.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.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of vulnerability assessment scan results. */ -@Fluent -public final class ScanResultsInner { - /* - * List of vulnerability assessment scan results. - */ - @JsonProperty(value = "value") - private List value; - - /** Creates an instance of ScanResultsInner class. */ - public ScanResultsInner() { - } - - /** - * Get the value property: List of vulnerability assessment scan results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of vulnerability assessment scan results. - * - * @param value the value value to set. - * @return the ScanResultsInner object itself. - */ - public ScanResultsInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScansInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScansInner.java deleted file mode 100644 index 18b1d47cef6a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScansInner.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.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of vulnerability assessment scan records. */ -@Fluent -public final class ScansInner { - /* - * List of vulnerability assessment scan records. - */ - @JsonProperty(value = "value") - private List value; - - /** Creates an instance of ScansInner class. */ - public ScansInner() { - } - - /** - * Get the value property: List of vulnerability assessment scan records. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of vulnerability assessment scan records. - * - * @param value the value value to set. - * @return the ScansInner object itself. - */ - public ScansInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScoreDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScoreDetails.java deleted file mode 100644 index 86bc7f839e8f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ScoreDetails.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Calculation result data. */ -@Immutable -public final class ScoreDetails { - /* - * Maximum score available - */ - @JsonProperty(value = "max", access = JsonProperty.Access.WRITE_ONLY) - private Integer max; - - /* - * Current score - */ - @JsonProperty(value = "current", access = JsonProperty.Access.WRITE_ONLY) - private Double current; - - /* - * Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point - */ - @JsonProperty(value = "percentage", access = JsonProperty.Access.WRITE_ONLY) - private Double percentage; - - /** Creates an instance of ScoreDetails class. */ - public ScoreDetails() { - } - - /** - * Get the max property: Maximum score available. - * - * @return the max value. - */ - public Integer max() { - return this.max; - } - - /** - * Get the current property: Current score. - * - * @return the current value. - */ - public Double current() { - return this.current; - } - - /** - * Get the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the - * decimal point. - * - * @return the percentage value. - */ - public Double percentage() { - return this.percentage; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemInner.java deleted file mode 100644 index 01753634ece2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemInner.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.AzureResourceLink; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionSource; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Information about the security control. */ -@Immutable -public final class SecureScoreControlDefinitionItemInner extends ProxyResource { - /* - * Security Control Definition Properties. - */ - @JsonProperty(value = "properties") - private SecureScoreControlDefinitionItemProperties innerProperties; - - /** Creates an instance of SecureScoreControlDefinitionItemInner class. */ - public SecureScoreControlDefinitionItemInner() { - } - - /** - * Get the innerProperties property: Security Control Definition Properties. - * - * @return the innerProperties value. - */ - private SecureScoreControlDefinitionItemProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the displayName property: User friendly display name of the control. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the description property: User friendly description of the control. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the maxScore property: Maximum control score (0..10). - * - * @return the maxScore value. - */ - public Integer maxScore() { - return this.innerProperties() == null ? null : this.innerProperties().maxScore(); - } - - /** - * Get the source property: Source object from which the control was created. - * - * @return the source value. - */ - public SecureScoreControlDefinitionSource source() { - return this.innerProperties() == null ? null : this.innerProperties().source(); - } - - /** - * Get the assessmentDefinitions property: Array of assessments metadata IDs that are included in this security - * control. - * - * @return the assessmentDefinitions value. - */ - public List assessmentDefinitions() { - return this.innerProperties() == null ? null : this.innerProperties().assessmentDefinitions(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemProperties.java deleted file mode 100644 index 85b8e148b797..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDefinitionItemProperties.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.security.models.AzureResourceLink; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionSource; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Security Control Definition Properties. */ -@Immutable -public final class SecureScoreControlDefinitionItemProperties { - /* - * User friendly display name of the control - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * User friendly description of the control - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * Maximum control score (0..10) - */ - @JsonProperty(value = "maxScore", access = JsonProperty.Access.WRITE_ONLY) - private Integer maxScore; - - /* - * Source object from which the control was created - */ - @JsonProperty(value = "source", access = JsonProperty.Access.WRITE_ONLY) - private SecureScoreControlDefinitionSource source; - - /* - * Array of assessments metadata IDs that are included in this security control - */ - @JsonProperty(value = "assessmentDefinitions", access = JsonProperty.Access.WRITE_ONLY) - private List assessmentDefinitions; - - /** Creates an instance of SecureScoreControlDefinitionItemProperties class. */ - public SecureScoreControlDefinitionItemProperties() { - } - - /** - * Get the displayName property: User friendly display name of the control. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the description property: User friendly description of the control. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the maxScore property: Maximum control score (0..10). - * - * @return the maxScore value. - */ - public Integer maxScore() { - return this.maxScore; - } - - /** - * Get the source property: Source object from which the control was created. - * - * @return the source value. - */ - public SecureScoreControlDefinitionSource source() { - return this.source; - } - - /** - * Get the assessmentDefinitions property: Array of assessments metadata IDs that are included in this security - * control. - * - * @return the assessmentDefinitions value. - */ - public List assessmentDefinitions() { - return this.assessmentDefinitions; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (source() != null) { - source().validate(); - } - if (assessmentDefinitions() != null) { - assessmentDefinitions().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDetailsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDetailsInner.java deleted file mode 100644 index bb6d92135d58..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlDetailsInner.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Details of the security control, its score, and the health status of the relevant resources. */ -@Fluent -public final class SecureScoreControlDetailsInner extends ProxyResource { - /* - * Calculation result data in control level - */ - @JsonProperty(value = "properties") - private SecureScoreControlScoreDetailsInner innerProperties; - - /** Creates an instance of SecureScoreControlDetailsInner class. */ - public SecureScoreControlDetailsInner() { - } - - /** - * Get the innerProperties property: Calculation result data in control level. - * - * @return the innerProperties value. - */ - private SecureScoreControlScoreDetailsInner innerProperties() { - return this.innerProperties; - } - - /** - * Get the displayName property: User friendly display name of the control. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the healthyResourceCount property: Number of healthy resources in the control. - * - * @return the healthyResourceCount value. - */ - public Integer healthyResourceCount() { - return this.innerProperties() == null ? null : this.innerProperties().healthyResourceCount(); - } - - /** - * Get the unhealthyResourceCount property: Number of unhealthy resources in the control. - * - * @return the unhealthyResourceCount value. - */ - public Integer unhealthyResourceCount() { - return this.innerProperties() == null ? null : this.innerProperties().unhealthyResourceCount(); - } - - /** - * Get the notApplicableResourceCount property: Number of not applicable resources in the control. - * - * @return the notApplicableResourceCount value. - */ - public Integer notApplicableResourceCount() { - return this.innerProperties() == null ? null : this.innerProperties().notApplicableResourceCount(); - } - - /** - * Get the weight property: The relative weight for this specific control in each of your subscriptions. Used when - * calculating an aggregated score for this control across all of your subscriptions. - * - * @return the weight value. - */ - public Long weight() { - return this.innerProperties() == null ? null : this.innerProperties().weight(); - } - - /** - * Get the definition property: Information about the security control. - * - * @return the definition value. - */ - public SecureScoreControlDefinitionItemInner definition() { - return this.innerProperties() == null ? null : this.innerProperties().definition(); - } - - /** - * Set the definition property: Information about the security control. - * - * @param definition the definition value to set. - * @return the SecureScoreControlDetailsInner object itself. - */ - public SecureScoreControlDetailsInner withDefinition(SecureScoreControlDefinitionItemInner definition) { - if (this.innerProperties() == null) { - this.innerProperties = new SecureScoreControlScoreDetailsInner(); - } - this.innerProperties().withDefinition(definition); - return this; - } - - /** - * Get the max property: Maximum score available. - * - * @return the max value. - */ - public Integer max() { - return this.innerProperties() == null ? null : this.innerProperties().max(); - } - - /** - * Get the current property: Current score. - * - * @return the current value. - */ - public Double current() { - return this.innerProperties() == null ? null : this.innerProperties().current(); - } - - /** - * Get the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the - * decimal point. - * - * @return the percentage value. - */ - public Double percentage() { - return this.innerProperties() == null ? null : this.innerProperties().percentage(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlScoreDetailsInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlScoreDetailsInner.java deleted file mode 100644 index 2b4dc29cf1f4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreControlScoreDetailsInner.java +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Calculation result data in control level. */ -@Fluent -public final class SecureScoreControlScoreDetailsInner { - /* - * User friendly display name of the control - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * Actual score object for the control - */ - @JsonProperty(value = "score", access = JsonProperty.Access.WRITE_ONLY) - private ScoreDetails innerScore; - - /* - * Number of healthy resources in the control - */ - @JsonProperty(value = "healthyResourceCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer healthyResourceCount; - - /* - * Number of unhealthy resources in the control - */ - @JsonProperty(value = "unhealthyResourceCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer unhealthyResourceCount; - - /* - * Number of not applicable resources in the control - */ - @JsonProperty(value = "notApplicableResourceCount", access = JsonProperty.Access.WRITE_ONLY) - private Integer notApplicableResourceCount; - - /* - * The relative weight for this specific control in each of your subscriptions. Used when calculating an aggregated - * score for this control across all of your subscriptions. - */ - @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) - private Long weight; - - /* - * Information about the security control. - */ - @JsonProperty(value = "definition") - private SecureScoreControlDefinitionItemInner definition; - - /** Creates an instance of SecureScoreControlScoreDetailsInner class. */ - public SecureScoreControlScoreDetailsInner() { - } - - /** - * Get the displayName property: User friendly display name of the control. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the innerScore property: Actual score object for the control. - * - * @return the innerScore value. - */ - private ScoreDetails innerScore() { - return this.innerScore; - } - - /** - * Get the healthyResourceCount property: Number of healthy resources in the control. - * - * @return the healthyResourceCount value. - */ - public Integer healthyResourceCount() { - return this.healthyResourceCount; - } - - /** - * Get the unhealthyResourceCount property: Number of unhealthy resources in the control. - * - * @return the unhealthyResourceCount value. - */ - public Integer unhealthyResourceCount() { - return this.unhealthyResourceCount; - } - - /** - * Get the notApplicableResourceCount property: Number of not applicable resources in the control. - * - * @return the notApplicableResourceCount value. - */ - public Integer notApplicableResourceCount() { - return this.notApplicableResourceCount; - } - - /** - * Get the weight property: The relative weight for this specific control in each of your subscriptions. Used when - * calculating an aggregated score for this control across all of your subscriptions. - * - * @return the weight value. - */ - public Long weight() { - return this.weight; - } - - /** - * Get the definition property: Information about the security control. - * - * @return the definition value. - */ - public SecureScoreControlDefinitionItemInner definition() { - return this.definition; - } - - /** - * Set the definition property: Information about the security control. - * - * @param definition the definition value to set. - * @return the SecureScoreControlScoreDetailsInner object itself. - */ - public SecureScoreControlScoreDetailsInner withDefinition(SecureScoreControlDefinitionItemInner definition) { - this.definition = definition; - return this; - } - - /** - * Get the max property: Maximum score available. - * - * @return the max value. - */ - public Integer max() { - return this.innerScore() == null ? null : this.innerScore().max(); - } - - /** - * Get the current property: Current score. - * - * @return the current value. - */ - public Double current() { - return this.innerScore() == null ? null : this.innerScore().current(); - } - - /** - * Get the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the - * decimal point. - * - * @return the percentage value. - */ - public Double percentage() { - return this.innerScore() == null ? null : this.innerScore().percentage(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerScore() != null) { - innerScore().validate(); - } - if (definition() != null) { - definition().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemInner.java deleted file mode 100644 index c0a9ae516455..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemInner.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Secure score item data model. */ -@Immutable -public final class SecureScoreItemInner extends ProxyResource { - /* - * Secure score item - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private SecureScoreItemProperties innerProperties; - - /** Creates an instance of SecureScoreItemInner class. */ - public SecureScoreItemInner() { - } - - /** - * Get the innerProperties property: Secure score item. - * - * @return the innerProperties value. - */ - private SecureScoreItemProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the displayName property: The initiative’s name. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the weight property: The relative weight for each subscription. Used when calculating an aggregated secure - * score for multiple subscriptions. - * - * @return the weight value. - */ - public Long weight() { - return this.innerProperties() == null ? null : this.innerProperties().weight(); - } - - /** - * Get the max property: Maximum score available. - * - * @return the max value. - */ - public Integer max() { - return this.innerProperties() == null ? null : this.innerProperties().max(); - } - - /** - * Get the current property: Current score. - * - * @return the current value. - */ - public Double current() { - return this.innerProperties() == null ? null : this.innerProperties().current(); - } - - /** - * Get the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the - * decimal point. - * - * @return the percentage value. - */ - public Double percentage() { - return this.innerProperties() == null ? null : this.innerProperties().percentage(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemProperties.java deleted file mode 100644 index 889361f4149e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecureScoreItemProperties.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes properties of a calculated secure score. */ -@Immutable -public final class SecureScoreItemProperties { - /* - * The initiative’s name - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * score object - */ - @JsonProperty(value = "score", access = JsonProperty.Access.WRITE_ONLY) - private ScoreDetails innerScore; - - /* - * The relative weight for each subscription. Used when calculating an aggregated secure score for multiple - * subscriptions. - */ - @JsonProperty(value = "weight", access = JsonProperty.Access.WRITE_ONLY) - private Long weight; - - /** Creates an instance of SecureScoreItemProperties class. */ - public SecureScoreItemProperties() { - } - - /** - * Get the displayName property: The initiative’s name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the innerScore property: score object. - * - * @return the innerScore value. - */ - private ScoreDetails innerScore() { - return this.innerScore; - } - - /** - * Get the weight property: The relative weight for each subscription. Used when calculating an aggregated secure - * score for multiple subscriptions. - * - * @return the weight value. - */ - public Long weight() { - return this.weight; - } - - /** - * Get the max property: Maximum score available. - * - * @return the max value. - */ - public Integer max() { - return this.innerScore() == null ? null : this.innerScore().max(); - } - - /** - * Get the current property: Current score. - * - * @return the current value. - */ - public Double current() { - return this.innerScore() == null ? null : this.innerScore().current(); - } - - /** - * Get the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the - * decimal point. - * - * @return the percentage value. - */ - public Double percentage() { - return this.innerScore() == null ? null : this.innerScore().percentage(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerScore() != null) { - innerScore().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataProperties.java deleted file mode 100644 index d2452d561791..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataProperties.java +++ /dev/null @@ -1,363 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.AssessmentType; -import com.azure.resourcemanager.security.models.Categories; -import com.azure.resourcemanager.security.models.ImplementationEffort; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData; -import com.azure.resourcemanager.security.models.Severity; -import com.azure.resourcemanager.security.models.Threats; -import com.azure.resourcemanager.security.models.UserImpact; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes properties of an assessment metadata. */ -@Fluent -public class SecurityAssessmentMetadataProperties { - /* - * User friendly display name of the assessment - */ - @JsonProperty(value = "displayName", required = true) - private String displayName; - - /* - * Azure resource ID of the policy definition that turns this assessment calculation on - */ - @JsonProperty(value = "policyDefinitionId", access = JsonProperty.Access.WRITE_ONLY) - private String policyDefinitionId; - - /* - * Human readable description of the assessment - */ - @JsonProperty(value = "description") - private String description; - - /* - * Human readable description of what you should do to mitigate this security issue - */ - @JsonProperty(value = "remediationDescription") - private String remediationDescription; - - /* - * The categories property. - */ - @JsonProperty(value = "categories") - private List categories; - - /* - * The severity level of the assessment - */ - @JsonProperty(value = "severity", required = true) - private Severity severity; - - /* - * The user impact of the assessment - */ - @JsonProperty(value = "userImpact") - private UserImpact userImpact; - - /* - * The implementation effort required to remediate this assessment - */ - @JsonProperty(value = "implementationEffort") - private ImplementationEffort implementationEffort; - - /* - * The threats property. - */ - @JsonProperty(value = "threats") - private List threats; - - /* - * True if this assessment is in preview release status - */ - @JsonProperty(value = "preview") - private Boolean preview; - - /* - * BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom - * Azure Policy definition - */ - @JsonProperty(value = "assessmentType", required = true) - private AssessmentType assessmentType; - - /* - * Describes the partner that created the assessment - */ - @JsonProperty(value = "partnerData") - private SecurityAssessmentMetadataPartnerData partnerData; - - /** Creates an instance of SecurityAssessmentMetadataProperties class. */ - public SecurityAssessmentMetadataProperties() { - } - - /** - * Get the displayName property: User friendly display name of the assessment. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: User friendly display name of the assessment. - * - * @param displayName the displayName value to set. - * @return the SecurityAssessmentMetadataProperties object itself. - */ - public SecurityAssessmentMetadataProperties withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the policyDefinitionId property: Azure resource ID of the policy definition that turns this assessment - * calculation on. - * - * @return the policyDefinitionId value. - */ - public String policyDefinitionId() { - return this.policyDefinitionId; - } - - /** - * Get the description property: Human readable description of the assessment. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Human readable description of the assessment. - * - * @param description the description value to set. - * @return the SecurityAssessmentMetadataProperties object itself. - */ - public SecurityAssessmentMetadataProperties withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the remediationDescription property: Human readable description of what you should do to mitigate this - * security issue. - * - * @return the remediationDescription value. - */ - public String remediationDescription() { - return this.remediationDescription; - } - - /** - * Set the remediationDescription property: Human readable description of what you should do to mitigate this - * security issue. - * - * @param remediationDescription the remediationDescription value to set. - * @return the SecurityAssessmentMetadataProperties object itself. - */ - public SecurityAssessmentMetadataProperties withRemediationDescription(String remediationDescription) { - this.remediationDescription = remediationDescription; - return this; - } - - /** - * Get the categories property: The categories property. - * - * @return the categories value. - */ - public List categories() { - return this.categories; - } - - /** - * Set the categories property: The categories property. - * - * @param categories the categories value to set. - * @return the SecurityAssessmentMetadataProperties object itself. - */ - public SecurityAssessmentMetadataProperties withCategories(List categories) { - this.categories = categories; - return this; - } - - /** - * Get the severity property: The severity level of the assessment. - * - * @return the severity value. - */ - public Severity severity() { - return this.severity; - } - - /** - * Set the severity property: The severity level of the assessment. - * - * @param severity the severity value to set. - * @return the SecurityAssessmentMetadataProperties object itself. - */ - public SecurityAssessmentMetadataProperties withSeverity(Severity severity) { - this.severity = severity; - return this; - } - - /** - * Get the userImpact property: The user impact of the assessment. - * - * @return the userImpact value. - */ - public UserImpact userImpact() { - return this.userImpact; - } - - /** - * Set the userImpact property: The user impact of the assessment. - * - * @param userImpact the userImpact value to set. - * @return the SecurityAssessmentMetadataProperties object itself. - */ - public SecurityAssessmentMetadataProperties withUserImpact(UserImpact userImpact) { - this.userImpact = userImpact; - return this; - } - - /** - * Get the implementationEffort property: The implementation effort required to remediate this assessment. - * - * @return the implementationEffort value. - */ - public ImplementationEffort implementationEffort() { - return this.implementationEffort; - } - - /** - * Set the implementationEffort property: The implementation effort required to remediate this assessment. - * - * @param implementationEffort the implementationEffort value to set. - * @return the SecurityAssessmentMetadataProperties object itself. - */ - public SecurityAssessmentMetadataProperties withImplementationEffort(ImplementationEffort implementationEffort) { - this.implementationEffort = implementationEffort; - return this; - } - - /** - * Get the threats property: The threats property. - * - * @return the threats value. - */ - public List threats() { - return this.threats; - } - - /** - * Set the threats property: The threats property. - * - * @param threats the threats value to set. - * @return the SecurityAssessmentMetadataProperties object itself. - */ - public SecurityAssessmentMetadataProperties withThreats(List threats) { - this.threats = threats; - return this; - } - - /** - * Get the preview property: True if this assessment is in preview release status. - * - * @return the preview value. - */ - public Boolean preview() { - return this.preview; - } - - /** - * Set the preview property: True if this assessment is in preview release status. - * - * @param preview the preview value to set. - * @return the SecurityAssessmentMetadataProperties object itself. - */ - public SecurityAssessmentMetadataProperties withPreview(Boolean preview) { - this.preview = preview; - return this; - } - - /** - * Get the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy definition, Custom if - * the assessment based on custom Azure Policy definition. - * - * @return the assessmentType value. - */ - public AssessmentType assessmentType() { - return this.assessmentType; - } - - /** - * Set the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy definition, Custom if - * the assessment based on custom Azure Policy definition. - * - * @param assessmentType the assessmentType value to set. - * @return the SecurityAssessmentMetadataProperties object itself. - */ - public SecurityAssessmentMetadataProperties withAssessmentType(AssessmentType assessmentType) { - this.assessmentType = assessmentType; - return this; - } - - /** - * Get the partnerData property: Describes the partner that created the assessment. - * - * @return the partnerData value. - */ - public SecurityAssessmentMetadataPartnerData partnerData() { - return this.partnerData; - } - - /** - * Set the partnerData property: Describes the partner that created the assessment. - * - * @param partnerData the partnerData value to set. - * @return the SecurityAssessmentMetadataProperties object itself. - */ - public SecurityAssessmentMetadataProperties withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { - this.partnerData = partnerData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (displayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property displayName in model SecurityAssessmentMetadataProperties")); - } - if (severity() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property severity in model SecurityAssessmentMetadataProperties")); - } - if (assessmentType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property assessmentType in model SecurityAssessmentMetadataProperties")); - } - if (partnerData() != null) { - partnerData().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityAssessmentMetadataProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataPropertiesResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataPropertiesResponse.java deleted file mode 100644 index eb080f0c54c3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataPropertiesResponse.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.AssessmentType; -import com.azure.resourcemanager.security.models.Categories; -import com.azure.resourcemanager.security.models.ImplementationEffort; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates; -import com.azure.resourcemanager.security.models.Severity; -import com.azure.resourcemanager.security.models.Tactics; -import com.azure.resourcemanager.security.models.Techniques; -import com.azure.resourcemanager.security.models.Threats; -import com.azure.resourcemanager.security.models.UserImpact; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes properties of an assessment metadata response. */ -@Fluent -public final class SecurityAssessmentMetadataPropertiesResponse extends SecurityAssessmentMetadataProperties { - /* - * 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; - - /** Creates an instance of SecurityAssessmentMetadataPropertiesResponse class. */ - public SecurityAssessmentMetadataPropertiesResponse() { - } - - /** - * Get the publishDates property: The publishDates property. - * - * @return the publishDates value. - */ - public SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() { - return this.publishDates; - } - - /** - * Set the publishDates property: The publishDates property. - * - * @param publishDates the publishDates value to set. - * @return the SecurityAssessmentMetadataPropertiesResponse object itself. - */ - public SecurityAssessmentMetadataPropertiesResponse withPublishDates( - SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { - this.publishDates = publishDates; - return this; - } - - /** - * Get the plannedDeprecationDate property: The plannedDeprecationDate property. - * - * @return the plannedDeprecationDate value. - */ - public String plannedDeprecationDate() { - return this.plannedDeprecationDate; - } - - /** - * Set the plannedDeprecationDate property: The plannedDeprecationDate property. - * - * @param plannedDeprecationDate the plannedDeprecationDate value to set. - * @return the SecurityAssessmentMetadataPropertiesResponse object itself. - */ - public SecurityAssessmentMetadataPropertiesResponse withPlannedDeprecationDate(String plannedDeprecationDate) { - this.plannedDeprecationDate = plannedDeprecationDate; - return this; - } - - /** - * Get the tactics property: The tactics property. - * - * @return the tactics value. - */ - public List tactics() { - return this.tactics; - } - - /** - * Set the tactics property: The tactics property. - * - * @param tactics the tactics value to set. - * @return the SecurityAssessmentMetadataPropertiesResponse object itself. - */ - public SecurityAssessmentMetadataPropertiesResponse withTactics(List tactics) { - this.tactics = tactics; - return this; - } - - /** - * Get the techniques property: The techniques property. - * - * @return the techniques value. - */ - public List techniques() { - return this.techniques; - } - - /** - * Set the techniques property: The techniques property. - * - * @param techniques the techniques value to set. - * @return the SecurityAssessmentMetadataPropertiesResponse object itself. - */ - public SecurityAssessmentMetadataPropertiesResponse withTechniques(List techniques) { - this.techniques = techniques; - return this; - } - - /** {@inheritDoc} */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withDisplayName(String displayName) { - super.withDisplayName(displayName); - return this; - } - - /** {@inheritDoc} */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withDescription(String description) { - super.withDescription(description); - return this; - } - - /** {@inheritDoc} */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withRemediationDescription(String remediationDescription) { - super.withRemediationDescription(remediationDescription); - return this; - } - - /** {@inheritDoc} */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withCategories(List categories) { - super.withCategories(categories); - return this; - } - - /** {@inheritDoc} */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withSeverity(Severity severity) { - super.withSeverity(severity); - return this; - } - - /** {@inheritDoc} */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withUserImpact(UserImpact userImpact) { - super.withUserImpact(userImpact); - return this; - } - - /** {@inheritDoc} */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withImplementationEffort( - ImplementationEffort implementationEffort) { - super.withImplementationEffort(implementationEffort); - return this; - } - - /** {@inheritDoc} */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withThreats(List threats) { - super.withThreats(threats); - return this; - } - - /** {@inheritDoc} */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withPreview(Boolean preview) { - super.withPreview(preview); - return this; - } - - /** {@inheritDoc} */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withAssessmentType(AssessmentType assessmentType) { - super.withAssessmentType(assessmentType); - return this; - } - - /** {@inheritDoc} */ - @Override - public SecurityAssessmentMetadataPropertiesResponse withPartnerData( - SecurityAssessmentMetadataPartnerData partnerData) { - super.withPartnerData(partnerData); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (publishDates() != null) { - publishDates().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataResponseInner.java deleted file mode 100644 index 1167a0a33df6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentMetadataResponseInner.java +++ /dev/null @@ -1,414 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.AssessmentType; -import com.azure.resourcemanager.security.models.Categories; -import com.azure.resourcemanager.security.models.ImplementationEffort; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates; -import com.azure.resourcemanager.security.models.Severity; -import com.azure.resourcemanager.security.models.Tactics; -import com.azure.resourcemanager.security.models.Techniques; -import com.azure.resourcemanager.security.models.Threats; -import com.azure.resourcemanager.security.models.UserImpact; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Security assessment metadata response. */ -@Fluent -public final class SecurityAssessmentMetadataResponseInner extends ProxyResource { - /* - * Describes properties of an assessment metadata response. - */ - @JsonProperty(value = "properties") - private SecurityAssessmentMetadataPropertiesResponse innerProperties; - - /** Creates an instance of SecurityAssessmentMetadataResponseInner class. */ - public SecurityAssessmentMetadataResponseInner() { - } - - /** - * Get the innerProperties property: Describes properties of an assessment metadata response. - * - * @return the innerProperties value. - */ - private SecurityAssessmentMetadataPropertiesResponse innerProperties() { - return this.innerProperties; - } - - /** - * Get the publishDates property: The publishDates property. - * - * @return the publishDates value. - */ - public SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() { - return this.innerProperties() == null ? null : this.innerProperties().publishDates(); - } - - /** - * Set the publishDates property: The publishDates property. - * - * @param publishDates the publishDates value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withPublishDates( - SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withPublishDates(publishDates); - return this; - } - - /** - * Get the plannedDeprecationDate property: The plannedDeprecationDate property. - * - * @return the plannedDeprecationDate value. - */ - public String plannedDeprecationDate() { - return this.innerProperties() == null ? null : this.innerProperties().plannedDeprecationDate(); - } - - /** - * Set the plannedDeprecationDate property: The plannedDeprecationDate property. - * - * @param plannedDeprecationDate the plannedDeprecationDate value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withPlannedDeprecationDate(String plannedDeprecationDate) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withPlannedDeprecationDate(plannedDeprecationDate); - return this; - } - - /** - * Get the tactics property: The tactics property. - * - * @return the tactics value. - */ - public List tactics() { - return this.innerProperties() == null ? null : this.innerProperties().tactics(); - } - - /** - * Set the tactics property: The tactics property. - * - * @param tactics the tactics value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withTactics(List tactics) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withTactics(tactics); - return this; - } - - /** - * Get the techniques property: The techniques property. - * - * @return the techniques value. - */ - public List techniques() { - return this.innerProperties() == null ? null : this.innerProperties().techniques(); - } - - /** - * Set the techniques property: The techniques property. - * - * @param techniques the techniques value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withTechniques(List techniques) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withTechniques(techniques); - return this; - } - - /** - * Get the displayName property: User friendly display name of the assessment. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: User friendly display name of the assessment. - * - * @param displayName the displayName value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the policyDefinitionId property: Azure resource ID of the policy definition that turns this assessment - * calculation on. - * - * @return the policyDefinitionId value. - */ - public String policyDefinitionId() { - return this.innerProperties() == null ? null : this.innerProperties().policyDefinitionId(); - } - - /** - * Get the description property: Human readable description of the assessment. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: Human readable description of the assessment. - * - * @param description the description value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the remediationDescription property: Human readable description of what you should do to mitigate this - * security issue. - * - * @return the remediationDescription value. - */ - public String remediationDescription() { - return this.innerProperties() == null ? null : this.innerProperties().remediationDescription(); - } - - /** - * Set the remediationDescription property: Human readable description of what you should do to mitigate this - * security issue. - * - * @param remediationDescription the remediationDescription value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withRemediationDescription(String remediationDescription) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withRemediationDescription(remediationDescription); - return this; - } - - /** - * Get the categories property: The categories property. - * - * @return the categories value. - */ - public List categories() { - return this.innerProperties() == null ? null : this.innerProperties().categories(); - } - - /** - * Set the categories property: The categories property. - * - * @param categories the categories value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withCategories(List categories) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withCategories(categories); - return this; - } - - /** - * Get the severity property: The severity level of the assessment. - * - * @return the severity value. - */ - public Severity severity() { - return this.innerProperties() == null ? null : this.innerProperties().severity(); - } - - /** - * Set the severity property: The severity level of the assessment. - * - * @param severity the severity value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withSeverity(Severity severity) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withSeverity(severity); - return this; - } - - /** - * Get the userImpact property: The user impact of the assessment. - * - * @return the userImpact value. - */ - public UserImpact userImpact() { - return this.innerProperties() == null ? null : this.innerProperties().userImpact(); - } - - /** - * Set the userImpact property: The user impact of the assessment. - * - * @param userImpact the userImpact value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withUserImpact(UserImpact userImpact) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withUserImpact(userImpact); - return this; - } - - /** - * Get the implementationEffort property: The implementation effort required to remediate this assessment. - * - * @return the implementationEffort value. - */ - public ImplementationEffort implementationEffort() { - return this.innerProperties() == null ? null : this.innerProperties().implementationEffort(); - } - - /** - * Set the implementationEffort property: The implementation effort required to remediate this assessment. - * - * @param implementationEffort the implementationEffort value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withImplementationEffort(ImplementationEffort implementationEffort) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withImplementationEffort(implementationEffort); - return this; - } - - /** - * Get the threats property: The threats property. - * - * @return the threats value. - */ - public List threats() { - return this.innerProperties() == null ? null : this.innerProperties().threats(); - } - - /** - * Set the threats property: The threats property. - * - * @param threats the threats value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withThreats(List threats) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withThreats(threats); - return this; - } - - /** - * Get the preview property: True if this assessment is in preview release status. - * - * @return the preview value. - */ - public Boolean preview() { - return this.innerProperties() == null ? null : this.innerProperties().preview(); - } - - /** - * Set the preview property: True if this assessment is in preview release status. - * - * @param preview the preview value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withPreview(Boolean preview) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withPreview(preview); - return this; - } - - /** - * Get the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy definition, Custom if - * the assessment based on custom Azure Policy definition. - * - * @return the assessmentType value. - */ - public AssessmentType assessmentType() { - return this.innerProperties() == null ? null : this.innerProperties().assessmentType(); - } - - /** - * Set the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy definition, Custom if - * the assessment based on custom Azure Policy definition. - * - * @param assessmentType the assessmentType value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withAssessmentType(AssessmentType assessmentType) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withAssessmentType(assessmentType); - return this; - } - - /** - * Get the partnerData property: Describes the partner that created the assessment. - * - * @return the partnerData value. - */ - public SecurityAssessmentMetadataPartnerData partnerData() { - return this.innerProperties() == null ? null : this.innerProperties().partnerData(); - } - - /** - * Set the partnerData property: Describes the partner that created the assessment. - * - * @param partnerData the partnerData value to set. - * @return the SecurityAssessmentMetadataResponseInner object itself. - */ - public SecurityAssessmentMetadataResponseInner withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse(); - } - this.innerProperties().withPartnerData(partnerData); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentProperties.java deleted file mode 100644 index d5d7b67530e4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentProperties.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.AssessmentStatus; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; -import com.azure.resourcemanager.security.models.SecurityAssessmentPropertiesBase; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Describes properties of an assessment. */ -@Fluent -public final class SecurityAssessmentProperties extends SecurityAssessmentPropertiesBase { - /* - * The result of the assessment - */ - @JsonProperty(value = "status", required = true) - private AssessmentStatus status; - - /** Creates an instance of SecurityAssessmentProperties class. */ - public SecurityAssessmentProperties() { - } - - /** - * 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(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityAssessmentProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentPropertiesResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentPropertiesResponse.java deleted file mode 100644 index 9c4c6cdec8b2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentPropertiesResponse.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.AssessmentStatusResponse; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; -import com.azure.resourcemanager.security.models.SecurityAssessmentPropertiesBase; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Describes properties of an assessment. */ -@Fluent -public final class SecurityAssessmentPropertiesResponse extends SecurityAssessmentPropertiesBase { - /* - * The result of the assessment - */ - @JsonProperty(value = "status", required = true) - private AssessmentStatusResponse status; - - /** Creates an instance of SecurityAssessmentPropertiesResponse class. */ - public SecurityAssessmentPropertiesResponse() { - } - - /** - * 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(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityAssessmentPropertiesResponse.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentResponseInner.java deleted file mode 100644 index f3579b78ef47..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityAssessmentResponseInner.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.AssessmentLinks; -import com.azure.resourcemanager.security.models.AssessmentStatusResponse; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Security assessment on a resource - response format. */ -@Fluent -public final class SecurityAssessmentResponseInner extends ProxyResource { - /* - * Describes properties of an assessment. - */ - @JsonProperty(value = "properties") - private SecurityAssessmentPropertiesResponse innerProperties; - - /** Creates an instance of SecurityAssessmentResponseInner class. */ - public SecurityAssessmentResponseInner() { - } - - /** - * Get the innerProperties property: Describes properties of an assessment. - * - * @return the innerProperties value. - */ - private SecurityAssessmentPropertiesResponse innerProperties() { - return this.innerProperties; - } - - /** - * Get the status property: The result of the assessment. - * - * @return the status value. - */ - public AssessmentStatusResponse status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: The result of the assessment. - * - * @param status the status value to set. - * @return the SecurityAssessmentResponseInner object itself. - */ - public SecurityAssessmentResponseInner withStatus(AssessmentStatusResponse status) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentPropertiesResponse(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the resourceDetails property: Details of the resource that was assessed. - * - * @return the resourceDetails value. - */ - public ResourceDetails resourceDetails() { - return this.innerProperties() == null ? null : this.innerProperties().resourceDetails(); - } - - /** - * Set the resourceDetails property: Details of the resource that was assessed. - * - * @param resourceDetails the resourceDetails value to set. - * @return the SecurityAssessmentResponseInner object itself. - */ - public SecurityAssessmentResponseInner withResourceDetails(ResourceDetails resourceDetails) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentPropertiesResponse(); - } - this.innerProperties().withResourceDetails(resourceDetails); - return this; - } - - /** - * Get the displayName property: User friendly display name of the assessment. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the additionalData property: Additional data regarding the assessment. - * - * @return the additionalData value. - */ - public Map additionalData() { - return this.innerProperties() == null ? null : this.innerProperties().additionalData(); - } - - /** - * Set the additionalData property: Additional data regarding the assessment. - * - * @param additionalData the additionalData value to set. - * @return the SecurityAssessmentResponseInner object itself. - */ - public SecurityAssessmentResponseInner withAdditionalData(Map additionalData) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentPropertiesResponse(); - } - this.innerProperties().withAdditionalData(additionalData); - return this; - } - - /** - * Get the links property: Links relevant to the assessment. - * - * @return the links value. - */ - public AssessmentLinks links() { - return this.innerProperties() == null ? null : this.innerProperties().links(); - } - - /** - * Get the metadata property: Describes properties of an assessment metadata. - * - * @return the metadata value. - */ - public SecurityAssessmentMetadataProperties metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Set the metadata property: Describes properties of an assessment metadata. - * - * @param metadata the metadata value to set. - * @return the SecurityAssessmentResponseInner object itself. - */ - public SecurityAssessmentResponseInner withMetadata(SecurityAssessmentMetadataProperties metadata) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentPropertiesResponse(); - } - this.innerProperties().withMetadata(metadata); - return this; - } - - /** - * Get the partnersData property: Data regarding 3rd party partner integration. - * - * @return the partnersData value. - */ - public SecurityAssessmentPartnerData partnersData() { - return this.innerProperties() == null ? null : this.innerProperties().partnersData(); - } - - /** - * Set the partnersData property: Data regarding 3rd party partner integration. - * - * @param partnersData the partnersData value to set. - * @return the SecurityAssessmentResponseInner object itself. - */ - public SecurityAssessmentResponseInner withPartnersData(SecurityAssessmentPartnerData partnersData) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentPropertiesResponse(); - } - this.innerProperties().withPartnersData(partnersData); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorInner.java deleted file mode 100644 index a58a7ab73eb4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorInner.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.CloudOffering; -import com.azure.resourcemanager.security.models.EnvironmentData; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** The security connector resource. */ -@Fluent -public final class SecurityConnectorInner extends Resource { - /* - * Azure Resource Manager metadata containing createdBy and modifiedBy information. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Security connector data - */ - @JsonProperty(value = "properties") - private SecurityConnectorProperties innerProperties; - - /** Creates an instance of SecurityConnectorInner class. */ - public SecurityConnectorInner() { - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the innerProperties property: Security connector data. - * - * @return the innerProperties value. - */ - private SecurityConnectorProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public SecurityConnectorInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public SecurityConnectorInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector, - * project number in case of GCP connector). - * - * @return the hierarchyIdentifier value. - */ - public String hierarchyIdentifier() { - return this.innerProperties() == null ? null : this.innerProperties().hierarchyIdentifier(); - } - - /** - * Set the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector, - * project number in case of GCP connector). - * - * @param hierarchyIdentifier the hierarchyIdentifier value to set. - * @return the SecurityConnectorInner object itself. - */ - public SecurityConnectorInner withHierarchyIdentifier(String hierarchyIdentifier) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityConnectorProperties(); - } - this.innerProperties().withHierarchyIdentifier(hierarchyIdentifier); - return this; - } - - /** - * Get the hierarchyIdentifierTrialEndDate property: The date on which the trial period will end, if applicable. - * Trial period exists for 30 days after upgrading to payed offerings. - * - * @return the hierarchyIdentifierTrialEndDate value. - */ - public OffsetDateTime hierarchyIdentifierTrialEndDate() { - return this.innerProperties() == null ? null : this.innerProperties().hierarchyIdentifierTrialEndDate(); - } - - /** - * Get the environmentName property: The multi cloud resource's cloud name. - * - * @return the environmentName value. - */ - public CloudName environmentName() { - return this.innerProperties() == null ? null : this.innerProperties().environmentName(); - } - - /** - * Set the environmentName property: The multi cloud resource's cloud name. - * - * @param environmentName the environmentName value to set. - * @return the SecurityConnectorInner object itself. - */ - public SecurityConnectorInner withEnvironmentName(CloudName environmentName) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityConnectorProperties(); - } - this.innerProperties().withEnvironmentName(environmentName); - return this; - } - - /** - * Get the offerings property: A collection of offerings for the security connector. - * - * @return the offerings value. - */ - public List offerings() { - return this.innerProperties() == null ? null : this.innerProperties().offerings(); - } - - /** - * Set the offerings property: A collection of offerings for the security connector. - * - * @param offerings the offerings value to set. - * @return the SecurityConnectorInner object itself. - */ - public SecurityConnectorInner withOfferings(List offerings) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityConnectorProperties(); - } - this.innerProperties().withOfferings(offerings); - return this; - } - - /** - * Get the environmentData property: The security connector environment data. - * - * @return the environmentData value. - */ - public EnvironmentData environmentData() { - return this.innerProperties() == null ? null : this.innerProperties().environmentData(); - } - - /** - * Set the environmentData property: The security connector environment data. - * - * @param environmentData the environmentData value to set. - * @return the SecurityConnectorInner object itself. - */ - public SecurityConnectorInner withEnvironmentData(EnvironmentData environmentData) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityConnectorProperties(); - } - this.innerProperties().withEnvironmentData(environmentData); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorProperties.java deleted file mode 100644 index df14a0076cf6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityConnectorProperties.java +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.CloudOffering; -import com.azure.resourcemanager.security.models.EnvironmentData; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** A set of properties that defines the security connector configuration. */ -@Fluent -public final class SecurityConnectorProperties { - /* - * The multi cloud resource identifier (account id in case of AWS connector, project number in case of GCP - * connector). - */ - @JsonProperty(value = "hierarchyIdentifier") - private String hierarchyIdentifier; - - /* - * The date on which the trial period will end, if applicable. Trial period exists for 30 days after upgrading to - * payed offerings. - */ - @JsonProperty(value = "hierarchyIdentifierTrialEndDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime hierarchyIdentifierTrialEndDate; - - /* - * The multi cloud resource's cloud name. - */ - @JsonProperty(value = "environmentName") - private CloudName environmentName; - - /* - * A collection of offerings for the security connector. - */ - @JsonProperty(value = "offerings") - private List offerings; - - /* - * The security connector environment data. - */ - @JsonProperty(value = "environmentData") - private EnvironmentData environmentData; - - /** Creates an instance of SecurityConnectorProperties class. */ - public SecurityConnectorProperties() { - } - - /** - * Get the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector, - * project number in case of GCP connector). - * - * @return the hierarchyIdentifier value. - */ - public String hierarchyIdentifier() { - return this.hierarchyIdentifier; - } - - /** - * Set the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector, - * project number in case of GCP connector). - * - * @param hierarchyIdentifier the hierarchyIdentifier value to set. - * @return the SecurityConnectorProperties object itself. - */ - public SecurityConnectorProperties withHierarchyIdentifier(String hierarchyIdentifier) { - this.hierarchyIdentifier = hierarchyIdentifier; - return this; - } - - /** - * Get the hierarchyIdentifierTrialEndDate property: The date on which the trial period will end, if applicable. - * Trial period exists for 30 days after upgrading to payed offerings. - * - * @return the hierarchyIdentifierTrialEndDate value. - */ - public OffsetDateTime hierarchyIdentifierTrialEndDate() { - return this.hierarchyIdentifierTrialEndDate; - } - - /** - * Get the environmentName property: The multi cloud resource's cloud name. - * - * @return the environmentName value. - */ - public CloudName environmentName() { - return this.environmentName; - } - - /** - * Set the environmentName property: The multi cloud resource's cloud name. - * - * @param environmentName the environmentName value to set. - * @return the SecurityConnectorProperties object itself. - */ - public SecurityConnectorProperties withEnvironmentName(CloudName environmentName) { - this.environmentName = environmentName; - return this; - } - - /** - * Get the offerings property: A collection of offerings for the security connector. - * - * @return the offerings value. - */ - public List offerings() { - return this.offerings; - } - - /** - * Set the offerings property: A collection of offerings for the security connector. - * - * @param offerings the offerings value to set. - * @return the SecurityConnectorProperties object itself. - */ - public SecurityConnectorProperties withOfferings(List offerings) { - this.offerings = offerings; - return this; - } - - /** - * Get the environmentData property: The security connector environment data. - * - * @return the environmentData value. - */ - public EnvironmentData environmentData() { - return this.environmentData; - } - - /** - * Set the environmentData property: The security connector environment data. - * - * @param environmentData the environmentData value to set. - * @return the SecurityConnectorProperties object itself. - */ - public SecurityConnectorProperties withEnvironmentData(EnvironmentData environmentData) { - this.environmentData = environmentData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (offerings() != null) { - offerings().forEach(e -> e.validate()); - } - if (environmentData() != null) { - environmentData().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactInner.java deleted file mode 100644 index 0606139e3bf2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactInner.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Contact details and configurations for notifications coming from Microsoft Defender for Cloud. */ -@Fluent -public final class SecurityContactInner extends ProxyResource { - /* - * Security contact data - */ - @JsonProperty(value = "properties") - private SecurityContactProperties innerProperties; - - /** Creates an instance of SecurityContactInner class. */ - public SecurityContactInner() { - } - - /** - * Get the innerProperties property: Security contact data. - * - * @return the innerProperties value. - */ - private SecurityContactProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the emails property: List of email addresses which will get notifications from Microsoft Defender for Cloud - * by the configurations defined in this security contact. - * - * @return the emails value. - */ - public String emails() { - return this.innerProperties() == null ? null : this.innerProperties().emails(); - } - - /** - * Set the emails property: List of email addresses which will get notifications from Microsoft Defender for Cloud - * by the configurations defined in this security contact. - * - * @param emails the emails value to set. - * @return the SecurityContactInner object itself. - */ - public SecurityContactInner withEmails(String emails) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityContactProperties(); - } - this.innerProperties().withEmails(emails); - return this; - } - - /** - * Get the phone property: The security contact's phone number. - * - * @return the phone value. - */ - public String phone() { - return this.innerProperties() == null ? null : this.innerProperties().phone(); - } - - /** - * Set the phone property: The security contact's phone number. - * - * @param phone the phone value to set. - * @return the SecurityContactInner object itself. - */ - public SecurityContactInner withPhone(String phone) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityContactProperties(); - } - this.innerProperties().withPhone(phone); - return this; - } - - /** - * Get the alertNotifications property: Defines whether to send email notifications about new security alerts. - * - * @return the alertNotifications value. - */ - public SecurityContactPropertiesAlertNotifications alertNotifications() { - return this.innerProperties() == null ? null : this.innerProperties().alertNotifications(); - } - - /** - * Set the alertNotifications property: Defines whether to send email notifications about new security alerts. - * - * @param alertNotifications the alertNotifications value to set. - * @return the SecurityContactInner object itself. - */ - public SecurityContactInner withAlertNotifications(SecurityContactPropertiesAlertNotifications alertNotifications) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityContactProperties(); - } - this.innerProperties().withAlertNotifications(alertNotifications); - return this; - } - - /** - * Get the notificationsByRole property: Defines whether to send email notifications from Microsoft Defender for - * Cloud to persons with specific RBAC roles on the subscription. - * - * @return the notificationsByRole value. - */ - public SecurityContactPropertiesNotificationsByRole notificationsByRole() { - return this.innerProperties() == null ? null : this.innerProperties().notificationsByRole(); - } - - /** - * Set the notificationsByRole property: Defines whether to send email notifications from Microsoft Defender for - * Cloud to persons with specific RBAC roles on the subscription. - * - * @param notificationsByRole the notificationsByRole value to set. - * @return the SecurityContactInner object itself. - */ - public SecurityContactInner withNotificationsByRole( - SecurityContactPropertiesNotificationsByRole notificationsByRole) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityContactProperties(); - } - this.innerProperties().withNotificationsByRole(notificationsByRole); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactProperties.java deleted file mode 100644 index 34c16a792122..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityContactProperties.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes security contact properties. */ -@Fluent -public final class SecurityContactProperties { - /* - * List of email addresses which will get notifications from Microsoft Defender for Cloud by the configurations - * defined in this security contact. - */ - @JsonProperty(value = "emails") - private String emails; - - /* - * The security contact's phone number - */ - @JsonProperty(value = "phone") - private String phone; - - /* - * Defines whether to send email notifications about new security alerts - */ - @JsonProperty(value = "alertNotifications") - private SecurityContactPropertiesAlertNotifications alertNotifications; - - /* - * Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC - * roles on the subscription. - */ - @JsonProperty(value = "notificationsByRole") - private SecurityContactPropertiesNotificationsByRole notificationsByRole; - - /** Creates an instance of SecurityContactProperties class. */ - public SecurityContactProperties() { - } - - /** - * Get the emails property: List of email addresses which will get notifications from Microsoft Defender for Cloud - * by the configurations defined in this security contact. - * - * @return the emails value. - */ - public String emails() { - return this.emails; - } - - /** - * Set the emails property: List of email addresses which will get notifications from Microsoft Defender for Cloud - * by the configurations defined in this security contact. - * - * @param emails the emails value to set. - * @return the SecurityContactProperties object itself. - */ - public SecurityContactProperties withEmails(String emails) { - this.emails = emails; - return this; - } - - /** - * Get the phone property: The security contact's phone number. - * - * @return the phone value. - */ - public String phone() { - return this.phone; - } - - /** - * Set the phone property: The security contact's phone number. - * - * @param phone the phone value to set. - * @return the SecurityContactProperties object itself. - */ - public SecurityContactProperties withPhone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get the alertNotifications property: Defines whether to send email notifications about new security alerts. - * - * @return the alertNotifications value. - */ - public SecurityContactPropertiesAlertNotifications alertNotifications() { - return this.alertNotifications; - } - - /** - * Set the alertNotifications property: Defines whether to send email notifications about new security alerts. - * - * @param alertNotifications the alertNotifications value to set. - * @return the SecurityContactProperties object itself. - */ - public SecurityContactProperties withAlertNotifications( - SecurityContactPropertiesAlertNotifications alertNotifications) { - this.alertNotifications = alertNotifications; - return this; - } - - /** - * Get the notificationsByRole property: Defines whether to send email notifications from Microsoft Defender for - * Cloud to persons with specific RBAC roles on the subscription. - * - * @return the notificationsByRole value. - */ - public SecurityContactPropertiesNotificationsByRole notificationsByRole() { - return this.notificationsByRole; - } - - /** - * Set the notificationsByRole property: Defines whether to send email notifications from Microsoft Defender for - * Cloud to persons with specific RBAC roles on the subscription. - * - * @param notificationsByRole the notificationsByRole value to set. - * @return the SecurityContactProperties object itself. - */ - public SecurityContactProperties withNotificationsByRole( - SecurityContactPropertiesNotificationsByRole notificationsByRole) { - this.notificationsByRole = notificationsByRole; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (alertNotifications() != null) { - alertNotifications().validate(); - } - if (notificationsByRole() != null) { - notificationsByRole().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorInner.java deleted file mode 100644 index 74c332b17887..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.Identity; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Security operator under a given subscription and pricing. */ -@Fluent -public final class SecurityOperatorInner extends ProxyResource { - /* - * Identity for the resource. - */ - @JsonProperty(value = "identity") - private Identity identity; - - /** Creates an instance of SecurityOperatorInner class. */ - public SecurityOperatorInner() { - } - - /** - * Get the identity property: Identity for the resource. - * - * @return the identity value. - */ - public Identity identity() { - return this.identity; - } - - /** - * Set the identity property: Identity for the resource. - * - * @param identity the identity value to set. - * @return the SecurityOperatorInner object itself. - */ - public SecurityOperatorInner withIdentity(Identity identity) { - this.identity = identity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorListInner.java deleted file mode 100644 index de1c00d24b3b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityOperatorListInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of SecurityOperator response. */ -@Fluent -public final class SecurityOperatorListInner { - /* - * List of SecurityOperator configurations - */ - @JsonProperty(value = "value", required = true) - private List value; - - /** Creates an instance of SecurityOperatorListInner class. */ - public SecurityOperatorListInner() { - } - - /** - * Get the value property: List of SecurityOperator configurations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of SecurityOperator configurations. - * - * @param value the value value to set. - * @return the SecurityOperatorListInner object itself. - */ - public SecurityOperatorListInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model SecurityOperatorListInner")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityOperatorListInner.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionInner.java deleted file mode 100644 index 8428e621636d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionInner.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SecuritySolution model. */ -@Fluent -public final class SecuritySolutionInner extends ProxyResource { - /* - * The properties property. - */ - @JsonProperty(value = "properties") - private SecuritySolutionProperties innerProperties; - - /* - * Location where the resource is stored - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /** Creates an instance of SecuritySolutionInner class. */ - public SecuritySolutionInner() { - } - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private SecuritySolutionProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the securityFamily property: The security family of the security solution. - * - * @return the securityFamily value. - */ - public SecurityFamily securityFamily() { - return this.innerProperties() == null ? null : this.innerProperties().securityFamily(); - } - - /** - * Set the securityFamily property: The security family of the security solution. - * - * @param securityFamily the securityFamily value to set. - * @return the SecuritySolutionInner object itself. - */ - public SecuritySolutionInner withSecurityFamily(SecurityFamily securityFamily) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySolutionProperties(); - } - this.innerProperties().withSecurityFamily(securityFamily); - return this; - } - - /** - * Get the provisioningState property: The security family provisioning State. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Set the provisioningState property: The security family provisioning State. - * - * @param provisioningState the provisioningState value to set. - * @return the SecuritySolutionInner object itself. - */ - public SecuritySolutionInner withProvisioningState(ProvisioningState provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySolutionProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - - /** - * Get the template property: The security solutions' template. - * - * @return the template value. - */ - public String template() { - return this.innerProperties() == null ? null : this.innerProperties().template(); - } - - /** - * Set the template property: The security solutions' template. - * - * @param template the template value to set. - * @return the SecuritySolutionInner object itself. - */ - public SecuritySolutionInner withTemplate(String template) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySolutionProperties(); - } - this.innerProperties().withTemplate(template); - return this; - } - - /** - * Get the protectionStatus property: The security solutions' status. - * - * @return the protectionStatus value. - */ - public String protectionStatus() { - return this.innerProperties() == null ? null : this.innerProperties().protectionStatus(); - } - - /** - * Set the protectionStatus property: The security solutions' status. - * - * @param protectionStatus the protectionStatus value to set. - * @return the SecuritySolutionInner object itself. - */ - public SecuritySolutionInner withProtectionStatus(String protectionStatus) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySolutionProperties(); - } - this.innerProperties().withProtectionStatus(protectionStatus); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionProperties.java deleted file mode 100644 index bc67143e9d6f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionProperties.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SecuritySolutionProperties model. */ -@Fluent -public final class SecuritySolutionProperties { - /* - * The security family of the security solution - */ - @JsonProperty(value = "securityFamily", required = true) - private SecurityFamily securityFamily; - - /* - * The security family provisioning State - */ - @JsonProperty(value = "provisioningState", required = true) - private ProvisioningState provisioningState; - - /* - * The security solutions' template - */ - @JsonProperty(value = "template", required = true) - private String template; - - /* - * The security solutions' status - */ - @JsonProperty(value = "protectionStatus", required = true) - private String protectionStatus; - - /** Creates an instance of SecuritySolutionProperties class. */ - public SecuritySolutionProperties() { - } - - /** - * Get the securityFamily property: The security family of the security solution. - * - * @return the securityFamily value. - */ - public SecurityFamily securityFamily() { - return this.securityFamily; - } - - /** - * Set the securityFamily property: The security family of the security solution. - * - * @param securityFamily the securityFamily value to set. - * @return the SecuritySolutionProperties object itself. - */ - public SecuritySolutionProperties withSecurityFamily(SecurityFamily securityFamily) { - this.securityFamily = securityFamily; - return this; - } - - /** - * Get the provisioningState property: The security family provisioning State. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The security family provisioning State. - * - * @param provisioningState the provisioningState value to set. - * @return the SecuritySolutionProperties object itself. - */ - public SecuritySolutionProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * Get the template property: The security solutions' template. - * - * @return the template value. - */ - public String template() { - return this.template; - } - - /** - * Set the template property: The security solutions' template. - * - * @param template the template value to set. - * @return the SecuritySolutionProperties object itself. - */ - public SecuritySolutionProperties withTemplate(String template) { - this.template = template; - return this; - } - - /** - * Get the protectionStatus property: The security solutions' status. - * - * @return the protectionStatus value. - */ - public String protectionStatus() { - return this.protectionStatus; - } - - /** - * Set the protectionStatus property: The security solutions' status. - * - * @param protectionStatus the protectionStatus value to set. - * @return the SecuritySolutionProperties object itself. - */ - public SecuritySolutionProperties withProtectionStatus(String protectionStatus) { - this.protectionStatus = protectionStatus; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (securityFamily() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property securityFamily in model SecuritySolutionProperties")); - } - if (provisioningState() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property provisioningState in model SecuritySolutionProperties")); - } - if (template() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property template in model SecuritySolutionProperties")); - } - if (protectionStatus() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property protectionStatus in model SecuritySolutionProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecuritySolutionProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataListInner.java deleted file mode 100644 index be2aebaf7be4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataListInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceData; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The SecuritySolutionsReferenceDataList model. */ -@Fluent -public final class SecuritySolutionsReferenceDataListInner { - /* - * The value property. - */ - @JsonProperty(value = "value") - private List value; - - /** Creates an instance of SecuritySolutionsReferenceDataListInner class. */ - public SecuritySolutionsReferenceDataListInner() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the SecuritySolutionsReferenceDataListInner object itself. - */ - public SecuritySolutionsReferenceDataListInner 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/SecuritySolutionsReferenceDataProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataProperties.java deleted file mode 100644 index b4a576857f5e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySolutionsReferenceDataProperties.java +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SecuritySolutionsReferenceDataProperties model. */ -@Fluent -public final class SecuritySolutionsReferenceDataProperties { - /* - * The security family of the security solution - */ - @JsonProperty(value = "securityFamily", required = true) - private SecurityFamily securityFamily; - - /* - * The security solutions' vendor name - */ - @JsonProperty(value = "alertVendorName", required = true) - private String alertVendorName; - - /* - * The security solutions' package info url - */ - @JsonProperty(value = "packageInfoUrl", required = true) - private String packageInfoUrl; - - /* - * The security solutions' product name - */ - @JsonProperty(value = "productName", required = true) - private String productName; - - /* - * The security solutions' publisher - */ - @JsonProperty(value = "publisher", required = true) - private String publisher; - - /* - * The security solutions' publisher display name - */ - @JsonProperty(value = "publisherDisplayName", required = true) - private String publisherDisplayName; - - /* - * The security solutions' template - */ - @JsonProperty(value = "template", required = true) - private String template; - - /** Creates an instance of SecuritySolutionsReferenceDataProperties class. */ - public SecuritySolutionsReferenceDataProperties() { - } - - /** - * Get the securityFamily property: The security family of the security solution. - * - * @return the securityFamily value. - */ - public SecurityFamily securityFamily() { - return this.securityFamily; - } - - /** - * Set the securityFamily property: The security family of the security solution. - * - * @param securityFamily the securityFamily value to set. - * @return the SecuritySolutionsReferenceDataProperties object itself. - */ - public SecuritySolutionsReferenceDataProperties withSecurityFamily(SecurityFamily securityFamily) { - this.securityFamily = securityFamily; - return this; - } - - /** - * Get the alertVendorName property: The security solutions' vendor name. - * - * @return the alertVendorName value. - */ - public String alertVendorName() { - return this.alertVendorName; - } - - /** - * Set the alertVendorName property: The security solutions' vendor name. - * - * @param alertVendorName the alertVendorName value to set. - * @return the SecuritySolutionsReferenceDataProperties object itself. - */ - public SecuritySolutionsReferenceDataProperties withAlertVendorName(String alertVendorName) { - this.alertVendorName = alertVendorName; - return this; - } - - /** - * Get the packageInfoUrl property: The security solutions' package info url. - * - * @return the packageInfoUrl value. - */ - public String packageInfoUrl() { - return this.packageInfoUrl; - } - - /** - * Set the packageInfoUrl property: The security solutions' package info url. - * - * @param packageInfoUrl the packageInfoUrl value to set. - * @return the SecuritySolutionsReferenceDataProperties object itself. - */ - public SecuritySolutionsReferenceDataProperties withPackageInfoUrl(String packageInfoUrl) { - this.packageInfoUrl = packageInfoUrl; - return this; - } - - /** - * Get the productName property: The security solutions' product name. - * - * @return the productName value. - */ - public String productName() { - return this.productName; - } - - /** - * Set the productName property: The security solutions' product name. - * - * @param productName the productName value to set. - * @return the SecuritySolutionsReferenceDataProperties object itself. - */ - public SecuritySolutionsReferenceDataProperties withProductName(String productName) { - this.productName = productName; - return this; - } - - /** - * Get the publisher property: The security solutions' publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Set the publisher property: The security solutions' publisher. - * - * @param publisher the publisher value to set. - * @return the SecuritySolutionsReferenceDataProperties object itself. - */ - public SecuritySolutionsReferenceDataProperties withPublisher(String publisher) { - this.publisher = publisher; - return this; - } - - /** - * Get the publisherDisplayName property: The security solutions' publisher display name. - * - * @return the publisherDisplayName value. - */ - public String publisherDisplayName() { - return this.publisherDisplayName; - } - - /** - * Set the publisherDisplayName property: The security solutions' publisher display name. - * - * @param publisherDisplayName the publisherDisplayName value to set. - * @return the SecuritySolutionsReferenceDataProperties object itself. - */ - public SecuritySolutionsReferenceDataProperties withPublisherDisplayName(String publisherDisplayName) { - this.publisherDisplayName = publisherDisplayName; - return this; - } - - /** - * Get the template property: The security solutions' template. - * - * @return the template value. - */ - public String template() { - return this.template; - } - - /** - * Set the template property: The security solutions' template. - * - * @param template the template value to set. - * @return the SecuritySolutionsReferenceDataProperties object itself. - */ - public SecuritySolutionsReferenceDataProperties withTemplate(String template) { - this.template = template; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (securityFamily() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property securityFamily in model SecuritySolutionsReferenceDataProperties")); - } - if (alertVendorName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property alertVendorName in model SecuritySolutionsReferenceDataProperties")); - } - if (packageInfoUrl() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property packageInfoUrl in model SecuritySolutionsReferenceDataProperties")); - } - if (productName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property productName in model SecuritySolutionsReferenceDataProperties")); - } - if (publisher() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publisher in model SecuritySolutionsReferenceDataProperties")); - } - if (publisherDisplayName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property publisherDisplayName in model" - + " SecuritySolutionsReferenceDataProperties")); - } - if (template() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property template in model SecuritySolutionsReferenceDataProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecuritySolutionsReferenceDataProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentInner.java deleted file mode 100644 index c85cdd9877f9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentInner.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.AdditionalData; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SubAssessmentStatus; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Security sub-assessment on a resource. */ -@Fluent -public final class SecuritySubAssessmentInner extends ProxyResource { - /* - * Describes properties of an sub-assessment. - */ - @JsonProperty(value = "properties") - private SecuritySubAssessmentProperties innerProperties; - - /** Creates an instance of SecuritySubAssessmentInner class. */ - public SecuritySubAssessmentInner() { - } - - /** - * Get the innerProperties property: Describes properties of an sub-assessment. - * - * @return the innerProperties value. - */ - private SecuritySubAssessmentProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the id property: Vulnerability ID. - * - * @return the id value. - */ - public String idPropertiesId() { - return this.innerProperties() == null ? null : this.innerProperties().id(); - } - - /** - * Get the displayName property: User friendly display name of the sub-assessment. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the status property: Status of the sub-assessment. - * - * @return the status value. - */ - public SubAssessmentStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: Status of the sub-assessment. - * - * @param status the status value to set. - * @return the SecuritySubAssessmentInner object itself. - */ - public SecuritySubAssessmentInner withStatus(SubAssessmentStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySubAssessmentProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the remediation property: Information on how to remediate this sub-assessment. - * - * @return the remediation value. - */ - public String remediation() { - return this.innerProperties() == null ? null : this.innerProperties().remediation(); - } - - /** - * Get the impact property: Description of the impact of this sub-assessment. - * - * @return the impact value. - */ - public String impact() { - return this.innerProperties() == null ? null : this.innerProperties().impact(); - } - - /** - * Get the category property: Category of the sub-assessment. - * - * @return the category value. - */ - public String category() { - return this.innerProperties() == null ? null : this.innerProperties().category(); - } - - /** - * Get the description property: Human readable description of the assessment status. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the timeGenerated property: The date and time the sub-assessment was generated. - * - * @return the timeGenerated value. - */ - public OffsetDateTime timeGenerated() { - return this.innerProperties() == null ? null : this.innerProperties().timeGenerated(); - } - - /** - * Get the resourceDetails property: Details of the resource that was assessed. - * - * @return the resourceDetails value. - */ - public ResourceDetails resourceDetails() { - return this.innerProperties() == null ? null : this.innerProperties().resourceDetails(); - } - - /** - * Set the resourceDetails property: Details of the resource that was assessed. - * - * @param resourceDetails the resourceDetails value to set. - * @return the SecuritySubAssessmentInner object itself. - */ - public SecuritySubAssessmentInner withResourceDetails(ResourceDetails resourceDetails) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySubAssessmentProperties(); - } - this.innerProperties().withResourceDetails(resourceDetails); - return this; - } - - /** - * Get the additionalData property: Details of the sub-assessment. - * - * @return the additionalData value. - */ - public AdditionalData additionalData() { - return this.innerProperties() == null ? null : this.innerProperties().additionalData(); - } - - /** - * Set the additionalData property: Details of the sub-assessment. - * - * @param additionalData the additionalData value to set. - * @return the SecuritySubAssessmentInner object itself. - */ - public SecuritySubAssessmentInner withAdditionalData(AdditionalData additionalData) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySubAssessmentProperties(); - } - this.innerProperties().withAdditionalData(additionalData); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentProperties.java deleted file mode 100644 index f4f1e1f44376..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecuritySubAssessmentProperties.java +++ /dev/null @@ -1,220 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.AdditionalData; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SubAssessmentStatus; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Describes properties of an sub-assessment. */ -@Fluent -public final class SecuritySubAssessmentProperties { - /* - * Vulnerability ID - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * User friendly display name of the sub-assessment - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * Status of the sub-assessment - */ - @JsonProperty(value = "status") - private SubAssessmentStatus status; - - /* - * Information on how to remediate this sub-assessment - */ - @JsonProperty(value = "remediation", access = JsonProperty.Access.WRITE_ONLY) - private String remediation; - - /* - * Description of the impact of this sub-assessment - */ - @JsonProperty(value = "impact", access = JsonProperty.Access.WRITE_ONLY) - private String impact; - - /* - * Category of the sub-assessment - */ - @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY) - private String category; - - /* - * Human readable description of the assessment status - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The date and time the sub-assessment was generated - */ - @JsonProperty(value = "timeGenerated", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime timeGenerated; - - /* - * Details of the resource that was assessed - */ - @JsonProperty(value = "resourceDetails") - private ResourceDetails resourceDetails; - - /* - * Details of the sub-assessment - */ - @JsonProperty(value = "additionalData") - private AdditionalData additionalData; - - /** Creates an instance of SecuritySubAssessmentProperties class. */ - public SecuritySubAssessmentProperties() { - } - - /** - * Get the id property: Vulnerability ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the displayName property: User friendly display name of the sub-assessment. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the status property: Status of the sub-assessment. - * - * @return the status value. - */ - public SubAssessmentStatus status() { - return this.status; - } - - /** - * Set the status property: Status of the sub-assessment. - * - * @param status the status value to set. - * @return the SecuritySubAssessmentProperties object itself. - */ - public SecuritySubAssessmentProperties withStatus(SubAssessmentStatus status) { - this.status = status; - return this; - } - - /** - * Get the remediation property: Information on how to remediate this sub-assessment. - * - * @return the remediation value. - */ - public String remediation() { - return this.remediation; - } - - /** - * Get the impact property: Description of the impact of this sub-assessment. - * - * @return the impact value. - */ - public String impact() { - return this.impact; - } - - /** - * Get the category property: Category of the sub-assessment. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Get the description property: Human readable description of the assessment status. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the timeGenerated property: The date and time the sub-assessment was generated. - * - * @return the timeGenerated value. - */ - public OffsetDateTime timeGenerated() { - return this.timeGenerated; - } - - /** - * Get the resourceDetails property: Details of the resource that was assessed. - * - * @return the resourceDetails value. - */ - public ResourceDetails resourceDetails() { - return this.resourceDetails; - } - - /** - * Set the resourceDetails property: Details of the resource that was assessed. - * - * @param resourceDetails the resourceDetails value to set. - * @return the SecuritySubAssessmentProperties object itself. - */ - public SecuritySubAssessmentProperties withResourceDetails(ResourceDetails resourceDetails) { - this.resourceDetails = resourceDetails; - return this; - } - - /** - * Get the additionalData property: Details of the sub-assessment. - * - * @return the additionalData value. - */ - public AdditionalData additionalData() { - return this.additionalData; - } - - /** - * Set the additionalData property: Details of the sub-assessment. - * - * @param additionalData the additionalData value to set. - * @return the SecuritySubAssessmentProperties object itself. - */ - public SecuritySubAssessmentProperties withAdditionalData(AdditionalData additionalData) { - this.additionalData = additionalData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (status() != null) { - status().validate(); - } - if (resourceDetails() != null) { - resourceDetails().validate(); - } - if (additionalData() != null) { - additionalData().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskInner.java deleted file mode 100644 index fa8e115ac63e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskInner.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.SecurityTaskParameters; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Security task that we recommend to do in order to strengthen security. */ -@Fluent -public final class SecurityTaskInner extends ProxyResource { - /* - * Describes properties of a task. - */ - @JsonProperty(value = "properties") - private SecurityTaskProperties innerProperties; - - /** Creates an instance of SecurityTaskInner class. */ - public SecurityTaskInner() { - } - - /** - * Get the innerProperties property: Describes properties of a task. - * - * @return the innerProperties value. - */ - private SecurityTaskProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the state property: State of the task (Active, Resolved etc.). - * - * @return the state value. - */ - public String state() { - return this.innerProperties() == null ? null : this.innerProperties().state(); - } - - /** - * Get the creationTimeUtc property: The time this task was discovered in UTC. - * - * @return the creationTimeUtc value. - */ - public OffsetDateTime creationTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().creationTimeUtc(); - } - - /** - * Get the securityTaskParameters property: Changing set of properties, depending on the task type that is derived - * from the name field. - * - * @return the securityTaskParameters value. - */ - public SecurityTaskParameters securityTaskParameters() { - return this.innerProperties() == null ? null : this.innerProperties().securityTaskParameters(); - } - - /** - * Set the securityTaskParameters property: Changing set of properties, depending on the task type that is derived - * from the name field. - * - * @param securityTaskParameters the securityTaskParameters value to set. - * @return the SecurityTaskInner object itself. - */ - public SecurityTaskInner withSecurityTaskParameters(SecurityTaskParameters securityTaskParameters) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityTaskProperties(); - } - this.innerProperties().withSecurityTaskParameters(securityTaskParameters); - return this; - } - - /** - * Get the lastStateChangeTimeUtc property: The time this task's details were last changed in UTC. - * - * @return the lastStateChangeTimeUtc value. - */ - public OffsetDateTime lastStateChangeTimeUtc() { - return this.innerProperties() == null ? null : this.innerProperties().lastStateChangeTimeUtc(); - } - - /** - * Get the subState property: Additional data on the state of the task. - * - * @return the subState value. - */ - public String subState() { - return this.innerProperties() == null ? null : this.innerProperties().subState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskProperties.java deleted file mode 100644 index 9ef646e4b376..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SecurityTaskProperties.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.SecurityTaskParameters; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Describes properties of a task. */ -@Fluent -public final class SecurityTaskProperties { - /* - * State of the task (Active, Resolved etc.) - */ - @JsonProperty(value = "state", access = JsonProperty.Access.WRITE_ONLY) - private String state; - - /* - * The time this task was discovered in UTC - */ - @JsonProperty(value = "creationTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime creationTimeUtc; - - /* - * Changing set of properties, depending on the task type that is derived from the name field - */ - @JsonProperty(value = "securityTaskParameters") - private SecurityTaskParameters securityTaskParameters; - - /* - * The time this task's details were last changed in UTC - */ - @JsonProperty(value = "lastStateChangeTimeUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastStateChangeTimeUtc; - - /* - * Additional data on the state of the task - */ - @JsonProperty(value = "subState", access = JsonProperty.Access.WRITE_ONLY) - private String subState; - - /** Creates an instance of SecurityTaskProperties class. */ - public SecurityTaskProperties() { - } - - /** - * Get the state property: State of the task (Active, Resolved etc.). - * - * @return the state value. - */ - public String state() { - return this.state; - } - - /** - * Get the creationTimeUtc property: The time this task was discovered in UTC. - * - * @return the creationTimeUtc value. - */ - public OffsetDateTime creationTimeUtc() { - return this.creationTimeUtc; - } - - /** - * Get the securityTaskParameters property: Changing set of properties, depending on the task type that is derived - * from the name field. - * - * @return the securityTaskParameters value. - */ - public SecurityTaskParameters securityTaskParameters() { - return this.securityTaskParameters; - } - - /** - * Set the securityTaskParameters property: Changing set of properties, depending on the task type that is derived - * from the name field. - * - * @param securityTaskParameters the securityTaskParameters value to set. - * @return the SecurityTaskProperties object itself. - */ - public SecurityTaskProperties withSecurityTaskParameters(SecurityTaskParameters securityTaskParameters) { - this.securityTaskParameters = securityTaskParameters; - return this; - } - - /** - * Get the lastStateChangeTimeUtc property: The time this task's details were last changed in UTC. - * - * @return the lastStateChangeTimeUtc value. - */ - public OffsetDateTime lastStateChangeTimeUtc() { - return this.lastStateChangeTimeUtc; - } - - /** - * Get the subState property: Additional data on the state of the task. - * - * @return the subState value. - */ - public String subState() { - return this.subState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (securityTaskParameters() != null) { - securityTaskParameters().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentInner.java deleted file mode 100644 index d8d3765bebf7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentInner.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.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentPropertiesProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the server vulnerability assessment details on a resource. */ -@Immutable -public final class ServerVulnerabilityAssessmentInner extends ProxyResource { - /* - * describes ServerVulnerabilityAssessment properties. - */ - @JsonProperty(value = "properties") - private ServerVulnerabilityAssessmentProperties innerProperties; - - /** Creates an instance of ServerVulnerabilityAssessmentInner class. */ - public ServerVulnerabilityAssessmentInner() { - } - - /** - * Get the innerProperties property: describes ServerVulnerabilityAssessment properties. - * - * @return the innerProperties value. - */ - private ServerVulnerabilityAssessmentProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the provisioningState property: The provisioningState of the vulnerability assessment capability on the VM. - * - * @return the provisioningState value. - */ - public ServerVulnerabilityAssessmentPropertiesProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentProperties.java deleted file mode 100644 index aa33e32ee0b7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentProperties.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentPropertiesProvisioningState; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** describes ServerVulnerabilityAssessment properties. */ -@Immutable -public final class ServerVulnerabilityAssessmentProperties { - /* - * The provisioningState of the vulnerability assessment capability on the VM - */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) - private ServerVulnerabilityAssessmentPropertiesProvisioningState provisioningState; - - /** Creates an instance of ServerVulnerabilityAssessmentProperties class. */ - public ServerVulnerabilityAssessmentProperties() { - } - - /** - * Get the provisioningState property: The provisioningState of the vulnerability assessment capability on the VM. - * - * @return the provisioningState value. - */ - public ServerVulnerabilityAssessmentPropertiesProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsListInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsListInner.java deleted file mode 100644 index 7c7f8bfb21fe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/ServerVulnerabilityAssessmentsListInner.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.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of server vulnerability assessments. */ -@Fluent -public final class ServerVulnerabilityAssessmentsListInner { - /* - * The value property. - */ - @JsonProperty(value = "value") - private List value; - - /** Creates an instance of ServerVulnerabilityAssessmentsListInner class. */ - public ServerVulnerabilityAssessmentsListInner() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the ServerVulnerabilityAssessmentsListInner object itself. - */ - public ServerVulnerabilityAssessmentsListInner 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/SettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SettingInner.java deleted file mode 100644 index b59fbee9d4eb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SettingInner.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.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.AlertSyncSettings; -import com.azure.resourcemanager.security.models.DataExportSettings; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The kind of the security setting. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = SettingInner.class) -@JsonTypeName("Setting") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "DataExportSettings", value = DataExportSettings.class), - @JsonSubTypes.Type(name = "AlertSyncSettings", value = AlertSyncSettings.class) -}) -@Immutable -public class SettingInner extends ProxyResource { - /** Creates an instance of SettingInner class. */ - public SettingInner() { - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareInner.java deleted file mode 100644 index 79b16ad3b98b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareInner.java +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents a software data. */ -@Fluent -public final class SoftwareInner extends ProxyResource { - /* - * Properties of the Software Inventory resource - */ - @JsonProperty(value = "properties", required = true) - private SoftwareProperties innerProperties = new SoftwareProperties(); - - /** Creates an instance of SoftwareInner class. */ - public SoftwareInner() { - } - - /** - * Get the innerProperties property: Properties of the Software Inventory resource. - * - * @return the innerProperties value. - */ - private SoftwareProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the deviceId property: Unique identifier for the virtual machine in the service. - * - * @return the deviceId value. - */ - public String deviceId() { - return this.innerProperties() == null ? null : this.innerProperties().deviceId(); - } - - /** - * Set the deviceId property: Unique identifier for the virtual machine in the service. - * - * @param deviceId the deviceId value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withDeviceId(String deviceId) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withDeviceId(deviceId); - return this; - } - - /** - * Get the osPlatform property: Platform of the operating system running on the device. - * - * @return the osPlatform value. - */ - public String osPlatform() { - return this.innerProperties() == null ? null : this.innerProperties().osPlatform(); - } - - /** - * Set the osPlatform property: Platform of the operating system running on the device. - * - * @param osPlatform the osPlatform value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withOsPlatform(String osPlatform) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withOsPlatform(osPlatform); - return this; - } - - /** - * Get the vendor property: Name of the software vendor. - * - * @return the vendor value. - */ - public String vendor() { - return this.innerProperties() == null ? null : this.innerProperties().vendor(); - } - - /** - * Set the vendor property: Name of the software vendor. - * - * @param vendor the vendor value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withVendor(String vendor) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withVendor(vendor); - return this; - } - - /** - * Get the softwareName property: Name of the software product. - * - * @return the softwareName value. - */ - public String softwareName() { - return this.innerProperties() == null ? null : this.innerProperties().softwareName(); - } - - /** - * Set the softwareName property: Name of the software product. - * - * @param softwareName the softwareName value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withSoftwareName(String softwareName) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withSoftwareName(softwareName); - return this; - } - - /** - * Get the version property: Version number of the software product. - * - * @return the version value. - */ - public String version() { - return this.innerProperties() == null ? null : this.innerProperties().version(); - } - - /** - * Set the version property: Version number of the software product. - * - * @param version the version value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withVersion(String version) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withVersion(version); - return this; - } - - /** - * Get the endOfSupportStatus property: End of support status. - * - * @return the endOfSupportStatus value. - */ - public EndOfSupportStatus endOfSupportStatus() { - return this.innerProperties() == null ? null : this.innerProperties().endOfSupportStatus(); - } - - /** - * Set the endOfSupportStatus property: End of support status. - * - * @param endOfSupportStatus the endOfSupportStatus value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withEndOfSupportStatus(EndOfSupportStatus endOfSupportStatus) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withEndOfSupportStatus(endOfSupportStatus); - return this; - } - - /** - * Get the endOfSupportDate property: The end of support date in case the product is upcoming end of support. - * - * @return the endOfSupportDate value. - */ - public String endOfSupportDate() { - return this.innerProperties() == null ? null : this.innerProperties().endOfSupportDate(); - } - - /** - * Set the endOfSupportDate property: The end of support date in case the product is upcoming end of support. - * - * @param endOfSupportDate the endOfSupportDate value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withEndOfSupportDate(String endOfSupportDate) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withEndOfSupportDate(endOfSupportDate); - return this; - } - - /** - * Get the numberOfKnownVulnerabilities property: Number of weaknesses. - * - * @return the numberOfKnownVulnerabilities value. - */ - public Integer numberOfKnownVulnerabilities() { - return this.innerProperties() == null ? null : this.innerProperties().numberOfKnownVulnerabilities(); - } - - /** - * Set the numberOfKnownVulnerabilities property: Number of weaknesses. - * - * @param numberOfKnownVulnerabilities the numberOfKnownVulnerabilities value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withNumberOfKnownVulnerabilities(Integer numberOfKnownVulnerabilities) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withNumberOfKnownVulnerabilities(numberOfKnownVulnerabilities); - return this; - } - - /** - * Get the firstSeenAt property: First time that the software was seen in the device. - * - * @return the firstSeenAt value. - */ - public String firstSeenAt() { - return this.innerProperties() == null ? null : this.innerProperties().firstSeenAt(); - } - - /** - * Set the firstSeenAt property: First time that the software was seen in the device. - * - * @param firstSeenAt the firstSeenAt value to set. - * @return the SoftwareInner object itself. - */ - public SoftwareInner withFirstSeenAt(String firstSeenAt) { - if (this.innerProperties() == null) { - this.innerProperties = new SoftwareProperties(); - } - this.innerProperties().withFirstSeenAt(firstSeenAt); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model SoftwareInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SoftwareInner.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareProperties.java deleted file mode 100644 index 7e927b4a0347..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/SoftwareProperties.java +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Software Inventory resource properties. */ -@Fluent -public final class SoftwareProperties { - /* - * Unique identifier for the virtual machine in the service. - */ - @JsonProperty(value = "deviceId") - private String deviceId; - - /* - * Platform of the operating system running on the device. - */ - @JsonProperty(value = "osPlatform") - private String osPlatform; - - /* - * Name of the software vendor. - */ - @JsonProperty(value = "vendor") - private String vendor; - - /* - * Name of the software product. - */ - @JsonProperty(value = "softwareName") - private String softwareName; - - /* - * Version number of the software product. - */ - @JsonProperty(value = "version") - private String version; - - /* - * End of support status. - */ - @JsonProperty(value = "endOfSupportStatus") - private EndOfSupportStatus endOfSupportStatus; - - /* - * The end of support date in case the product is upcoming end of support. - */ - @JsonProperty(value = "endOfSupportDate") - private String endOfSupportDate; - - /* - * Number of weaknesses. - */ - @JsonProperty(value = "numberOfKnownVulnerabilities") - private Integer numberOfKnownVulnerabilities; - - /* - * First time that the software was seen in the device. - */ - @JsonProperty(value = "firstSeenAt") - private String firstSeenAt; - - /** Creates an instance of SoftwareProperties class. */ - public SoftwareProperties() { - } - - /** - * Get the deviceId property: Unique identifier for the virtual machine in the service. - * - * @return the deviceId value. - */ - public String deviceId() { - return this.deviceId; - } - - /** - * Set the deviceId property: Unique identifier for the virtual machine in the service. - * - * @param deviceId the deviceId value to set. - * @return the SoftwareProperties object itself. - */ - public SoftwareProperties withDeviceId(String deviceId) { - this.deviceId = deviceId; - return this; - } - - /** - * Get the osPlatform property: Platform of the operating system running on the device. - * - * @return the osPlatform value. - */ - public String osPlatform() { - return this.osPlatform; - } - - /** - * Set the osPlatform property: Platform of the operating system running on the device. - * - * @param osPlatform the osPlatform value to set. - * @return the SoftwareProperties object itself. - */ - public SoftwareProperties withOsPlatform(String osPlatform) { - this.osPlatform = osPlatform; - return this; - } - - /** - * Get the vendor property: Name of the software vendor. - * - * @return the vendor value. - */ - public String vendor() { - return this.vendor; - } - - /** - * Set the vendor property: Name of the software vendor. - * - * @param vendor the vendor value to set. - * @return the SoftwareProperties object itself. - */ - public SoftwareProperties withVendor(String vendor) { - this.vendor = vendor; - return this; - } - - /** - * Get the softwareName property: Name of the software product. - * - * @return the softwareName value. - */ - public String softwareName() { - return this.softwareName; - } - - /** - * Set the softwareName property: Name of the software product. - * - * @param softwareName the softwareName value to set. - * @return the SoftwareProperties object itself. - */ - public SoftwareProperties withSoftwareName(String softwareName) { - this.softwareName = softwareName; - return this; - } - - /** - * Get the version property: Version number of the software product. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: Version number of the software product. - * - * @param version the version value to set. - * @return the SoftwareProperties object itself. - */ - public SoftwareProperties withVersion(String version) { - this.version = version; - return this; - } - - /** - * Get the endOfSupportStatus property: End of support status. - * - * @return the endOfSupportStatus value. - */ - public EndOfSupportStatus endOfSupportStatus() { - return this.endOfSupportStatus; - } - - /** - * Set the endOfSupportStatus property: End of support status. - * - * @param endOfSupportStatus the endOfSupportStatus value to set. - * @return the SoftwareProperties object itself. - */ - public SoftwareProperties withEndOfSupportStatus(EndOfSupportStatus endOfSupportStatus) { - this.endOfSupportStatus = endOfSupportStatus; - return this; - } - - /** - * Get the endOfSupportDate property: The end of support date in case the product is upcoming end of support. - * - * @return the endOfSupportDate value. - */ - public String endOfSupportDate() { - return this.endOfSupportDate; - } - - /** - * Set the endOfSupportDate property: The end of support date in case the product is upcoming end of support. - * - * @param endOfSupportDate the endOfSupportDate value to set. - * @return the SoftwareProperties object itself. - */ - public SoftwareProperties withEndOfSupportDate(String endOfSupportDate) { - this.endOfSupportDate = endOfSupportDate; - return this; - } - - /** - * Get the numberOfKnownVulnerabilities property: Number of weaknesses. - * - * @return the numberOfKnownVulnerabilities value. - */ - public Integer numberOfKnownVulnerabilities() { - return this.numberOfKnownVulnerabilities; - } - - /** - * Set the numberOfKnownVulnerabilities property: Number of weaknesses. - * - * @param numberOfKnownVulnerabilities the numberOfKnownVulnerabilities value to set. - * @return the SoftwareProperties object itself. - */ - public SoftwareProperties withNumberOfKnownVulnerabilities(Integer numberOfKnownVulnerabilities) { - this.numberOfKnownVulnerabilities = numberOfKnownVulnerabilities; - return this; - } - - /** - * Get the firstSeenAt property: First time that the software was seen in the device. - * - * @return the firstSeenAt value. - */ - public String firstSeenAt() { - return this.firstSeenAt; - } - - /** - * Set the firstSeenAt property: First time that the software was seen in the device. - * - * @param firstSeenAt the firstSeenAt value to set. - * @return the SoftwareProperties object itself. - */ - public SoftwareProperties withFirstSeenAt(String firstSeenAt) { - this.firstSeenAt = firstSeenAt; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceInner.java deleted file mode 100644 index 46ac4e99ca12..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceInner.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.models.TopologySingleResource; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The TopologyResource model. */ -@Immutable -public final class TopologyResourceInner extends ProxyResource { - /* - * The properties property. - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private TopologyResourceProperties innerProperties; - - /* - * Location where the resource is stored - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /** Creates an instance of TopologyResourceInner class. */ - public TopologyResourceInner() { - } - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private TopologyResourceProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the calculatedDateTime property: The UTC time on which the topology was calculated. - * - * @return the calculatedDateTime value. - */ - public OffsetDateTime calculatedDateTime() { - return this.innerProperties() == null ? null : this.innerProperties().calculatedDateTime(); - } - - /** - * Get the topologyResources property: Azure resources which are part of this topology resource. - * - * @return the topologyResources value. - */ - public List topologyResources() { - return this.innerProperties() == null ? null : this.innerProperties().topologyResources(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceProperties.java deleted file mode 100644 index daa7e08a0025..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/TopologyResourceProperties.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.security.models.TopologySingleResource; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The TopologyResourceProperties model. */ -@Immutable -public final class TopologyResourceProperties { - /* - * The UTC time on which the topology was calculated - */ - @JsonProperty(value = "calculatedDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime calculatedDateTime; - - /* - * Azure resources which are part of this topology resource - */ - @JsonProperty(value = "topologyResources", access = JsonProperty.Access.WRITE_ONLY) - private List topologyResources; - - /** Creates an instance of TopologyResourceProperties class. */ - public TopologyResourceProperties() { - } - - /** - * Get the calculatedDateTime property: The UTC time on which the topology was calculated. - * - * @return the calculatedDateTime value. - */ - public OffsetDateTime calculatedDateTime() { - return this.calculatedDateTime; - } - - /** - * Get the topologyResources property: Azure resources which are part of this topology resource. - * - * @return the topologyResources value. - */ - public List topologyResources() { - return this.topologyResources; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (topologyResources() != null) { - topologyResources().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/UpdateIoTSecuritySolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/UpdateIoTSecuritySolutionProperties.java deleted file mode 100644 index f2bf349d65c3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/UpdateIoTSecuritySolutionProperties.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Update Security Solution setting data. */ -@Fluent -public final class UpdateIoTSecuritySolutionProperties { - /* - * Properties of the IoT Security solution's user defined resources. - */ - @JsonProperty(value = "userDefinedResources") - private UserDefinedResourcesProperties userDefinedResources; - - /* - * List of the configuration status for each recommendation type. - */ - @JsonProperty(value = "recommendationsConfiguration") - private List recommendationsConfiguration; - - /** Creates an instance of UpdateIoTSecuritySolutionProperties class. */ - public UpdateIoTSecuritySolutionProperties() { - } - - /** - * Get the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @return the userDefinedResources value. - */ - public UserDefinedResourcesProperties userDefinedResources() { - return this.userDefinedResources; - } - - /** - * Set the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @param userDefinedResources the userDefinedResources value to set. - * @return the UpdateIoTSecuritySolutionProperties object itself. - */ - public UpdateIoTSecuritySolutionProperties withUserDefinedResources( - UserDefinedResourcesProperties userDefinedResources) { - this.userDefinedResources = userDefinedResources; - return this; - } - - /** - * Get the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @return the recommendationsConfiguration value. - */ - public List recommendationsConfiguration() { - return this.recommendationsConfiguration; - } - - /** - * Set the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @param recommendationsConfiguration the recommendationsConfiguration value to set. - * @return the UpdateIoTSecuritySolutionProperties object itself. - */ - public UpdateIoTSecuritySolutionProperties withRecommendationsConfiguration( - List recommendationsConfiguration) { - this.recommendationsConfiguration = recommendationsConfiguration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userDefinedResources() != null) { - userDefinedResources().validate(); - } - if (recommendationsConfiguration() != null) { - recommendationsConfiguration().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingInner.java deleted file mode 100644 index d6be77efcba1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingInner.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.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configures where to store the OMS agent data for workspaces under a scope. */ -@Fluent -public final class WorkspaceSettingInner extends ProxyResource { - /* - * Workspace setting data - */ - @JsonProperty(value = "properties") - private WorkspaceSettingProperties innerProperties; - - /** Creates an instance of WorkspaceSettingInner class. */ - public WorkspaceSettingInner() { - } - - /** - * Get the innerProperties property: Workspace setting data. - * - * @return the innerProperties value. - */ - private WorkspaceSettingProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the workspaceId property: The full Azure ID of the workspace to save the data in. - * - * @return the workspaceId value. - */ - public String workspaceId() { - return this.innerProperties() == null ? null : this.innerProperties().workspaceId(); - } - - /** - * Set the workspaceId property: The full Azure ID of the workspace to save the data in. - * - * @param workspaceId the workspaceId value to set. - * @return the WorkspaceSettingInner object itself. - */ - public WorkspaceSettingInner withWorkspaceId(String workspaceId) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspaceSettingProperties(); - } - this.innerProperties().withWorkspaceId(workspaceId); - return this; - } - - /** - * Get the scope property: All the VMs in this scope will send their security data to the mentioned workspace unless - * overridden by a setting with more specific scope. - * - * @return the scope value. - */ - public String scope() { - return this.innerProperties() == null ? null : this.innerProperties().scope(); - } - - /** - * Set the scope property: All the VMs in this scope will send their security data to the mentioned workspace unless - * overridden by a setting with more specific scope. - * - * @param scope the scope value to set. - * @return the WorkspaceSettingInner object itself. - */ - public WorkspaceSettingInner withScope(String scope) { - if (this.innerProperties() == null) { - this.innerProperties = new WorkspaceSettingProperties(); - } - this.innerProperties().withScope(scope); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingProperties.java deleted file mode 100644 index 4b9e5b362af5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/WorkspaceSettingProperties.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Workspace setting data. */ -@Fluent -public final class WorkspaceSettingProperties { - /* - * The full Azure ID of the workspace to save the data in - */ - @JsonProperty(value = "workspaceId", required = true) - private String workspaceId; - - /* - * All the VMs in this scope will send their security data to the mentioned workspace unless overridden by a - * setting with more specific scope - */ - @JsonProperty(value = "scope", required = true) - private String scope; - - /** Creates an instance of WorkspaceSettingProperties class. */ - public WorkspaceSettingProperties() { - } - - /** - * Get the workspaceId property: The full Azure ID of the workspace to save the data in. - * - * @return the workspaceId value. - */ - public String workspaceId() { - return this.workspaceId; - } - - /** - * Set the workspaceId property: The full Azure ID of the workspace to save the data in. - * - * @param workspaceId the workspaceId value to set. - * @return the WorkspaceSettingProperties object itself. - */ - public WorkspaceSettingProperties withWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId; - return this; - } - - /** - * Get the scope property: All the VMs in this scope will send their security data to the mentioned workspace unless - * overridden by a setting with more specific scope. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - - /** - * Set the scope property: All the VMs in this scope will send their security data to the mentioned workspace unless - * overridden by a setting with more specific scope. - * - * @param scope the scope value to set. - * @return the WorkspaceSettingProperties object itself. - */ - public WorkspaceSettingProperties withScope(String scope) { - this.scope = scope; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (workspaceId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property workspaceId in model WorkspaceSettingProperties")); - } - if (scope() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property scope in model WorkspaceSettingProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(WorkspaceSettingProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/package-info.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/package-info.java deleted file mode 100644 index c572ad42092c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the inner data models for SecurityCenter. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ -package com.azure.resourcemanager.security.fluent.models; diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/package-info.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/package-info.java deleted file mode 100644 index e13426491bd0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the service clients for SecurityCenter. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ -package com.azure.resourcemanager.security.fluent; diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupImpl.java deleted file mode 100644 index dac890dface4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupImpl.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupInner; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroup; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlIssueSummary; -import com.azure.resourcemanager.security.models.ConfigurationStatus; -import com.azure.resourcemanager.security.models.EnforcementMode; -import com.azure.resourcemanager.security.models.PathRecommendation; -import com.azure.resourcemanager.security.models.ProtectionMode; -import com.azure.resourcemanager.security.models.RecommendationStatus; -import com.azure.resourcemanager.security.models.SourceSystem; -import com.azure.resourcemanager.security.models.VmRecommendation; -import java.util.Collections; -import java.util.List; - -public final class AdaptiveApplicationControlGroupImpl - implements AdaptiveApplicationControlGroup, - AdaptiveApplicationControlGroup.Definition, - AdaptiveApplicationControlGroup.Update { - private AdaptiveApplicationControlGroupInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public EnforcementMode enforcementMode() { - return this.innerModel().enforcementMode(); - } - - public ProtectionMode protectionMode() { - return this.innerModel().protectionMode(); - } - - public ConfigurationStatus configurationStatus() { - return this.innerModel().configurationStatus(); - } - - public RecommendationStatus recommendationStatus() { - return this.innerModel().recommendationStatus(); - } - - public List issues() { - List inner = this.innerModel().issues(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public SourceSystem sourceSystem() { - return this.innerModel().sourceSystem(); - } - - public List vmRecommendations() { - List inner = this.innerModel().vmRecommendations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List pathRecommendations() { - List inner = this.innerModel().pathRecommendations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public AdaptiveApplicationControlGroupInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String ascLocation; - - private String groupName; - - public AdaptiveApplicationControlGroupImpl withExistingLocation(String ascLocation) { - this.ascLocation = ascLocation; - return this; - } - - public AdaptiveApplicationControlGroup create() { - this.innerObject = - serviceManager - .serviceClient() - .getAdaptiveApplicationControls() - .putWithResponse(ascLocation, groupName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public AdaptiveApplicationControlGroup create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAdaptiveApplicationControls() - .putWithResponse(ascLocation, groupName, this.innerModel(), context) - .getValue(); - return this; - } - - AdaptiveApplicationControlGroupImpl( - String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AdaptiveApplicationControlGroupInner(); - this.serviceManager = serviceManager; - this.groupName = name; - } - - public AdaptiveApplicationControlGroupImpl update() { - return this; - } - - public AdaptiveApplicationControlGroup apply() { - this.innerObject = - serviceManager - .serviceClient() - .getAdaptiveApplicationControls() - .putWithResponse(ascLocation, groupName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public AdaptiveApplicationControlGroup apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAdaptiveApplicationControls() - .putWithResponse(ascLocation, groupName, this.innerModel(), context) - .getValue(); - return this; - } - - AdaptiveApplicationControlGroupImpl( - AdaptiveApplicationControlGroupInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.ascLocation = Utils.getValueFromIdByName(innerObject.id(), "locations"); - this.groupName = Utils.getValueFromIdByName(innerObject.id(), "applicationWhitelistings"); - } - - public AdaptiveApplicationControlGroup refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getAdaptiveApplicationControls() - .getWithResponse(ascLocation, groupName, Context.NONE) - .getValue(); - return this; - } - - public AdaptiveApplicationControlGroup refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAdaptiveApplicationControls() - .getWithResponse(ascLocation, groupName, context) - .getValue(); - return this; - } - - public AdaptiveApplicationControlGroupImpl withEnforcementMode(EnforcementMode enforcementMode) { - this.innerModel().withEnforcementMode(enforcementMode); - return this; - } - - public AdaptiveApplicationControlGroupImpl withProtectionMode(ProtectionMode protectionMode) { - this.innerModel().withProtectionMode(protectionMode); - return this; - } - - public AdaptiveApplicationControlGroupImpl withVmRecommendations(List vmRecommendations) { - this.innerModel().withVmRecommendations(vmRecommendations); - return this; - } - - public AdaptiveApplicationControlGroupImpl withPathRecommendations(List pathRecommendations) { - this.innerModel().withPathRecommendations(pathRecommendations); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupsImpl.java deleted file mode 100644 index ed7a53c75298..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlGroupsImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupInner; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupsInner; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroup; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroups; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class AdaptiveApplicationControlGroupsImpl implements AdaptiveApplicationControlGroups { - private AdaptiveApplicationControlGroupsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AdaptiveApplicationControlGroupsImpl( - AdaptiveApplicationControlGroupsInner 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 AdaptiveApplicationControlGroupImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public AdaptiveApplicationControlGroupsInner 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/AdaptiveApplicationControlsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsClientImpl.java deleted file mode 100644 index f5377cd34583..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsClientImpl.java +++ /dev/null @@ -1,702 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.AdaptiveApplicationControlsClient; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupInner; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupsInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AdaptiveApplicationControlsClient. */ -public final class AdaptiveApplicationControlsClientImpl implements AdaptiveApplicationControlsClient { - /** The proxy service used to perform REST calls. */ - private final AdaptiveApplicationControlsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AdaptiveApplicationControlsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AdaptiveApplicationControlsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - AdaptiveApplicationControlsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAdaptiveApplicationControls to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAdapti") - public interface AdaptiveApplicationControlsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @QueryParam("includePathRecommendations") Boolean includePathRecommendations, - @QueryParam("summary") Boolean summary, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("groupName") String groupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> put( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("groupName") String groupName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AdaptiveApplicationControlGroupInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("groupName") String groupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of application control machine groups for the subscription. - * - * @param includePathRecommendations Include the policy rules. - * @param summary Return output in a summarized form. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 application control machine groups for the subscription along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - Boolean includePathRecommendations, Boolean summary) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - includePathRecommendations, - summary, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of application control machine groups for the subscription. - * - * @param includePathRecommendations Include the policy rules. - * @param summary Return output in a summarized form. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 application control machine groups for the subscription along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - Boolean includePathRecommendations, Boolean summary, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - apiVersion, - includePathRecommendations, - summary, - accept, - context); - } - - /** - * Gets a list of application control machine groups for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of application control machine groups for the subscription on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - final Boolean includePathRecommendations = null; - final Boolean summary = null; - return listWithResponseAsync(includePathRecommendations, summary) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a list of application control machine groups for the subscription. - * - * @param includePathRecommendations Include the policy rules. - * @param summary Return output in a summarized form. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 application control machine groups for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - Boolean includePathRecommendations, Boolean summary, Context context) { - return listWithResponseAsync(includePathRecommendations, summary, context).block(); - } - - /** - * Gets a list of application control machine groups for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of application control machine groups for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdaptiveApplicationControlGroupsInner list() { - final Boolean includePathRecommendations = null; - final Boolean summary = null; - return listWithResponse(includePathRecommendations, summary, Context.NONE).getValue(); - } - - /** - * Gets an application control VM/server group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application control VM/server group along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String ascLocation, String groupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - groupName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets an application control VM/server group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application control VM/server group along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String ascLocation, String groupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - groupName, - apiVersion, - accept, - context); - } - - /** - * Gets an application control VM/server group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application control VM/server group on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String ascLocation, String groupName) { - return getWithResponseAsync(ascLocation, groupName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets an application control VM/server group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application control VM/server group along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String ascLocation, String groupName, Context context) { - return getWithResponseAsync(ascLocation, groupName, context).block(); - } - - /** - * Gets an application control VM/server group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application control VM/server group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdaptiveApplicationControlGroupInner get(String ascLocation, String groupName) { - return getWithResponse(ascLocation, groupName, Context.NONE).getValue(); - } - - /** - * Update an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param body The body 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 the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync( - String ascLocation, String groupName, AdaptiveApplicationControlGroupInner 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 (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .put( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - groupName, - apiVersion, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param body The body 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 the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync( - String ascLocation, String groupName, AdaptiveApplicationControlGroupInner 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 (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName 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-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .put( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - groupName, - apiVersion, - body, - accept, - context); - } - - /** - * Update an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param body The body 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 the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono putAsync( - String ascLocation, String groupName, AdaptiveApplicationControlGroupInner body) { - return putWithResponseAsync(ascLocation, groupName, body).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Update an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param body The body 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 the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putWithResponse( - String ascLocation, String groupName, AdaptiveApplicationControlGroupInner body, Context context) { - return putWithResponseAsync(ascLocation, groupName, body, context).block(); - } - - /** - * Update an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param body The body 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 the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdaptiveApplicationControlGroupInner put( - String ascLocation, String groupName, AdaptiveApplicationControlGroupInner body) { - return putWithResponse(ascLocation, groupName, body, Context.NONE).getValue(); - } - - /** - * Delete an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String ascLocation, String groupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - groupName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String ascLocation, String groupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - groupName, - apiVersion, - accept, - context); - } - - /** - * Delete an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String ascLocation, String groupName) { - return deleteWithResponseAsync(ascLocation, groupName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String ascLocation, String groupName, Context context) { - return deleteWithResponseAsync(ascLocation, groupName, context).block(); - } - - /** - * Delete an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String ascLocation, String groupName) { - deleteWithResponse(ascLocation, groupName, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsImpl.java deleted file mode 100644 index df7f0426fc39..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveApplicationControlsImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.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.AdaptiveApplicationControlsClient; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupInner; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupsInner; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroup; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroups; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControls; - -public final class AdaptiveApplicationControlsImpl implements AdaptiveApplicationControls { - private static final ClientLogger LOGGER = new ClientLogger(AdaptiveApplicationControlsImpl.class); - - private final AdaptiveApplicationControlsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AdaptiveApplicationControlsImpl( - AdaptiveApplicationControlsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listWithResponse( - Boolean includePathRecommendations, Boolean summary, Context context) { - Response inner = - this.serviceClient().listWithResponse(includePathRecommendations, summary, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AdaptiveApplicationControlGroupsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AdaptiveApplicationControlGroups list() { - AdaptiveApplicationControlGroupsInner inner = this.serviceClient().list(); - if (inner != null) { - return new AdaptiveApplicationControlGroupsImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String ascLocation, String groupName, Context context) { - Response inner = - this.serviceClient().getWithResponse(ascLocation, groupName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AdaptiveApplicationControlGroupImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AdaptiveApplicationControlGroup get(String ascLocation, String groupName) { - AdaptiveApplicationControlGroupInner inner = this.serviceClient().get(ascLocation, groupName); - if (inner != null) { - return new AdaptiveApplicationControlGroupImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String ascLocation, String groupName, Context context) { - return this.serviceClient().deleteWithResponse(ascLocation, groupName, context); - } - - public void deleteByResourceGroup(String ascLocation, String groupName) { - this.serviceClient().delete(ascLocation, groupName); - } - - public AdaptiveApplicationControlGroup getById(String id) { - String ascLocation = Utils.getValueFromIdByName(id, "locations"); - if (ascLocation == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); - } - String groupName = Utils.getValueFromIdByName(id, "applicationWhitelistings"); - if (groupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationWhitelistings'.", - id))); - } - return this.getWithResponse(ascLocation, groupName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String ascLocation = Utils.getValueFromIdByName(id, "locations"); - if (ascLocation == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); - } - String groupName = Utils.getValueFromIdByName(id, "applicationWhitelistings"); - if (groupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationWhitelistings'.", - id))); - } - return this.getWithResponse(ascLocation, groupName, context); - } - - public void deleteById(String id) { - String ascLocation = Utils.getValueFromIdByName(id, "locations"); - if (ascLocation == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); - } - String groupName = Utils.getValueFromIdByName(id, "applicationWhitelistings"); - if (groupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationWhitelistings'.", - id))); - } - this.deleteByResourceGroupWithResponse(ascLocation, groupName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String ascLocation = Utils.getValueFromIdByName(id, "locations"); - if (ascLocation == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); - } - String groupName = Utils.getValueFromIdByName(id, "applicationWhitelistings"); - if (groupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'applicationWhitelistings'.", - id))); - } - return this.deleteByResourceGroupWithResponse(ascLocation, groupName, context); - } - - private AdaptiveApplicationControlsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AdaptiveApplicationControlGroupImpl define(String name) { - return new AdaptiveApplicationControlGroupImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningImpl.java deleted file mode 100644 index c07af0ebfddc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningInner; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardening; -import com.azure.resourcemanager.security.models.EffectiveNetworkSecurityGroups; -import com.azure.resourcemanager.security.models.Rule; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class AdaptiveNetworkHardeningImpl implements AdaptiveNetworkHardening { - private AdaptiveNetworkHardeningInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AdaptiveNetworkHardeningImpl( - AdaptiveNetworkHardeningInner 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 List rules() { - List inner = this.innerModel().rules(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OffsetDateTime rulesCalculationTime() { - return this.innerModel().rulesCalculationTime(); - } - - public List effectiveNetworkSecurityGroups() { - List inner = this.innerModel().effectiveNetworkSecurityGroups(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public AdaptiveNetworkHardeningInner 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/AdaptiveNetworkHardeningsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsClientImpl.java deleted file mode 100644 index 923dc53de886..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsClientImpl.java +++ /dev/null @@ -1,1128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.AdaptiveNetworkHardeningsClient; -import com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningInner; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningEnforceRequest; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningsList; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AdaptiveNetworkHardeningsClient. */ -public final class AdaptiveNetworkHardeningsClientImpl implements AdaptiveNetworkHardeningsClient { - /** The proxy service used to perform REST calls. */ - private final AdaptiveNetworkHardeningsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AdaptiveNetworkHardeningsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AdaptiveNetworkHardeningsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - AdaptiveNetworkHardeningsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAdaptiveNetworkHardenings to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAdapti") - public interface AdaptiveNetworkHardeningsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByExtendedResource( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @PathParam("adaptiveNetworkHardeningResourceName") String adaptiveNetworkHardeningResourceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> enforce( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @PathParam("adaptiveNetworkHardeningResourceName") String adaptiveNetworkHardeningResourceName, - @PathParam("adaptiveNetworkHardeningEnforceAction") String adaptiveNetworkHardeningEnforceAction, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") AdaptiveNetworkHardeningEnforceRequest body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByExtendedResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Adaptive Network Hardenings resources in scope of an extended resource along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceSinglePageAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByExtendedResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Adaptive Network Hardenings resources in scope of an extended resource along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceSinglePageAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByExtendedResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByExtendedResourceAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return new PagedFlux<>( - () -> - listByExtendedResourceSinglePageAsync(resourceGroupName, resourceNamespace, resourceType, resourceName), - nextLink -> listByExtendedResourceNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByExtendedResourceAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - return new PagedFlux<>( - () -> - listByExtendedResourceSinglePageAsync( - resourceGroupName, resourceNamespace, resourceType, resourceName, context), - nextLink -> listByExtendedResourceNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return new PagedIterable<>( - listByExtendedResourceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName)); - } - - /** - * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - return new PagedIterable<>( - listByExtendedResourceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context)); - } - - /** - * Gets a single Adaptive Network Hardening resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single Adaptive Network Hardening resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (adaptiveNetworkHardeningResourceName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter adaptiveNetworkHardeningResourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a single Adaptive Network Hardening resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single Adaptive Network Hardening resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (adaptiveNetworkHardeningResourceName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter adaptiveNetworkHardeningResourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - apiVersion, - accept, - context); - } - - /** - * Gets a single Adaptive Network Hardening resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single Adaptive Network Hardening resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName) { - return getWithResponseAsync( - resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a single Adaptive Network Hardening resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single Adaptive Network Hardening resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - Context context) { - return getWithResponseAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - context) - .block(); - } - - /** - * Gets a single Adaptive Network Hardening resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single Adaptive Network Hardening resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdaptiveNetworkHardeningInner get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName) { - return getWithResponse( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - Context.NONE) - .getValue(); - } - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body 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 the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> enforceWithResponseAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (adaptiveNetworkHardeningResourceName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter adaptiveNetworkHardeningResourceName 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 adaptiveNetworkHardeningEnforceAction = "enforce"; - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .enforce( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - adaptiveNetworkHardeningEnforceAction, - apiVersion, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body 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 the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> enforceWithResponseAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (adaptiveNetworkHardeningResourceName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter adaptiveNetworkHardeningResourceName 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 adaptiveNetworkHardeningEnforceAction = "enforce"; - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .enforce( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - adaptiveNetworkHardeningEnforceAction, - apiVersion, - body, - accept, - context); - } - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body 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 the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginEnforceAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body) { - Mono>> mono = - enforceWithResponseAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body 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 the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginEnforceAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - enforceWithResponseAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body, - context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body 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 the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginEnforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body) { - return this - .beginEnforceAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body) - .getSyncPoller(); - } - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body 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 the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginEnforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context) { - return this - .beginEnforceAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body, - context) - .getSyncPoller(); - } - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono enforceAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body) { - return beginEnforceAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono enforceAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context) { - return beginEnforceAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body, - context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body) { - enforceAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body) - .block(); - } - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context) { - enforceAsync( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body, - context) - .block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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 response for ListAdaptiveNetworkHardenings API service call along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByExtendedResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsImpl.java deleted file mode 100644 index afcb58db5f23..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdaptiveNetworkHardeningsImpl.java +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.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.AdaptiveNetworkHardeningsClient; -import com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningInner; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardening; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningEnforceRequest; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardenings; - -public final class AdaptiveNetworkHardeningsImpl implements AdaptiveNetworkHardenings { - private static final ClientLogger LOGGER = new ClientLogger(AdaptiveNetworkHardeningsImpl.class); - - private final AdaptiveNetworkHardeningsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AdaptiveNetworkHardeningsImpl( - AdaptiveNetworkHardeningsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - PagedIterable inner = - this - .serviceClient() - .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName); - return Utils.mapPage(inner, inner1 -> new AdaptiveNetworkHardeningImpl(inner1, this.manager())); - } - - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - PagedIterable inner = - this - .serviceClient() - .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName, context); - return Utils.mapPage(inner, inner1 -> new AdaptiveNetworkHardeningImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - Context context) { - Response inner = - this - .serviceClient() - .getWithResponse( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AdaptiveNetworkHardeningImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AdaptiveNetworkHardening get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName) { - AdaptiveNetworkHardeningInner inner = - this - .serviceClient() - .get( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName); - if (inner != null) { - return new AdaptiveNetworkHardeningImpl(inner, this.manager()); - } else { - return null; - } - } - - public void enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body) { - this - .serviceClient() - .enforce( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body); - } - - public void enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context) { - this - .serviceClient() - .enforce( - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - adaptiveNetworkHardeningResourceName, - body, - context); - } - - private AdaptiveNetworkHardeningsClient 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/AdvancedThreatProtectionSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionSettingImpl.java deleted file mode 100644 index 42c6609f6803..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionSettingImpl.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All 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.AdvancedThreatProtectionSettingInner; -import com.azure.resourcemanager.security.models.AdvancedThreatProtectionSetting; - -public final class AdvancedThreatProtectionSettingImpl - implements AdvancedThreatProtectionSetting, AdvancedThreatProtectionSetting.Definition { - private AdvancedThreatProtectionSettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AdvancedThreatProtectionSettingImpl( - AdvancedThreatProtectionSettingInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public Boolean isEnabled() { - return this.innerModel().isEnabled(); - } - - public AdvancedThreatProtectionSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceId; - - public AdvancedThreatProtectionSettingImpl withExistingResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - public AdvancedThreatProtectionSetting create() { - this.innerObject = - serviceManager - .serviceClient() - .getAdvancedThreatProtections() - .createWithResponse(resourceId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public AdvancedThreatProtectionSetting create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAdvancedThreatProtections() - .createWithResponse(resourceId, this.innerModel(), context) - .getValue(); - return this; - } - - AdvancedThreatProtectionSettingImpl(com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AdvancedThreatProtectionSettingInner(); - this.serviceManager = serviceManager; - } - - public AdvancedThreatProtectionSetting refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getAdvancedThreatProtections() - .getWithResponse(resourceId, Context.NONE) - .getValue(); - return this; - } - - public AdvancedThreatProtectionSetting refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAdvancedThreatProtections() - .getWithResponse(resourceId, context) - .getValue(); - return this; - } - - public AdvancedThreatProtectionSettingImpl withIsEnabled(Boolean isEnabled) { - this.innerModel().withIsEnabled(isEnabled); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionsClientImpl.java deleted file mode 100644 index 1efa34e343b0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionsClientImpl.java +++ /dev/null @@ -1,333 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.AdvancedThreatProtectionsClient; -import com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionSettingInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AdvancedThreatProtectionsClient. */ -public final class AdvancedThreatProtectionsClientImpl implements AdvancedThreatProtectionsClient { - /** The proxy service used to perform REST calls. */ - private final AdvancedThreatProtectionsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AdvancedThreatProtectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AdvancedThreatProtectionsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - AdvancedThreatProtectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAdvancedThreatProtections to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAdvanc") - public interface AdvancedThreatProtectionsService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") String settingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("settingName") String settingName, - @BodyParam("application/json") AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the Advanced Threat Protection settings for the specified 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 the Advanced Threat Protection settings for the specified resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId) { - 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 = "2019-01-01"; - final String settingName = "current"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, resourceId, settingName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection settings for the specified resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2019-01-01"; - final String settingName = "current"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, settingName, accept, context); - } - - /** - * Gets the Advanced Threat Protection settings for the specified 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 the Advanced Threat Protection settings for the specified resource on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId) { - return getWithResponseAsync(resourceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection settings for the specified resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, Context context) { - return getWithResponseAsync(resourceId, context).block(); - } - - /** - * Gets the Advanced Threat Protection settings for the specified 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 the Advanced Threat Protection settings for the specified resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionSettingInner get(String resourceId) { - return getWithResponse(resourceId, Context.NONE).getValue(); - } - - /** - * Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param resourceId The identifier of the resource. - * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection resource along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceId, AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting) { - 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 (advancedThreatProtectionSetting == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter advancedThreatProtectionSetting is required and cannot be null.")); - } else { - advancedThreatProtectionSetting.validate(); - } - final String apiVersion = "2019-01-01"; - final String settingName = "current"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - resourceId, - settingName, - advancedThreatProtectionSetting, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param resourceId The identifier of the resource. - * @param advancedThreatProtectionSetting Advanced Threat Protection 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 Advanced Threat Protection resource along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceId, AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting, 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 (advancedThreatProtectionSetting == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter advancedThreatProtectionSetting is required and cannot be null.")); - } else { - advancedThreatProtectionSetting.validate(); - } - final String apiVersion = "2019-01-01"; - final String settingName = "current"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - resourceId, - settingName, - advancedThreatProtectionSetting, - accept, - context); - } - - /** - * Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param resourceId The identifier of the resource. - * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceId, AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting) { - return createWithResponseAsync(resourceId, advancedThreatProtectionSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param resourceId The identifier of the resource. - * @param advancedThreatProtectionSetting Advanced Threat Protection 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 Advanced Threat Protection resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceId, AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting, Context context) { - return createWithResponseAsync(resourceId, advancedThreatProtectionSetting, context).block(); - } - - /** - * Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param resourceId The identifier of the resource. - * @param advancedThreatProtectionSetting Advanced Threat Protection Settings. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AdvancedThreatProtectionSettingInner create( - String resourceId, AdvancedThreatProtectionSettingInner advancedThreatProtectionSetting) { - return createWithResponse(resourceId, advancedThreatProtectionSetting, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionsImpl.java deleted file mode 100644 index 90cde665e788..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AdvancedThreatProtectionsImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.AdvancedThreatProtectionsClient; -import com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionSettingInner; -import com.azure.resourcemanager.security.models.AdvancedThreatProtectionSetting; -import com.azure.resourcemanager.security.models.AdvancedThreatProtections; - -public final class AdvancedThreatProtectionsImpl implements AdvancedThreatProtections { - private static final ClientLogger LOGGER = new ClientLogger(AdvancedThreatProtectionsImpl.class); - - private final AdvancedThreatProtectionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AdvancedThreatProtectionsImpl( - AdvancedThreatProtectionsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AdvancedThreatProtectionSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AdvancedThreatProtectionSetting get(String resourceId) { - AdvancedThreatProtectionSettingInner inner = this.serviceClient().get(resourceId); - if (inner != null) { - return new AdvancedThreatProtectionSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public AdvancedThreatProtectionSetting getById(String id) { - String resourceId = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}", - "resourceId"); - if (resourceId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - return this.getWithResponse(resourceId, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceId = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}", - "resourceId"); - if (resourceId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - return this.getWithResponse(resourceId, context); - } - - private AdvancedThreatProtectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AdvancedThreatProtectionSettingImpl define() { - return new AdvancedThreatProtectionSettingImpl(this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertImpl.java deleted file mode 100644 index 45bd26cca507..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertImpl.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.AlertInner; -import com.azure.resourcemanager.security.models.Alert; -import com.azure.resourcemanager.security.models.AlertEntity; -import com.azure.resourcemanager.security.models.AlertPropertiesSupportingEvidence; -import com.azure.resourcemanager.security.models.AlertSeverity; -import com.azure.resourcemanager.security.models.AlertStatus; -import com.azure.resourcemanager.security.models.Intent; -import com.azure.resourcemanager.security.models.ResourceIdentifier; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class AlertImpl implements Alert { - private AlertInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AlertImpl(AlertInner 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 version() { - return this.innerModel().version(); - } - - public String alertType() { - return this.innerModel().alertType(); - } - - public String systemAlertId() { - return this.innerModel().systemAlertId(); - } - - public String productComponentName() { - return this.innerModel().productComponentName(); - } - - public String alertDisplayName() { - return this.innerModel().alertDisplayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public AlertSeverity severity() { - return this.innerModel().severity(); - } - - public Intent intent() { - return this.innerModel().intent(); - } - - public OffsetDateTime startTimeUtc() { - return this.innerModel().startTimeUtc(); - } - - public OffsetDateTime endTimeUtc() { - return this.innerModel().endTimeUtc(); - } - - public List resourceIdentifiers() { - List inner = this.innerModel().resourceIdentifiers(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List remediationSteps() { - List inner = this.innerModel().remediationSteps(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String vendorName() { - return this.innerModel().vendorName(); - } - - public AlertStatus status() { - return this.innerModel().status(); - } - - public List> extendedLinks() { - List> inner = this.innerModel().extendedLinks(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String alertUri() { - return this.innerModel().alertUri(); - } - - public OffsetDateTime timeGeneratedUtc() { - return this.innerModel().timeGeneratedUtc(); - } - - public String productName() { - return this.innerModel().productName(); - } - - public OffsetDateTime processingEndTimeUtc() { - return this.innerModel().processingEndTimeUtc(); - } - - public List entities() { - List inner = this.innerModel().entities(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Boolean isIncident() { - return this.innerModel().isIncident(); - } - - public String correlationKey() { - return this.innerModel().correlationKey(); - } - - public Map extendedProperties() { - Map inner = this.innerModel().extendedProperties(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String compromisedEntity() { - return this.innerModel().compromisedEntity(); - } - - public List techniques() { - List inner = this.innerModel().techniques(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List subTechniques() { - List inner = this.innerModel().subTechniques(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public AlertPropertiesSupportingEvidence supportingEvidence() { - return this.innerModel().supportingEvidence(); - } - - public AlertInner 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/AlertsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java deleted file mode 100644 index f24350eb7d52..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsClientImpl.java +++ /dev/null @@ -1,3109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.AlertsClient; -import com.azure.resourcemanager.security.fluent.models.AlertInner; -import com.azure.resourcemanager.security.models.AlertList; -import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AlertsClient. */ -public final class AlertsClientImpl implements AlertsClient { - /** The proxy service used to perform REST calls. */ - private final AlertsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AlertsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AlertsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(AlertsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAlerts to be used by the proxy service to perform REST - * calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAlerts") - public interface AlertsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts") - @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/locations/{ascLocation}/alerts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSubscriptionLevelByRegion( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listResourceGroupLevelByRegion( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSubscriptionLevel( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getResourceGroupLevel( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelStateToDismiss( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelStateToResolve( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelStateToActivate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelStateToInProgress( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelStateToResolve( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelStateToDismiss( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelStateToActivate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelStateToInProgress( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("alertName") String alertName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate") - @ExpectedResponses({202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> simulate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @BodyParam("application/json") AlertSimulatorRequestBody alertSimulatorRequestBody, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSubscriptionLevelByRegionNext( - @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> listResourceGroupLevelByRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all the alerts that are associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the alerts that are associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all the alerts that are associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all the alerts that are associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the alerts that are associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List all the alerts that are associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * List all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - 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 all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - 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 all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSubscriptionLevelByRegionSinglePageAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listSubscriptionLevelByRegion( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSubscriptionLevelByRegionSinglePageAsync( - String ascLocation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listSubscriptionLevelByRegion( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSubscriptionLevelByRegionAsync(String ascLocation) { - return new PagedFlux<>( - () -> listSubscriptionLevelByRegionSinglePageAsync(ascLocation), - nextLink -> listSubscriptionLevelByRegionNextSinglePageAsync(nextLink)); - } - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSubscriptionLevelByRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>( - () -> listSubscriptionLevelByRegionSinglePageAsync(ascLocation, context), - nextLink -> listSubscriptionLevelByRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSubscriptionLevelByRegion(String ascLocation) { - return new PagedIterable<>(listSubscriptionLevelByRegionAsync(ascLocation)); - } - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSubscriptionLevelByRegion(String ascLocation, Context context) { - return new PagedIterable<>(listSubscriptionLevelByRegionAsync(ascLocation, context)); - } - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listResourceGroupLevelByRegionSinglePageAsync( - String ascLocation, 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 (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation 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 = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listResourceGroupLevelByRegion( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - 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 all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listResourceGroupLevelByRegionSinglePageAsync( - String ascLocation, 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 (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation 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 = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listResourceGroupLevelByRegion( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listResourceGroupLevelByRegionAsync(String ascLocation, String resourceGroupName) { - return new PagedFlux<>( - () -> listResourceGroupLevelByRegionSinglePageAsync(ascLocation, resourceGroupName), - nextLink -> listResourceGroupLevelByRegionNextSinglePageAsync(nextLink)); - } - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listResourceGroupLevelByRegionAsync( - String ascLocation, String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listResourceGroupLevelByRegionSinglePageAsync(ascLocation, resourceGroupName, context), - nextLink -> listResourceGroupLevelByRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName) { - return new PagedIterable<>(listResourceGroupLevelByRegionAsync(ascLocation, resourceGroupName)); - } - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listResourceGroupLevelByRegion( - String ascLocation, String resourceGroupName, Context context) { - return new PagedIterable<>(listResourceGroupLevelByRegionAsync(ascLocation, resourceGroupName, context)); - } - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated with a subscription along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionLevelWithResponseAsync(String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSubscriptionLevel( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated with a subscription along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionLevelWithResponseAsync( - String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSubscriptionLevel( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context); - } - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated with a subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getSubscriptionLevelAsync(String ascLocation, String alertName) { - return getSubscriptionLevelWithResponseAsync(ascLocation, alertName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated with a subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSubscriptionLevelWithResponse( - String ascLocation, String alertName, Context context) { - return getSubscriptionLevelWithResponseAsync(ascLocation, alertName, context).block(); - } - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated with a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AlertInner getSubscriptionLevel(String ascLocation, String alertName) { - return getSubscriptionLevelWithResponse(ascLocation, alertName, Context.NONE).getValue(); - } - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated a resource group or a resource in a resource group along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getResourceGroupLevelWithResponseAsync( - String resourceGroupName, String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getResourceGroupLevel( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated a resource group or a resource in a resource group along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getResourceGroupLevelWithResponseAsync( - String resourceGroupName, String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getResourceGroupLevel( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context); - } - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated a resource group or a resource in a resource group on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getResourceGroupLevelAsync( - String resourceGroupName, String ascLocation, String alertName) { - return getResourceGroupLevelWithResponseAsync(resourceGroupName, ascLocation, alertName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated a resource group or a resource in a resource group along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getResourceGroupLevelWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context) { - return getResourceGroupLevelWithResponseAsync(resourceGroupName, ascLocation, alertName, context).block(); - } - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated a resource group or a resource in a resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AlertInner getResourceGroupLevel(String resourceGroupName, String ascLocation, String alertName) { - return getResourceGroupLevelWithResponse(resourceGroupName, ascLocation, alertName, Context.NONE).getValue(); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToDismissWithResponseAsync( - String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateSubscriptionLevelStateToDismiss( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToDismissWithResponseAsync( - String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateSubscriptionLevelStateToDismiss( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateSubscriptionLevelStateToDismissAsync(String ascLocation, String alertName) { - return updateSubscriptionLevelStateToDismissWithResponseAsync(ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSubscriptionLevelStateToDismissWithResponse( - String ascLocation, String alertName, Context context) { - return updateSubscriptionLevelStateToDismissWithResponseAsync(ascLocation, alertName, context).block(); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateSubscriptionLevelStateToDismiss(String ascLocation, String alertName) { - updateSubscriptionLevelStateToDismissWithResponse(ascLocation, alertName, Context.NONE); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToResolveWithResponseAsync( - String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateSubscriptionLevelStateToResolve( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToResolveWithResponseAsync( - String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateSubscriptionLevelStateToResolve( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateSubscriptionLevelStateToResolveAsync(String ascLocation, String alertName) { - return updateSubscriptionLevelStateToResolveWithResponseAsync(ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSubscriptionLevelStateToResolveWithResponse( - String ascLocation, String alertName, Context context) { - return updateSubscriptionLevelStateToResolveWithResponseAsync(ascLocation, alertName, context).block(); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateSubscriptionLevelStateToResolve(String ascLocation, String alertName) { - updateSubscriptionLevelStateToResolveWithResponse(ascLocation, alertName, Context.NONE); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToActivateWithResponseAsync( - String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateSubscriptionLevelStateToActivate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToActivateWithResponseAsync( - String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateSubscriptionLevelStateToActivate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateSubscriptionLevelStateToActivateAsync(String ascLocation, String alertName) { - return updateSubscriptionLevelStateToActivateWithResponseAsync(ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSubscriptionLevelStateToActivateWithResponse( - String ascLocation, String alertName, Context context) { - return updateSubscriptionLevelStateToActivateWithResponseAsync(ascLocation, alertName, context).block(); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateSubscriptionLevelStateToActivate(String ascLocation, String alertName) { - updateSubscriptionLevelStateToActivateWithResponse(ascLocation, alertName, Context.NONE); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToInProgressWithResponseAsync( - String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateSubscriptionLevelStateToInProgress( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelStateToInProgressWithResponseAsync( - String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateSubscriptionLevelStateToInProgress( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertName, - accept, - context); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateSubscriptionLevelStateToInProgressAsync(String ascLocation, String alertName) { - return updateSubscriptionLevelStateToInProgressWithResponseAsync(ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSubscriptionLevelStateToInProgressWithResponse( - String ascLocation, String alertName, Context context) { - return updateSubscriptionLevelStateToInProgressWithResponseAsync(ascLocation, alertName, context).block(); - } - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateSubscriptionLevelStateToInProgress(String ascLocation, String alertName) { - updateSubscriptionLevelStateToInProgressWithResponse(ascLocation, alertName, Context.NONE); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelStateToResolveWithResponseAsync( - String resourceGroupName, String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateResourceGroupLevelStateToResolve( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelStateToResolveWithResponseAsync( - String resourceGroupName, String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateResourceGroupLevelStateToResolve( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateResourceGroupLevelStateToResolveAsync( - String resourceGroupName, String ascLocation, String alertName) { - return updateResourceGroupLevelStateToResolveWithResponseAsync(resourceGroupName, ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateResourceGroupLevelStateToResolveWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context) { - return updateResourceGroupLevelStateToResolveWithResponseAsync( - resourceGroupName, ascLocation, alertName, context) - .block(); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateResourceGroupLevelStateToResolve(String resourceGroupName, String ascLocation, String alertName) { - updateResourceGroupLevelStateToResolveWithResponse(resourceGroupName, ascLocation, alertName, Context.NONE); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelStateToDismissWithResponseAsync( - String resourceGroupName, String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateResourceGroupLevelStateToDismiss( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelStateToDismissWithResponseAsync( - String resourceGroupName, String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateResourceGroupLevelStateToDismiss( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateResourceGroupLevelStateToDismissAsync( - String resourceGroupName, String ascLocation, String alertName) { - return updateResourceGroupLevelStateToDismissWithResponseAsync(resourceGroupName, ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateResourceGroupLevelStateToDismissWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context) { - return updateResourceGroupLevelStateToDismissWithResponseAsync( - resourceGroupName, ascLocation, alertName, context) - .block(); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateResourceGroupLevelStateToDismiss(String resourceGroupName, String ascLocation, String alertName) { - updateResourceGroupLevelStateToDismissWithResponse(resourceGroupName, ascLocation, alertName, Context.NONE); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelStateToActivateWithResponseAsync( - String resourceGroupName, String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateResourceGroupLevelStateToActivate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelStateToActivateWithResponseAsync( - String resourceGroupName, String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateResourceGroupLevelStateToActivate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateResourceGroupLevelStateToActivateAsync( - String resourceGroupName, String ascLocation, String alertName) { - return updateResourceGroupLevelStateToActivateWithResponseAsync(resourceGroupName, ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateResourceGroupLevelStateToActivateWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context) { - return updateResourceGroupLevelStateToActivateWithResponseAsync( - resourceGroupName, ascLocation, alertName, context) - .block(); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateResourceGroupLevelStateToActivate( - String resourceGroupName, String ascLocation, String alertName) { - updateResourceGroupLevelStateToActivateWithResponse(resourceGroupName, ascLocation, alertName, Context.NONE); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelStateToInProgressWithResponseAsync( - String resourceGroupName, String ascLocation, String alertName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateResourceGroupLevelStateToInProgress( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelStateToInProgressWithResponseAsync( - String resourceGroupName, String ascLocation, String alertName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertName == null) { - return Mono.error(new IllegalArgumentException("Parameter alertName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateResourceGroupLevelStateToInProgress( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - alertName, - accept, - context); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateResourceGroupLevelStateToInProgressAsync( - String resourceGroupName, String ascLocation, String alertName) { - return updateResourceGroupLevelStateToInProgressWithResponseAsync(resourceGroupName, ascLocation, alertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateResourceGroupLevelStateToInProgressWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context) { - return updateResourceGroupLevelStateToInProgressWithResponseAsync( - resourceGroupName, ascLocation, alertName, context) - .block(); - } - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateResourceGroupLevelStateToInProgress( - String resourceGroupName, String ascLocation, String alertName) { - updateResourceGroupLevelStateToInProgressWithResponse(resourceGroupName, ascLocation, alertName, Context.NONE); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> simulateWithResponseAsync( - String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertSimulatorRequestBody == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter alertSimulatorRequestBody is required and cannot be null.")); - } else { - alertSimulatorRequestBody.validate(); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .simulate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertSimulatorRequestBody, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> simulateWithResponseAsync( - String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (alertSimulatorRequestBody == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter alertSimulatorRequestBody is required and cannot be null.")); - } else { - alertSimulatorRequestBody.validate(); - } - final String apiVersion = "2022-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .simulate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - alertSimulatorRequestBody, - accept, - context); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginSimulateAsync( - String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { - Mono>> mono = simulateWithResponseAsync(ascLocation, alertSimulatorRequestBody); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginSimulateAsync( - String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - simulateWithResponseAsync(ascLocation, alertSimulatorRequestBody, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginSimulate( - String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { - return this.beginSimulateAsync(ascLocation, alertSimulatorRequestBody).getSyncPoller(); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginSimulate( - String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { - return this.beginSimulateAsync(ascLocation, alertSimulatorRequestBody, context).getSyncPoller(); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono simulateAsync(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { - return beginSimulateAsync(ascLocation, alertSimulatorRequestBody) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono simulateAsync( - String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { - return beginSimulateAsync(ascLocation, alertSimulatorRequestBody, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { - simulateAsync(ascLocation, alertSimulatorRequestBody).block(); - } - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { - simulateAsync(ascLocation, alertSimulatorRequestBody, context).block(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

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

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

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSubscriptionLevelByRegionNextSinglePageAsync(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.listSubscriptionLevelByRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSubscriptionLevelByRegionNextSinglePageAsync( - 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 - .listSubscriptionLevelByRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listResourceGroupLevelByRegionNextSinglePageAsync(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.listResourceGroupLevelByRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listResourceGroupLevelByRegionNextSinglePageAsync( - 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 - .listResourceGroupLevelByRegionNext(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/AlertsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsImpl.java deleted file mode 100644 index 2256ce9a09cd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsImpl.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.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.AlertsClient; -import com.azure.resourcemanager.security.fluent.models.AlertInner; -import com.azure.resourcemanager.security.models.Alert; -import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; -import com.azure.resourcemanager.security.models.Alerts; - -public final class AlertsImpl implements Alerts { - private static final ClientLogger LOGGER = new ClientLogger(AlertsImpl.class); - - private final AlertsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AlertsImpl(AlertsClient 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 AlertImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public PagedIterable listSubscriptionLevelByRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listSubscriptionLevelByRegion(ascLocation); - return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public PagedIterable listSubscriptionLevelByRegion(String ascLocation, Context context) { - PagedIterable inner = this.serviceClient().listSubscriptionLevelByRegion(ascLocation, context); - return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName) { - PagedIterable inner = - this.serviceClient().listResourceGroupLevelByRegion(ascLocation, resourceGroupName); - return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public PagedIterable listResourceGroupLevelByRegion( - String ascLocation, String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listResourceGroupLevelByRegion(ascLocation, resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new AlertImpl(inner1, this.manager())); - } - - public Response getSubscriptionLevelWithResponse(String ascLocation, String alertName, Context context) { - Response inner = - this.serviceClient().getSubscriptionLevelWithResponse(ascLocation, alertName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AlertImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Alert getSubscriptionLevel(String ascLocation, String alertName) { - AlertInner inner = this.serviceClient().getSubscriptionLevel(ascLocation, alertName); - if (inner != null) { - return new AlertImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getResourceGroupLevelWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context) { - Response inner = - this.serviceClient().getResourceGroupLevelWithResponse(resourceGroupName, ascLocation, alertName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AlertImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Alert getResourceGroupLevel(String resourceGroupName, String ascLocation, String alertName) { - AlertInner inner = this.serviceClient().getResourceGroupLevel(resourceGroupName, ascLocation, alertName); - if (inner != null) { - return new AlertImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateSubscriptionLevelStateToDismissWithResponse( - String ascLocation, String alertName, Context context) { - return this.serviceClient().updateSubscriptionLevelStateToDismissWithResponse(ascLocation, alertName, context); - } - - public void updateSubscriptionLevelStateToDismiss(String ascLocation, String alertName) { - this.serviceClient().updateSubscriptionLevelStateToDismiss(ascLocation, alertName); - } - - public Response updateSubscriptionLevelStateToResolveWithResponse( - String ascLocation, String alertName, Context context) { - return this.serviceClient().updateSubscriptionLevelStateToResolveWithResponse(ascLocation, alertName, context); - } - - public void updateSubscriptionLevelStateToResolve(String ascLocation, String alertName) { - this.serviceClient().updateSubscriptionLevelStateToResolve(ascLocation, alertName); - } - - public Response updateSubscriptionLevelStateToActivateWithResponse( - String ascLocation, String alertName, Context context) { - return this.serviceClient().updateSubscriptionLevelStateToActivateWithResponse(ascLocation, alertName, context); - } - - public void updateSubscriptionLevelStateToActivate(String ascLocation, String alertName) { - this.serviceClient().updateSubscriptionLevelStateToActivate(ascLocation, alertName); - } - - public Response updateSubscriptionLevelStateToInProgressWithResponse( - String ascLocation, String alertName, Context context) { - return this - .serviceClient() - .updateSubscriptionLevelStateToInProgressWithResponse(ascLocation, alertName, context); - } - - public void updateSubscriptionLevelStateToInProgress(String ascLocation, String alertName) { - this.serviceClient().updateSubscriptionLevelStateToInProgress(ascLocation, alertName); - } - - public Response updateResourceGroupLevelStateToResolveWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context) { - return this - .serviceClient() - .updateResourceGroupLevelStateToResolveWithResponse(resourceGroupName, ascLocation, alertName, context); - } - - public void updateResourceGroupLevelStateToResolve(String resourceGroupName, String ascLocation, String alertName) { - this.serviceClient().updateResourceGroupLevelStateToResolve(resourceGroupName, ascLocation, alertName); - } - - public Response updateResourceGroupLevelStateToDismissWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context) { - return this - .serviceClient() - .updateResourceGroupLevelStateToDismissWithResponse(resourceGroupName, ascLocation, alertName, context); - } - - public void updateResourceGroupLevelStateToDismiss(String resourceGroupName, String ascLocation, String alertName) { - this.serviceClient().updateResourceGroupLevelStateToDismiss(resourceGroupName, ascLocation, alertName); - } - - public Response updateResourceGroupLevelStateToActivateWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context) { - return this - .serviceClient() - .updateResourceGroupLevelStateToActivateWithResponse(resourceGroupName, ascLocation, alertName, context); - } - - public void updateResourceGroupLevelStateToActivate( - String resourceGroupName, String ascLocation, String alertName) { - this.serviceClient().updateResourceGroupLevelStateToActivate(resourceGroupName, ascLocation, alertName); - } - - public Response updateResourceGroupLevelStateToInProgressWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context) { - return this - .serviceClient() - .updateResourceGroupLevelStateToInProgressWithResponse(resourceGroupName, ascLocation, alertName, context); - } - - public void updateResourceGroupLevelStateToInProgress( - String resourceGroupName, String ascLocation, String alertName) { - this.serviceClient().updateResourceGroupLevelStateToInProgress(resourceGroupName, ascLocation, alertName); - } - - public void simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody) { - this.serviceClient().simulate(ascLocation, alertSimulatorRequestBody); - } - - public void simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context) { - this.serviceClient().simulate(ascLocation, alertSimulatorRequestBody, context); - } - - private AlertsClient 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/AlertsSuppressionRuleImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRuleImpl.java deleted file mode 100644 index dba39316deae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRuleImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.AlertsSuppressionRule; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.time.OffsetDateTime; - -public final class AlertsSuppressionRuleImpl implements AlertsSuppressionRule { - private AlertsSuppressionRuleInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AlertsSuppressionRuleImpl( - AlertsSuppressionRuleInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String alertType() { - return this.innerModel().alertType(); - } - - public OffsetDateTime lastModifiedUtc() { - return this.innerModel().lastModifiedUtc(); - } - - public OffsetDateTime expirationDateUtc() { - return this.innerModel().expirationDateUtc(); - } - - public String reason() { - return this.innerModel().reason(); - } - - public RuleState state() { - return this.innerModel().state(); - } - - public String comment() { - return this.innerModel().comment(); - } - - public SuppressionAlertsScope suppressionAlertsScope() { - return this.innerModel().suppressionAlertsScope(); - } - - public AlertsSuppressionRuleInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesClientImpl.java deleted file mode 100644 index b6e2af3f8fd6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesClientImpl.java +++ /dev/null @@ -1,783 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.AlertsSuppressionRulesClient; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.AlertsSuppressionRulesList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AlertsSuppressionRulesClient. */ -public final class AlertsSuppressionRulesClientImpl implements AlertsSuppressionRulesClient { - /** The proxy service used to perform REST calls. */ - private final AlertsSuppressionRulesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AlertsSuppressionRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AlertsSuppressionRulesClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(AlertsSuppressionRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAlertsSuppressionRules to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAlerts") - public interface AlertsSuppressionRulesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("AlertType") String alertType, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("alertsSuppressionRuleName") String alertsSuppressionRuleName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("alertsSuppressionRuleName") String alertsSuppressionRuleName, - @BodyParam("application/json") AlertsSuppressionRuleInner alertsSuppressionRule, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("alertsSuppressionRuleName") String alertsSuppressionRuleName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String alertType) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - alertType, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String alertType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), alertType, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String alertType) { - return new PagedFlux<>(() -> listSinglePageAsync(alertType), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List of all the dismiss rules for the given subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String alertType = null; - return new PagedFlux<>(() -> listSinglePageAsync(alertType), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String alertType, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(alertType, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List of all the dismiss rules for the given subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String alertType = null; - return new PagedIterable<>(listAsync(alertType)); - } - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String alertType, Context context) { - return new PagedIterable<>(listAsync(alertType, context)); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String alertsSuppressionRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (alertsSuppressionRuleName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - alertsSuppressionRuleName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String alertsSuppressionRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (alertsSuppressionRuleName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - alertsSuppressionRuleName, - accept, - context); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String alertsSuppressionRuleName) { - return getWithResponseAsync(alertsSuppressionRuleName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String alertsSuppressionRuleName, Context context) { - return getWithResponseAsync(alertsSuppressionRuleName, context).block(); - } - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AlertsSuppressionRuleInner get(String alertsSuppressionRuleName) { - return getWithResponse(alertsSuppressionRuleName, Context.NONE).getValue(); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (alertsSuppressionRuleName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - if (alertsSuppressionRule == null) { - return Mono - .error(new IllegalArgumentException("Parameter alertsSuppressionRule is required and cannot be null.")); - } else { - alertsSuppressionRule.validate(); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - alertsSuppressionRuleName, - alertsSuppressionRule, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (alertsSuppressionRuleName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - if (alertsSuppressionRule == null) { - return Mono - .error(new IllegalArgumentException("Parameter alertsSuppressionRule is required and cannot be null.")); - } else { - alertsSuppressionRule.validate(); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - alertsSuppressionRuleName, - alertsSuppressionRule, - accept, - context); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule) { - return updateWithResponseAsync(alertsSuppressionRuleName, alertsSuppressionRule) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule, Context context) { - return updateWithResponseAsync(alertsSuppressionRuleName, alertsSuppressionRule, context).block(); - } - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AlertsSuppressionRuleInner update( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule) { - return updateWithResponse(alertsSuppressionRuleName, alertsSuppressionRule, Context.NONE).getValue(); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String alertsSuppressionRuleName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (alertsSuppressionRuleName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - alertsSuppressionRuleName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String alertsSuppressionRuleName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (alertsSuppressionRuleName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter alertsSuppressionRuleName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - alertsSuppressionRuleName, - accept, - context); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String alertsSuppressionRuleName) { - return deleteWithResponseAsync(alertsSuppressionRuleName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String alertsSuppressionRuleName, Context context) { - return deleteWithResponseAsync(alertsSuppressionRuleName, context).block(); - } - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String alertsSuppressionRuleName) { - deleteWithResponse(alertsSuppressionRuleName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 suppression rules list for subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 suppression rules list for subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesImpl.java deleted file mode 100644 index fe83aead0087..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AlertsSuppressionRulesImpl.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AlertsSuppressionRulesClient; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.AlertsSuppressionRule; -import com.azure.resourcemanager.security.models.AlertsSuppressionRules; - -public final class AlertsSuppressionRulesImpl implements AlertsSuppressionRules { - private static final ClientLogger LOGGER = new ClientLogger(AlertsSuppressionRulesImpl.class); - - private final AlertsSuppressionRulesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AlertsSuppressionRulesImpl( - AlertsSuppressionRulesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new AlertsSuppressionRuleImpl(inner1, this.manager())); - } - - public PagedIterable list(String alertType, Context context) { - PagedIterable inner = this.serviceClient().list(alertType, context); - return Utils.mapPage(inner, inner1 -> new AlertsSuppressionRuleImpl(inner1, this.manager())); - } - - public Response getWithResponse(String alertsSuppressionRuleName, Context context) { - Response inner = - this.serviceClient().getWithResponse(alertsSuppressionRuleName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AlertsSuppressionRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AlertsSuppressionRule get(String alertsSuppressionRuleName) { - AlertsSuppressionRuleInner inner = this.serviceClient().get(alertsSuppressionRuleName); - if (inner != null) { - return new AlertsSuppressionRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule, Context context) { - Response inner = - this.serviceClient().updateWithResponse(alertsSuppressionRuleName, alertsSuppressionRule, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AlertsSuppressionRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AlertsSuppressionRule update( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule) { - AlertsSuppressionRuleInner inner = - this.serviceClient().update(alertsSuppressionRuleName, alertsSuppressionRule); - if (inner != null) { - return new AlertsSuppressionRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String alertsSuppressionRuleName, Context context) { - return this.serviceClient().deleteWithResponse(alertsSuppressionRuleName, context); - } - - public void delete(String alertsSuppressionRuleName) { - this.serviceClient().delete(alertsSuppressionRuleName); - } - - private AlertsSuppressionRulesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsClientImpl.java deleted file mode 100644 index 6ec6858c8cae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsClientImpl.java +++ /dev/null @@ -1,757 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.AllowedConnectionsClient; -import com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner; -import com.azure.resourcemanager.security.models.AllowedConnectionsList; -import com.azure.resourcemanager.security.models.ConnectionType; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AllowedConnectionsClient. */ -public final class AllowedConnectionsClientImpl implements AllowedConnectionsClient { - /** The proxy service used to perform REST calls. */ - private final AllowedConnectionsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AllowedConnectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AllowedConnectionsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(AllowedConnectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAllowedConnections to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAllowe") - public interface AllowedConnectionsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("connectionType") ConnectionType connectionType, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByHomeRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync( - String ascLocation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegion( - this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation, context), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, context)); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location, based on connection - * type along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ascLocation, ConnectionType connectionType) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (connectionType == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionType is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - connectionType, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location, based on connection - * type along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ascLocation, ConnectionType connectionType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (connectionType == null) { - return Mono.error(new IllegalArgumentException("Parameter connectionType is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - connectionType, - apiVersion, - accept, - context); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location, based on connection - * type on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String ascLocation, ConnectionType connectionType) { - return getWithResponseAsync(resourceGroupName, ascLocation, connectionType) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location, based on connection - * type along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String ascLocation, ConnectionType connectionType, Context context) { - return getWithResponseAsync(resourceGroupName, ascLocation, connectionType, context).block(); - } - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location, based on connection - * type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AllowedConnectionsResourceInner get( - String resourceGroupName, String ascLocation, ConnectionType connectionType) { - return getWithResponse(resourceGroupName, ascLocation, connectionType, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

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 all possible traffic between Azure resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 all possible traffic between Azure resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsImpl.java deleted file mode 100644 index 66d36cb8fb15..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AllowedConnectionsClient; -import com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner; -import com.azure.resourcemanager.security.models.AllowedConnections; -import com.azure.resourcemanager.security.models.AllowedConnectionsResource; -import com.azure.resourcemanager.security.models.ConnectionType; - -public final class AllowedConnectionsImpl implements AllowedConnections { - private static final ClientLogger LOGGER = new ClientLogger(AllowedConnectionsImpl.class); - - private final AllowedConnectionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AllowedConnectionsImpl( - AllowedConnectionsClient 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 AllowedConnectionsResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new AllowedConnectionsResourceImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return Utils.mapPage(inner, inner1 -> new AllowedConnectionsResourceImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - PagedIterable inner = - this.serviceClient().listByHomeRegion(ascLocation, context); - return Utils.mapPage(inner, inner1 -> new AllowedConnectionsResourceImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String resourceGroupName, String ascLocation, ConnectionType connectionType, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, ascLocation, connectionType, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AllowedConnectionsResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AllowedConnectionsResource get(String resourceGroupName, String ascLocation, ConnectionType connectionType) { - AllowedConnectionsResourceInner inner = - this.serviceClient().get(resourceGroupName, ascLocation, connectionType); - if (inner != null) { - return new AllowedConnectionsResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - private AllowedConnectionsClient 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/AllowedConnectionsResourceImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsResourceImpl.java deleted file mode 100644 index f53610805f1b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AllowedConnectionsResourceImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner; -import com.azure.resourcemanager.security.models.AllowedConnectionsResource; -import com.azure.resourcemanager.security.models.ConnectableResource; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class AllowedConnectionsResourceImpl implements AllowedConnectionsResource { - private AllowedConnectionsResourceInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AllowedConnectionsResourceImpl( - AllowedConnectionsResourceInner 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 location() { - return this.innerModel().location(); - } - - public OffsetDateTime calculatedDateTime() { - return this.innerModel().calculatedDateTime(); - } - - public List connectableResources() { - List inner = this.innerModel().connectableResources(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public AllowedConnectionsResourceInner 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/ApiCollectionOffboardingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsClientImpl.java deleted file mode 100644 index ca575de7d8a7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsClientImpl.java +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.ApiCollectionOffboardingsClient; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ApiCollectionOffboardingsClient. */ -public final class ApiCollectionOffboardingsClientImpl implements ApiCollectionOffboardingsClient { - /** The proxy service used to perform REST calls. */ - private final ApiCollectionOffboardingsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ApiCollectionOffboardingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApiCollectionOffboardingsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - ApiCollectionOffboardingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterApiCollectionOffboardings to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterApiCol") - public interface ApiCollectionOffboardingsService { - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceName") String serviceName, - @PathParam("apiCollectionId") String apiCollectionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations - * within the Azure API Management API for intrusive behaviors. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (apiCollectionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); - } - final String apiVersion = "2022-11-20-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - serviceName, - apiCollectionId, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations - * within the Azure API Management API for intrusive behaviors. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (apiCollectionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); - } - final String apiVersion = "2022-11-20-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - serviceName, - apiCollectionId, - apiVersion, - accept, - context); - } - - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

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

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

Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations - * within the Azure API Management API for intrusive behaviors. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String serviceName, String apiCollectionId) { - deleteWithResponse(resourceGroupName, serviceName, apiCollectionId, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsImpl.java deleted file mode 100644 index 8e6f9091324b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOffboardingsImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.ApiCollectionOffboardingsClient; -import com.azure.resourcemanager.security.models.ApiCollectionOffboardings; - -public final class ApiCollectionOffboardingsImpl implements ApiCollectionOffboardings { - private static final ClientLogger LOGGER = new ClientLogger(ApiCollectionOffboardingsImpl.class); - - private final ApiCollectionOffboardingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ApiCollectionOffboardingsImpl( - ApiCollectionOffboardingsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response deleteWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, serviceName, apiCollectionId, context); - } - - public void delete(String resourceGroupName, String serviceName, String apiCollectionId) { - this.serviceClient().delete(resourceGroupName, serviceName, apiCollectionId); - } - - private ApiCollectionOffboardingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsClientImpl.java deleted file mode 100644 index f2eab89967ab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsClientImpl.java +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.ApiCollectionOnboardingsClient; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ApiCollectionOnboardingsClient. */ -public final class ApiCollectionOnboardingsClientImpl implements ApiCollectionOnboardingsClient { - /** The proxy service used to perform REST calls. */ - private final ApiCollectionOnboardingsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ApiCollectionOnboardingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApiCollectionOnboardingsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(ApiCollectionOnboardingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterApiCollectionOnboardings to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterApiCol") - public interface ApiCollectionOnboardingsService { - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceName") String serviceName, - @PathParam("apiCollectionId") String apiCollectionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an API collection as represented by Defender for APIs along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (apiCollectionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); - } - final String apiVersion = "2022-11-20-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - serviceName, - apiCollectionId, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an API collection as represented by Defender for APIs along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (apiCollectionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); - } - final String apiVersion = "2022-11-20-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - serviceName, - apiCollectionId, - apiVersion, - accept, - context); - } - - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an API collection as represented by Defender for APIs on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, String serviceName, String apiCollectionId) { - return createWithResponseAsync(resourceGroupName, serviceName, apiCollectionId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an API collection as represented by Defender for APIs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - return createWithResponseAsync(resourceGroupName, serviceName, apiCollectionId, context).block(); - } - - /** - * Onboard an Azure API Management API to Defender for APIs - * - *

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an API collection as represented by Defender for APIs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApiCollectionResponseInner create(String resourceGroupName, String serviceName, String apiCollectionId) { - return createWithResponse(resourceGroupName, serviceName, apiCollectionId, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsImpl.java deleted file mode 100644 index 0fc34f165495..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionOnboardingsImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.ApiCollectionOnboardingsClient; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import com.azure.resourcemanager.security.models.ApiCollectionOnboardings; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; - -public final class ApiCollectionOnboardingsImpl implements ApiCollectionOnboardings { - private static final ClientLogger LOGGER = new ClientLogger(ApiCollectionOnboardingsImpl.class); - - private final ApiCollectionOnboardingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ApiCollectionOnboardingsImpl( - ApiCollectionOnboardingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response createWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - Response inner = - this.serviceClient().createWithResponse(resourceGroupName, serviceName, apiCollectionId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ApiCollectionResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ApiCollectionResponse create(String resourceGroupName, String serviceName, String apiCollectionId) { - ApiCollectionResponseInner inner = this.serviceClient().create(resourceGroupName, serviceName, apiCollectionId); - if (inner != null) { - return new ApiCollectionResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private ApiCollectionOnboardingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionResponseImpl.java deleted file mode 100644 index 1427fdd1513f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionResponseImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; -import java.util.Collections; -import java.util.Map; - -public final class ApiCollectionResponseImpl implements ApiCollectionResponse { - private ApiCollectionResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ApiCollectionResponseImpl( - ApiCollectionResponseInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public Map additionalData() { - Map inner = this.innerModel().additionalData(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public ApiCollectionResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsClientImpl.java deleted file mode 100644 index 08310c38ed47..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsClientImpl.java +++ /dev/null @@ -1,572 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.ApiCollectionsClient; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import com.azure.resourcemanager.security.models.ApiCollectionResponseList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ApiCollectionsClient. */ -public final class ApiCollectionsClientImpl implements ApiCollectionsClient { - /** The proxy service used to perform REST calls. */ - private final ApiCollectionsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ApiCollectionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApiCollectionsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(ApiCollectionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterApiCollections to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterApiCol") - public interface ApiCollectionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceName") String serviceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("serviceName") String serviceName, - @PathParam("apiCollectionId") String apiCollectionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

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

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure API Management APIs that have been onboarded to Defender for APIs along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String serviceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - final String apiVersion = "2022-11-20-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - serviceName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String serviceName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, serviceName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String serviceName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, serviceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String serviceName) { - return new PagedIterable<>(listAsync(resourceGroupName, serviceName)); - } - - /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String serviceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, serviceName, context)); - } - - /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

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

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for - * intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure API Management API if it has been onboarded to Defender for APIs along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } - if (apiCollectionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter apiCollectionId is required and cannot be null.")); - } - final String apiVersion = "2022-11-20-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - serviceName, - apiCollectionId, - apiVersion, - accept, - context); - } - - /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

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

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for - * intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure API Management API if it has been onboarded to Defender for APIs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - return getWithResponseAsync(resourceGroupName, serviceName, apiCollectionId, context).block(); - } - - /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

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

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a list of API collections as represented by Defender for APIs along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsImpl.java deleted file mode 100644 index 336ea9d21801..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApiCollectionsImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.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.ApiCollectionsClient; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; -import com.azure.resourcemanager.security.models.ApiCollections; - -public final class ApiCollectionsImpl implements ApiCollections { - private static final ClientLogger LOGGER = new ClientLogger(ApiCollectionsImpl.class); - - private final ApiCollectionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ApiCollectionsImpl( - ApiCollectionsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String serviceName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, serviceName); - return Utils.mapPage(inner, inner1 -> new ApiCollectionResponseImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String serviceName, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, serviceName, context); - return Utils.mapPage(inner, inner1 -> new ApiCollectionResponseImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String resourceGroupName, String serviceName, String apiCollectionId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, serviceName, apiCollectionId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ApiCollectionResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ApiCollectionResponse get(String resourceGroupName, String serviceName, String apiCollectionId) { - ApiCollectionResponseInner inner = this.serviceClient().get(resourceGroupName, serviceName, apiCollectionId); - if (inner != null) { - return new ApiCollectionResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - private ApiCollectionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationImpl.java deleted file mode 100644 index 6bb5827d3d18..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationImpl.java +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.util.Collections; -import java.util.List; - -public final class ApplicationImpl implements Application, Application.Definition, Application.Update { - private ApplicationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public ApplicationSourceResourceType sourceResourceType() { - return this.innerModel().sourceResourceType(); - } - - public List conditionSets() { - List inner = this.innerModel().conditionSets(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ApplicationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String applicationId; - - public Application create() { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationOperations() - .createOrUpdateWithResponse(applicationId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Application create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationOperations() - .createOrUpdateWithResponse(applicationId, this.innerModel(), context) - .getValue(); - return this; - } - - ApplicationImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new ApplicationInner(); - this.serviceManager = serviceManager; - this.applicationId = name; - } - - public ApplicationImpl update() { - return this; - } - - public Application apply() { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationOperations() - .createOrUpdateWithResponse(applicationId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Application apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationOperations() - .createOrUpdateWithResponse(applicationId, this.innerModel(), context) - .getValue(); - return this; - } - - ApplicationImpl(ApplicationInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.applicationId = Utils.getValueFromIdByName(innerObject.id(), "applications"); - } - - public Application refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationOperations() - .getWithResponse(applicationId, Context.NONE) - .getValue(); - return this; - } - - public Application refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getApplicationOperations() - .getWithResponse(applicationId, context) - .getValue(); - return this; - } - - public ApplicationImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public ApplicationImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - public ApplicationImpl withSourceResourceType(ApplicationSourceResourceType sourceResourceType) { - this.innerModel().withSourceResourceType(sourceResourceType); - return this; - } - - public ApplicationImpl withConditionSets(List conditionSets) { - this.innerModel().withConditionSets(conditionSets); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsClientImpl.java deleted file mode 100644 index 4a46f329ee11..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsClientImpl.java +++ /dev/null @@ -1,479 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.ApplicationOperationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ApplicationOperationsClient. */ -public final class ApplicationOperationsClientImpl implements ApplicationOperationsClient { - /** The proxy service used to perform REST calls. */ - private final ApplicationOperationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ApplicationOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApplicationOperationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(ApplicationOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterApplicationOperations to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterApplic") - public interface ApplicationOperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("applicationId") String applicationId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("applicationId") String applicationId, - @BodyParam("application/json") ApplicationInner application, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("applicationId") String applicationId, - Context context); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String applicationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - applicationId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String applicationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), applicationId, accept, context); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String applicationId) { - return getWithResponseAsync(applicationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String applicationId, Context context) { - return getWithResponseAsync(applicationId, context).block(); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner get(String applicationId) { - return getWithResponse(applicationId, Context.NONE).getValue(); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String applicationId, ApplicationInner application) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - applicationId, - application, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String applicationId, ApplicationInner application, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - applicationId, - application, - accept, - context); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String applicationId, ApplicationInner application) { - return createOrUpdateWithResponseAsync(applicationId, application) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String applicationId, ApplicationInner application, Context context) { - return createOrUpdateWithResponseAsync(applicationId, application, context).block(); - } - - /** - * Creates or update a security application on the given subscription. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner createOrUpdate(String applicationId, ApplicationInner application) { - return createOrUpdateWithResponse(applicationId, application, Context.NONE).getValue(); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String applicationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - applicationId, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String applicationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - context = this.client.mergeContext(context); - return service - .delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), applicationId, context); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String applicationId) { - return deleteWithResponseAsync(applicationId).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String applicationId, Context context) { - return deleteWithResponseAsync(applicationId, context).block(); - } - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String applicationId) { - deleteWithResponse(applicationId, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsImpl.java deleted file mode 100644 index 7d6d4ab2601b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationOperationsImpl.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.ApplicationOperationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationOperations; - -public final class ApplicationOperationsImpl implements ApplicationOperations { - private static final ClientLogger LOGGER = new ClientLogger(ApplicationOperationsImpl.class); - - private final ApplicationOperationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ApplicationOperationsImpl( - ApplicationOperationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String applicationId, Context context) { - Response inner = this.serviceClient().getWithResponse(applicationId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ApplicationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Application get(String applicationId) { - ApplicationInner inner = this.serviceClient().get(applicationId); - if (inner != null) { - return new ApplicationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String applicationId, Context context) { - return this.serviceClient().deleteWithResponse(applicationId, context); - } - - public void delete(String applicationId) { - this.serviceClient().delete(applicationId); - } - - public Application getById(String id) { - String applicationId = Utils.getValueFromIdByName(id, "applications"); - if (applicationId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - return this.getWithResponse(applicationId, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String applicationId = Utils.getValueFromIdByName(id, "applications"); - if (applicationId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - return this.getWithResponse(applicationId, context); - } - - public void deleteById(String id) { - String applicationId = Utils.getValueFromIdByName(id, "applications"); - if (applicationId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - this.deleteWithResponse(applicationId, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String applicationId = Utils.getValueFromIdByName(id, "applications"); - if (applicationId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'applications'.", id))); - } - return this.deleteWithResponse(applicationId, context); - } - - private ApplicationOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public ApplicationImpl define(String name) { - return new ApplicationImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsClientImpl.java deleted file mode 100644 index b604de04135a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsClientImpl.java +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.ApplicationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.ApplicationsList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ApplicationsClient. */ -public final class ApplicationsClientImpl implements ApplicationsClient { - /** The proxy service used to perform REST calls. */ - private final ApplicationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ApplicationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ApplicationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(ApplicationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterApplications to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterApplic") - public interface ApplicationsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a security applications list along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsImpl.java deleted file mode 100644 index 190bf422bb85..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ApplicationsImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.ApplicationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.Applications; - -public final class ApplicationsImpl implements Applications { - private static final ClientLogger LOGGER = new ClientLogger(ApplicationsImpl.class); - - private final ApplicationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ApplicationsImpl( - ApplicationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); - } - - private ApplicationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AscLocationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AscLocationImpl.java deleted file mode 100644 index 557b0b5b19e0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AscLocationImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; -import com.azure.resourcemanager.security.models.AscLocation; - -public final class AscLocationImpl implements AscLocation { - private AscLocationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AscLocationImpl(AscLocationInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public Object properties() { - return this.innerModel().properties(); - } - - public AscLocationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java deleted file mode 100644 index 2cbcb3ac9e6c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsClientImpl.java +++ /dev/null @@ -1,728 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.AssessmentsClient; -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; - -/** An instance of this class provides access to all the operations defined in AssessmentsClient. */ -public final class AssessmentsClientImpl implements AssessmentsClient { - /** The proxy service used to perform REST calls. */ - private final AssessmentsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AssessmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AssessmentsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(AssessmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAssessments to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAssess") - public interface AssessmentsService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/assessments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("assessmentName") String assessmentName, - @QueryParam("$expand") ExpandEnum expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - 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") SecurityAssessment assessment, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("assessmentName") String assessmentName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 assessments on all your scanned resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - 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 = "2021-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 assessments on all your scanned resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, 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 = "2021-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param expand OData expand. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security assessment on your scanned resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceId, String assessmentName, ExpandEnum expand) { - 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2021-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), apiVersion, resourceId, assessmentName, expand, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security assessment on your scanned resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceId, String assessmentName, ExpandEnum expand, 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - 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); - } - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security assessment on your scanned resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String assessmentName) { - final ExpandEnum expand = null; - return getWithResponseAsync(resourceId, assessmentName, expand) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security assessment on your scanned resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceId, String assessmentName, ExpandEnum expand, Context context) { - return getWithResponseAsync(resourceId, assessmentName, expand, context).block(); - } - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security assessment on your scanned resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentResponseInner get(String resourceId, String assessmentName) { - final ExpandEnum expand = null; - return getWithResponse(resourceId, assessmentName, expand, Context.NONE).getValue(); - } - - /** - * Create a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assessment Calculated assessment on a pre-defined assessment metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 - response format along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceId, String assessmentName, SecurityAssessment assessment) { - 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assessment == null) { - return Mono.error(new IllegalArgumentException("Parameter assessment is required and cannot be null.")); - } else { - assessment.validate(); - } - final String apiVersion = "2021-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - resourceId, - assessmentName, - assessment, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assessment Calculated assessment on a pre-defined assessment metadata. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 - response format along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceId, String assessmentName, SecurityAssessment assessment, 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assessment == null) { - return Mono.error(new IllegalArgumentException("Parameter assessment is required and cannot be null.")); - } else { - assessment.validate(); - } - final String apiVersion = "2021-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), apiVersion, resourceId, assessmentName, assessment, accept, context); - } - - /** - * Create a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assessment Calculated assessment on a pre-defined assessment metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 - response format on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceId, String assessmentName, SecurityAssessment assessment) { - return createOrUpdateWithResponseAsync(resourceId, assessmentName, assessment) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assessment Calculated assessment on a pre-defined assessment metadata. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 - response format along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceId, String assessmentName, SecurityAssessment assessment, Context context) { - return createOrUpdateWithResponseAsync(resourceId, assessmentName, assessment, context).block(); - } - - /** - * Create a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param assessment Calculated assessment on a pre-defined assessment metadata. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 - response format. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentResponseInner createOrUpdate( - String resourceId, String assessmentName, SecurityAssessment assessment) { - return createOrUpdateWithResponse(resourceId, assessmentName, assessment, Context.NONE).getValue(); - } - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceId, String assessmentName) { - 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 (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2021-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.delete(this.client.getEndpoint(), apiVersion, resourceId, assessmentName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceId, String assessmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2021-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, resourceId, assessmentName, accept, context); - } - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceId, String assessmentName) { - return deleteWithResponseAsync(resourceId, assessmentName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceId, String assessmentName, Context context) { - return deleteWithResponseAsync(resourceId, assessmentName, context).block(); - } - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceId, String assessmentName) { - deleteWithResponse(resourceId, assessmentName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a security assessments list along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java deleted file mode 100644 index 0e5cc1fb108d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsImpl.java +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AssessmentsClient; -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.SecurityAssessmentResponse; - -public final class AssessmentsImpl implements Assessments { - private static final ClientLogger LOGGER = new ClientLogger(AssessmentsImpl.class); - - private final AssessmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AssessmentsImpl( - AssessmentsClient 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 SecurityAssessmentResponseImpl(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 Response getWithResponse( - String resourceId, String assessmentName, ExpandEnum expand, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceId, assessmentName, expand, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecurityAssessmentResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityAssessmentResponse get(String resourceId, String assessmentName) { - SecurityAssessmentResponseInner inner = this.serviceClient().get(resourceId, assessmentName); - if (inner != null) { - return new SecurityAssessmentResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse(String resourceId, String assessmentName, Context context) { - return this.serviceClient().deleteWithResponse(resourceId, assessmentName, context); - } - - public void deleteByResourceGroup(String resourceId, String assessmentName) { - this.serviceClient().delete(resourceId, assessmentName); - } - - public SecurityAssessmentResponse getById(String id) { - String resourceId = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "resourceId"); - if (resourceId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "assessmentName"); - if (assessmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - ExpandEnum localExpand = null; - return this.getWithResponse(resourceId, assessmentName, localExpand, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, ExpandEnum expand, Context context) { - String resourceId = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "resourceId"); - if (resourceId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "assessmentName"); - if (assessmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - return this.getWithResponse(resourceId, assessmentName, expand, context); - } - - public void deleteById(String id) { - String resourceId = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "resourceId"); - if (resourceId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "assessmentName"); - if (assessmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceId, assessmentName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceId = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "resourceId"); - if (resourceId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", "assessmentName"); - if (assessmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceId, assessmentName, context); - } - - private AssessmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - 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 deleted file mode 100644 index 77bbc5dbcc38..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasClientImpl.java +++ /dev/null @@ -1,1100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.AssessmentsMetadatasClient; -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. */ -public final class AssessmentsMetadatasClientImpl implements AssessmentsMetadatasClient { - /** The proxy service used to perform REST calls. */ - private final AssessmentsMetadatasService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AssessmentsMetadatasClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AssessmentsMetadatasClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(AssessmentsMetadatasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAssessmentsMetadatas to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAssess") - public interface AssessmentsMetadatasService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Security/assessmentMetadata") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("assessmentMetadataName") String assessmentMetadataName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscription( - @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/assessmentMetadata/{assessmentMetadataName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getInSubscription( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("assessmentMetadataName") String assessmentMetadataName, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createInSubscription( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("assessmentMetadataName") String assessmentMetadataName, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") SecurityAssessmentMetadataResponseInner assessmentMetadata, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> deleteInSubscription( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("assessmentMetadataName") String assessmentMetadataName, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get metadata information on all assessment 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 metadata information on all assessment types along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2021-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metadata information on all assessment 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 metadata information on all assessment types along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2021-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get metadata information on all assessment 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 metadata information on all assessment types as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get metadata information on all assessment 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 metadata information on all assessment types as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get metadata information on all assessment 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 metadata information on all assessment types as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Get metadata information on all assessment 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 metadata information on all assessment types as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String assessmentMetadataName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (assessmentMetadataName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); - } - final String apiVersion = "2021-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, assessmentMetadataName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String assessmentMetadataName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (assessmentMetadataName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); - } - 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); - } - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String assessmentMetadataName) { - return getWithResponseAsync(assessmentMetadataName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String assessmentMetadataName, Context context) { - return getWithResponseAsync(assessmentMetadataName, context).block(); - } - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentMetadataResponseInner get(String assessmentMetadataName) { - return getWithResponse(assessmentMetadataName, Context.NONE).getValue(); - } - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required 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-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listBySubscription( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionSinglePageAsync( - 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-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscription(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionAsync() { - return new PagedFlux<>( - () -> listBySubscriptionSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionAsync(Context context) { - return new PagedFlux<>( - () -> listBySubscriptionSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscription() { - return new PagedIterable<>(listBySubscriptionAsync()); - } - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscription(Context context) { - return new PagedIterable<>(listBySubscriptionAsync(context)); - } - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInSubscriptionWithResponseAsync( - String assessmentMetadataName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (assessmentMetadataName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter assessmentMetadataName is required 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-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getInSubscription( - this.client.getEndpoint(), - apiVersion, - assessmentMetadataName, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getInSubscriptionWithResponseAsync( - String assessmentMetadataName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (assessmentMetadataName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter assessmentMetadataName is required 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-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getInSubscription( - this.client.getEndpoint(), - apiVersion, - assessmentMetadataName, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getInSubscriptionAsync(String assessmentMetadataName) { - return getInSubscriptionWithResponseAsync(assessmentMetadataName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getInSubscriptionWithResponse( - String assessmentMetadataName, Context context) { - return getInSubscriptionWithResponseAsync(assessmentMetadataName, context).block(); - } - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentMetadataResponseInner getInSubscription(String assessmentMetadataName) { - return getInSubscriptionWithResponse(assessmentMetadataName, Context.NONE).getValue(); - } - - /** - * Create metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param assessmentMetadata AssessmentMetadata object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata response along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createInSubscriptionWithResponseAsync( - String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (assessmentMetadataName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (assessmentMetadata == null) { - return Mono - .error(new IllegalArgumentException("Parameter assessmentMetadata is required and cannot be null.")); - } else { - assessmentMetadata.validate(); - } - final String apiVersion = "2021-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createInSubscription( - this.client.getEndpoint(), - apiVersion, - assessmentMetadataName, - this.client.getSubscriptionId(), - assessmentMetadata, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param assessmentMetadata AssessmentMetadata object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata response along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createInSubscriptionWithResponseAsync( - String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (assessmentMetadataName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter assessmentMetadataName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (assessmentMetadata == null) { - return Mono - .error(new IllegalArgumentException("Parameter assessmentMetadata is required and cannot be null.")); - } else { - assessmentMetadata.validate(); - } - final String apiVersion = "2021-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createInSubscription( - this.client.getEndpoint(), - apiVersion, - assessmentMetadataName, - this.client.getSubscriptionId(), - assessmentMetadata, - accept, - context); - } - - /** - * Create metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param assessmentMetadata AssessmentMetadata object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createInSubscriptionAsync( - String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata) { - return createInSubscriptionWithResponseAsync(assessmentMetadataName, assessmentMetadata) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param assessmentMetadata AssessmentMetadata object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createInSubscriptionWithResponse( - String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata, Context context) { - return createInSubscriptionWithResponseAsync(assessmentMetadataName, assessmentMetadata, context).block(); - } - - /** - * Create metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param assessmentMetadata AssessmentMetadata object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security assessment metadata response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityAssessmentMetadataResponseInner createInSubscription( - String assessmentMetadataName, SecurityAssessmentMetadataResponseInner assessmentMetadata) { - return createInSubscriptionWithResponse(assessmentMetadataName, assessmentMetadata, Context.NONE).getValue(); - } - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteInSubscriptionWithResponseAsync(String assessmentMetadataName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (assessmentMetadataName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter assessmentMetadataName is required 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-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .deleteInSubscription( - this.client.getEndpoint(), - apiVersion, - assessmentMetadataName, - this.client.getSubscriptionId(), - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteInSubscriptionWithResponseAsync(String assessmentMetadataName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (assessmentMetadataName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter assessmentMetadataName is required 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-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .deleteInSubscription( - this.client.getEndpoint(), - apiVersion, - assessmentMetadataName, - this.client.getSubscriptionId(), - accept, - context); - } - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteInSubscriptionAsync(String assessmentMetadataName) { - return deleteInSubscriptionWithResponseAsync(assessmentMetadataName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteInSubscriptionWithResponse(String assessmentMetadataName, Context context) { - return deleteInSubscriptionWithResponseAsync(assessmentMetadataName, context).block(); - } - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteInSubscription(String assessmentMetadataName) { - deleteInSubscriptionWithResponse(assessmentMetadataName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security assessment metadata along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java deleted file mode 100644 index 5a878349df35..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AssessmentsMetadatasImpl.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.AssessmentsMetadatasClient; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; -import com.azure.resourcemanager.security.models.AssessmentsMetadatas; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataResponse; - -public final class AssessmentsMetadatasImpl implements AssessmentsMetadatas { - private static final ClientLogger LOGGER = new ClientLogger(AssessmentsMetadatasImpl.class); - - private final AssessmentsMetadatasClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AssessmentsMetadatasImpl( - AssessmentsMetadatasClient 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 SecurityAssessmentMetadataResponseImpl(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 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 SecurityAssessmentMetadataResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityAssessmentMetadataResponse get(String assessmentMetadataName) { - SecurityAssessmentMetadataResponseInner inner = this.serviceClient().get(assessmentMetadataName); - if (inner != null) { - return new SecurityAssessmentMetadataResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - 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 SecurityAssessmentMetadataResponseImpl(inner1, this.manager())); - } - - public Response getInSubscriptionWithResponse( - String assessmentMetadataName, Context context) { - Response inner = - this.serviceClient().getInSubscriptionWithResponse(assessmentMetadataName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecurityAssessmentMetadataResponseImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityAssessmentMetadataResponse getInSubscription(String assessmentMetadataName) { - SecurityAssessmentMetadataResponseInner inner = this.serviceClient().getInSubscription(assessmentMetadataName); - if (inner != null) { - return new SecurityAssessmentMetadataResponseImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteInSubscriptionWithResponse(String assessmentMetadataName, Context context) { - return this.serviceClient().deleteInSubscriptionWithResponse(assessmentMetadataName, context); - } - - public void deleteInSubscription(String assessmentMetadataName) { - this.serviceClient().deleteInSubscription(assessmentMetadataName); - } - - public SecurityAssessmentMetadataResponse getInSubscriptionById(String id) { - String assessmentMetadataName = Utils.getValueFromIdByName(id, "assessmentMetadata"); - if (assessmentMetadataName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'assessmentMetadata'.", id))); - } - return this.getInSubscriptionWithResponse(assessmentMetadataName, Context.NONE).getValue(); - } - - public Response getInSubscriptionByIdWithResponse(String id, Context context) { - String assessmentMetadataName = Utils.getValueFromIdByName(id, "assessmentMetadata"); - if (assessmentMetadataName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'assessmentMetadata'.", id))); - } - return this.getInSubscriptionWithResponse(assessmentMetadataName, context); - } - - public void deleteInSubscriptionById(String id) { - String assessmentMetadataName = Utils.getValueFromIdByName(id, "assessmentMetadata"); - if (assessmentMetadataName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'assessmentMetadata'.", id))); - } - this.deleteInSubscriptionWithResponse(assessmentMetadataName, Context.NONE); - } - - public Response deleteInSubscriptionByIdWithResponse(String id, Context context) { - String assessmentMetadataName = Utils.getValueFromIdByName(id, "assessmentMetadata"); - if (assessmentMetadataName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'assessmentMetadata'.", id))); - } - return this.deleteInSubscriptionWithResponse(assessmentMetadataName, context); - } - - private AssessmentsMetadatasClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - 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/AutoProvisioningSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingImpl.java deleted file mode 100644 index 896c6cbf9791..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AutoProvisioningSetting; - -public final class AutoProvisioningSettingImpl implements AutoProvisioningSetting, AutoProvisioningSetting.Definition { - private AutoProvisioningSettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AutoProvisioningSettingImpl( - AutoProvisioningSettingInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public AutoProvision autoProvision() { - return this.innerModel().autoProvision(); - } - - public AutoProvisioningSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String settingName; - - public AutoProvisioningSetting create() { - this.innerObject = - serviceManager - .serviceClient() - .getAutoProvisioningSettings() - .createWithResponse(settingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public AutoProvisioningSetting create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAutoProvisioningSettings() - .createWithResponse(settingName, this.innerModel(), context) - .getValue(); - return this; - } - - AutoProvisioningSettingImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AutoProvisioningSettingInner(); - this.serviceManager = serviceManager; - this.settingName = name; - } - - public AutoProvisioningSetting refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getAutoProvisioningSettings() - .getWithResponse(settingName, Context.NONE) - .getValue(); - return this; - } - - public AutoProvisioningSetting refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAutoProvisioningSettings() - .getWithResponse(settingName, context) - .getValue(); - return this; - } - - public AutoProvisioningSettingImpl withAutoProvision(AutoProvision autoProvision) { - this.innerModel().withAutoProvision(autoProvision); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsClientImpl.java deleted file mode 100644 index 9c600ec6bd5d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsClientImpl.java +++ /dev/null @@ -1,582 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.AutoProvisioningSettingsClient; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import com.azure.resourcemanager.security.models.AutoProvisioningSettingList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AutoProvisioningSettingsClient. */ -public final class AutoProvisioningSettingsClientImpl implements AutoProvisioningSettingsClient { - /** The proxy service used to perform REST calls. */ - private final AutoProvisioningSettingsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AutoProvisioningSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AutoProvisioningSettingsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(AutoProvisioningSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAutoProvisioningSettings to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAutoPr") - public interface AutoProvisioningSettingsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") String settingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") String settingName, - @BodyParam("application/json") AutoProvisioningSettingInner setting, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String settingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - settingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String settingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingName, accept, context); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String settingName) { - return getWithResponseAsync(settingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String settingName, Context context) { - return getWithResponseAsync(settingName, context).block(); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutoProvisioningSettingInner get(String settingName) { - return getWithResponse(settingName, Context.NONE).getValue(); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String settingName, AutoProvisioningSettingInner setting) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (setting == null) { - return Mono.error(new IllegalArgumentException("Parameter setting is required and cannot be null.")); - } else { - setting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - settingName, - setting, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String settingName, AutoProvisioningSettingInner setting, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (setting == null) { - return Mono.error(new IllegalArgumentException("Parameter setting is required and cannot be null.")); - } else { - setting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - settingName, - setting, - accept, - context); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String settingName, AutoProvisioningSettingInner setting) { - return createWithResponseAsync(settingName, setting).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String settingName, AutoProvisioningSettingInner setting, Context context) { - return createWithResponseAsync(settingName, setting, context).block(); - } - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param setting Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutoProvisioningSettingInner create(String settingName, AutoProvisioningSettingInner setting) { - return createWithResponse(settingName, setting, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 all the auto provisioning settings response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 all the auto provisioning settings response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsImpl.java deleted file mode 100644 index 7d284eeb293e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutoProvisioningSettingsImpl.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AutoProvisioningSettingsClient; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import com.azure.resourcemanager.security.models.AutoProvisioningSetting; -import com.azure.resourcemanager.security.models.AutoProvisioningSettings; - -public final class AutoProvisioningSettingsImpl implements AutoProvisioningSettings { - private static final ClientLogger LOGGER = new ClientLogger(AutoProvisioningSettingsImpl.class); - - private final AutoProvisioningSettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AutoProvisioningSettingsImpl( - AutoProvisioningSettingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new AutoProvisioningSettingImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new AutoProvisioningSettingImpl(inner1, this.manager())); - } - - public Response getWithResponse(String settingName, Context context) { - Response inner = this.serviceClient().getWithResponse(settingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AutoProvisioningSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AutoProvisioningSetting get(String settingName) { - AutoProvisioningSettingInner inner = this.serviceClient().get(settingName); - if (inner != null) { - return new AutoProvisioningSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public AutoProvisioningSetting getById(String id) { - String settingName = Utils.getValueFromIdByName(id, "autoProvisioningSettings"); - if (settingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'autoProvisioningSettings'.", - id))); - } - return this.getWithResponse(settingName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String settingName = Utils.getValueFromIdByName(id, "autoProvisioningSettings"); - if (settingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'autoProvisioningSettings'.", - id))); - } - return this.getWithResponse(settingName, context); - } - - private AutoProvisioningSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AutoProvisioningSettingImpl define(String name) { - return new AutoProvisioningSettingImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationImpl.java deleted file mode 100644 index 1fe4c63468b0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationImpl.java +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.models.Automation; -import com.azure.resourcemanager.security.models.AutomationAction; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.azure.resourcemanager.security.models.AutomationValidationStatus; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class AutomationImpl implements Automation, Automation.Definition, Automation.Update { - private AutomationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String description() { - return this.innerModel().description(); - } - - public Boolean isEnabled() { - return this.innerModel().isEnabled(); - } - - public List scopes() { - List inner = this.innerModel().scopes(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List sources() { - List inner = this.innerModel().sources(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List actions() { - List inner = this.innerModel().actions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public AutomationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String automationName; - - public AutomationImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public Automation create() { - this.innerObject = - serviceManager - .serviceClient() - .getAutomations() - .createOrUpdateWithResponse(resourceGroupName, automationName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Automation create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAutomations() - .createOrUpdateWithResponse(resourceGroupName, automationName, this.innerModel(), context) - .getValue(); - return this; - } - - AutomationImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new AutomationInner(); - this.serviceManager = serviceManager; - this.automationName = name; - } - - public AutomationImpl update() { - return this; - } - - public Automation apply() { - this.innerObject = - serviceManager - .serviceClient() - .getAutomations() - .createOrUpdateWithResponse(resourceGroupName, automationName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Automation apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAutomations() - .createOrUpdateWithResponse(resourceGroupName, automationName, this.innerModel(), context) - .getValue(); - return this; - } - - AutomationImpl(AutomationInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.automationName = Utils.getValueFromIdByName(innerObject.id(), "automations"); - } - - public Automation refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getAutomations() - .getByResourceGroupWithResponse(resourceGroupName, automationName, Context.NONE) - .getValue(); - return this; - } - - public Automation refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAutomations() - .getByResourceGroupWithResponse(resourceGroupName, automationName, context) - .getValue(); - return this; - } - - public Response validateWithResponse(AutomationInner automation, Context context) { - return serviceManager - .automations() - .validateWithResponse(resourceGroupName, automationName, automation, context); - } - - public AutomationValidationStatus validate(AutomationInner automation) { - return serviceManager.automations().validate(resourceGroupName, automationName, automation); - } - - public AutomationImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public AutomationImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public AutomationImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public AutomationImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - public AutomationImpl withIsEnabled(Boolean isEnabled) { - this.innerModel().withIsEnabled(isEnabled); - return this; - } - - public AutomationImpl withScopes(List scopes) { - this.innerModel().withScopes(scopes); - return this; - } - - public AutomationImpl withSources(List sources) { - this.innerModel().withSources(sources); - return this; - } - - public AutomationImpl withActions(List actions) { - this.innerModel().withActions(actions); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationValidationStatusImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationValidationStatusImpl.java deleted file mode 100644 index 5e3c49c7e027..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationValidationStatusImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; -import com.azure.resourcemanager.security.models.AutomationValidationStatus; - -public final class AutomationValidationStatusImpl implements AutomationValidationStatus { - private AutomationValidationStatusInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - AutomationValidationStatusImpl( - AutomationValidationStatusInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public Boolean isValid() { - return this.innerModel().isValid(); - } - - public String message() { - return this.innerModel().message(); - } - - public AutomationValidationStatusInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsClientImpl.java deleted file mode 100644 index 2348e654c1b2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsClientImpl.java +++ /dev/null @@ -1,1278 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.AutomationsClient; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; -import com.azure.resourcemanager.security.models.AutomationList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in AutomationsClient. */ -public final class AutomationsClientImpl implements AutomationsClient { - /** The proxy service used to perform REST calls. */ - private final AutomationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of AutomationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - AutomationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(AutomationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterAutomations to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterAutoma") - public interface AutomationsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/automations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("automationName") String automationName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("automationName") String automationName, - @BodyParam("application/json") AutomationInner automation, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("automationName") String automationName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> validate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("automationName") String automationName, - @BodyParam("application/json") AutomationInner automation, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String automationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - automationName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String automationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - automationName, - accept, - context); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String automationName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, automationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String automationName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, automationName, context).block(); - } - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutomationInner getByResourceGroup(String resourceGroupName, String automationName) { - return getByResourceGroupWithResponse(resourceGroupName, automationName, Context.NONE).getValue(); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation id, then it will be updated. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String automationName, AutomationInner automation) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - automationName, - automation, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation id, then it will be updated. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String automationName, AutomationInner automation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - automationName, - automation, - accept, - context); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation id, then it will be updated. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String automationName, AutomationInner automation) { - return createOrUpdateWithResponseAsync(resourceGroupName, automationName, automation) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation id, then it will be updated. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String automationName, AutomationInner automation, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, automationName, automation, context).block(); - } - - /** - * Creates or updates a security automation. If a security automation is already created and a subsequent request is - * issued for the same automation id, then it will be updated. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutomationInner createOrUpdate(String resourceGroupName, String automationName, AutomationInner automation) { - return createOrUpdateWithResponse(resourceGroupName, automationName, automation, Context.NONE).getValue(); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String automationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - automationName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String automationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - automationName, - accept, - context); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String automationName) { - return deleteWithResponseAsync(resourceGroupName, automationName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String automationName, Context context) { - return deleteWithResponseAsync(resourceGroupName, automationName, context).block(); - } - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String automationName) { - deleteWithResponse(resourceGroupName, automationName, Context.NONE); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation model state property bag along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync( - String resourceGroupName, String automationName, AutomationInner automation) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .validate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - automationName, - automation, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation model state property bag along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> validateWithResponseAsync( - String resourceGroupName, String automationName, AutomationInner automation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (automationName == null) { - return Mono.error(new IllegalArgumentException("Parameter automationName is required and cannot be null.")); - } - if (automation == null) { - return Mono.error(new IllegalArgumentException("Parameter automation is required and cannot be null.")); - } else { - automation.validate(); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .validate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - automationName, - automation, - accept, - context); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation model state property bag on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono validateAsync( - String resourceGroupName, String automationName, AutomationInner automation) { - return validateWithResponseAsync(resourceGroupName, automationName, automation) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation model state property bag along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response validateWithResponse( - String resourceGroupName, String automationName, AutomationInner automation, Context context) { - return validateWithResponseAsync(resourceGroupName, automationName, automation, context).block(); - } - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation model state property bag. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AutomationValidationStatusInner validate( - String resourceGroupName, String automationName, AutomationInner automation) { - return validateWithResponse(resourceGroupName, automationName, automation, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsImpl.java deleted file mode 100644 index b0ab5eaeb2e0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/AutomationsImpl.java +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.AutomationsClient; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; -import com.azure.resourcemanager.security.models.Automation; -import com.azure.resourcemanager.security.models.AutomationValidationStatus; -import com.azure.resourcemanager.security.models.Automations; - -public final class AutomationsImpl implements Automations { - private static final ClientLogger LOGGER = new ClientLogger(AutomationsImpl.class); - - private final AutomationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public AutomationsImpl( - AutomationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new AutomationImpl(inner1, this.manager())); - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String automationName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, automationName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AutomationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Automation getByResourceGroup(String resourceGroupName, String automationName) { - AutomationInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, automationName); - if (inner != null) { - return new AutomationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String automationName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, automationName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String automationName) { - this.serviceClient().delete(resourceGroupName, automationName); - } - - public Response validateWithResponse( - String resourceGroupName, String automationName, AutomationInner automation, Context context) { - Response inner = - this.serviceClient().validateWithResponse(resourceGroupName, automationName, automation, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AutomationValidationStatusImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AutomationValidationStatus validate( - String resourceGroupName, String automationName, AutomationInner automation) { - AutomationValidationStatusInner inner = - this.serviceClient().validate(resourceGroupName, automationName, automation); - if (inner != null) { - return new AutomationValidationStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public Automation getById(String id) { - String resourceGroupName = 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 automationName = Utils.getValueFromIdByName(id, "automations"); - if (automationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'automations'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, automationName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = 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 automationName = Utils.getValueFromIdByName(id, "automations"); - if (automationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'automations'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, automationName, context); - } - - public void deleteById(String id) { - String resourceGroupName = 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 automationName = Utils.getValueFromIdByName(id, "automations"); - if (automationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'automations'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceGroupName, automationName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = 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 automationName = Utils.getValueFromIdByName(id, "automations"); - if (automationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'automations'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, automationName, context); - } - - private AutomationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public AutomationImpl define(String name) { - return new AutomationImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceImpl.java deleted file mode 100644 index 852c490b819c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import com.azure.resourcemanager.security.models.Compliance; -import com.azure.resourcemanager.security.models.ComplianceSegment; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class ComplianceImpl implements Compliance { - private ComplianceInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ComplianceImpl(ComplianceInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public OffsetDateTime assessmentTimestampUtcDate() { - return this.innerModel().assessmentTimestampUtcDate(); - } - - public Integer resourceCount() { - return this.innerModel().resourceCount(); - } - - public List assessmentResult() { - List inner = this.innerModel().assessmentResult(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ComplianceInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultImpl.java deleted file mode 100644 index dd6a7518892a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ComplianceResultInner; -import com.azure.resourcemanager.security.models.ComplianceResult; -import com.azure.resourcemanager.security.models.ResourceStatus; - -public final class ComplianceResultImpl implements ComplianceResult { - private ComplianceResultInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ComplianceResultImpl( - ComplianceResultInner 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 ResourceStatus resourceStatus() { - return this.innerModel().resourceStatus(); - } - - public ComplianceResultInner 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/ComplianceResultsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultsClientImpl.java deleted file mode 100644 index 94eef1b3a1f7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultsClientImpl.java +++ /dev/null @@ -1,422 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.ComplianceResultsClient; -import com.azure.resourcemanager.security.fluent.models.ComplianceResultInner; -import com.azure.resourcemanager.security.models.ComplianceResultList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ComplianceResultsClient. */ -public final class ComplianceResultsClientImpl implements ComplianceResultsClient { - /** The proxy service used to perform REST calls. */ - private final ComplianceResultsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ComplianceResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ComplianceResultsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(ComplianceResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterComplianceResults to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterCompli") - public interface ComplianceResultsService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/complianceResults") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("complianceResultName") String complianceResultName, - @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); - } - - /** - * Security compliance results in the subscription. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of compliance results response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2017-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Security compliance results in the subscription. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of compliance results response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2017-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Security compliance results in the subscription. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of compliance results response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Security compliance results in the subscription. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of compliance results response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Security compliance results in the subscription. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of compliance results response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Security compliance results in the subscription. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of compliance results response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Security Compliance Result. - * - * @param resourceId The identifier of the resource. - * @param complianceResultName name of the desired assessment compliance result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a compliance result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String complianceResultName) { - 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 (complianceResultName == null) { - return Mono - .error(new IllegalArgumentException("Parameter complianceResultName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get(this.client.getEndpoint(), apiVersion, resourceId, complianceResultName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Security Compliance Result. - * - * @param resourceId The identifier of the resource. - * @param complianceResultName name of the desired assessment compliance result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a compliance result along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceId, String complianceResultName, 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 (complianceResultName == null) { - return Mono - .error(new IllegalArgumentException("Parameter complianceResultName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, complianceResultName, accept, context); - } - - /** - * Security Compliance Result. - * - * @param resourceId The identifier of the resource. - * @param complianceResultName name of the desired assessment compliance result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a compliance result on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String complianceResultName) { - return getWithResponseAsync(resourceId, complianceResultName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Security Compliance Result. - * - * @param resourceId The identifier of the resource. - * @param complianceResultName name of the desired assessment compliance result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a compliance result along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceId, String complianceResultName, Context context) { - return getWithResponseAsync(resourceId, complianceResultName, context).block(); - } - - /** - * Security Compliance Result. - * - * @param resourceId The identifier of the resource. - * @param complianceResultName name of the desired assessment compliance result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a compliance result. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ComplianceResultInner get(String resourceId, String complianceResultName) { - return getWithResponse(resourceId, complianceResultName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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 compliance results response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultsImpl.java deleted file mode 100644 index 2aa80fd05d01..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ComplianceResultsImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.ComplianceResultsClient; -import com.azure.resourcemanager.security.fluent.models.ComplianceResultInner; -import com.azure.resourcemanager.security.models.ComplianceResult; -import com.azure.resourcemanager.security.models.ComplianceResults; - -public final class ComplianceResultsImpl implements ComplianceResults { - private static final ClientLogger LOGGER = new ClientLogger(ComplianceResultsImpl.class); - - private final ComplianceResultsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ComplianceResultsImpl( - ComplianceResultsClient 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 ComplianceResultImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return Utils.mapPage(inner, inner1 -> new ComplianceResultImpl(inner1, this.manager())); - } - - public Response getWithResponse(String resourceId, String complianceResultName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceId, complianceResultName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ComplianceResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ComplianceResult get(String resourceId, String complianceResultName) { - ComplianceResultInner inner = this.serviceClient().get(resourceId, complianceResultName); - if (inner != null) { - return new ComplianceResultImpl(inner, this.manager()); - } else { - return null; - } - } - - private ComplianceResultsClient 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/CompliancesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesClientImpl.java deleted file mode 100644 index 9dc3ac51dad7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesClientImpl.java +++ /dev/null @@ -1,421 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.CompliancesClient; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import com.azure.resourcemanager.security.models.ComplianceList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in CompliancesClient. */ -public final class CompliancesClientImpl implements CompliancesClient { - /** The proxy service used to perform REST calls. */ - private final CompliancesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of CompliancesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CompliancesClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(CompliancesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterCompliances to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterCompli") - public interface CompliancesService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/compliances") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/compliances/{complianceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("complianceName") String complianceName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String complianceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (complianceName == null) { - return Mono.error(new IllegalArgumentException("Parameter complianceName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), apiVersion, scope, complianceName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String complianceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (complianceName == null) { - return Mono.error(new IllegalArgumentException("Parameter complianceName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, complianceName, accept, context); - } - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String complianceName) { - return getWithResponseAsync(scope, complianceName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String complianceName, Context context) { - return getWithResponseAsync(scope, complianceName, context).block(); - } - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ComplianceInner get(String scope, String complianceName) { - return getWithResponse(scope, complianceName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 Compliance objects response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 Compliance objects response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesImpl.java deleted file mode 100644 index b8e4641782c3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CompliancesImpl.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.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.CompliancesClient; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import com.azure.resourcemanager.security.models.Compliance; -import com.azure.resourcemanager.security.models.Compliances; - -public final class CompliancesImpl implements Compliances { - private static final ClientLogger LOGGER = new ClientLogger(CompliancesImpl.class); - - private final CompliancesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public CompliancesImpl( - CompliancesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new ComplianceImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return Utils.mapPage(inner, inner1 -> new ComplianceImpl(inner1, this.manager())); - } - - public Response getWithResponse(String scope, String complianceName, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, complianceName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ComplianceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Compliance get(String scope, String complianceName) { - ComplianceInner inner = this.serviceClient().get(scope, complianceName); - if (inner != null) { - return new ComplianceImpl(inner, this.manager()); - } else { - return null; - } - } - - private CompliancesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectionStringsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectionStringsImpl.java deleted file mode 100644 index 9014f64c6f6b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectionStringsImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import com.azure.resourcemanager.security.models.ConnectionStrings; -import com.azure.resourcemanager.security.models.IngestionConnectionString; -import java.util.Collections; -import java.util.List; - -public final class ConnectionStringsImpl implements ConnectionStrings { - private ConnectionStringsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ConnectionStringsImpl( - ConnectionStringsInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public ConnectionStringsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorSettingImpl.java deleted file mode 100644 index 8fdafd0a7a49..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorSettingImpl.java +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; -import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.ConnectorSetting; -import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; - -public final class ConnectorSettingImpl - implements ConnectorSetting, ConnectorSetting.Definition, ConnectorSetting.Update { - private ConnectorSettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public HybridComputeSettingsProperties hybridComputeSettings() { - return this.innerModel().hybridComputeSettings(); - } - - public AuthenticationDetailsProperties authenticationDetails() { - return this.innerModel().authenticationDetails(); - } - - public ConnectorSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String connectorName; - - public ConnectorSetting create() { - this.innerObject = - serviceManager - .serviceClient() - .getConnectors() - .createOrUpdateWithResponse(connectorName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public ConnectorSetting create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getConnectors() - .createOrUpdateWithResponse(connectorName, this.innerModel(), context) - .getValue(); - return this; - } - - ConnectorSettingImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new ConnectorSettingInner(); - this.serviceManager = serviceManager; - this.connectorName = name; - } - - public ConnectorSettingImpl update() { - return this; - } - - public ConnectorSetting apply() { - this.innerObject = - serviceManager - .serviceClient() - .getConnectors() - .createOrUpdateWithResponse(connectorName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public ConnectorSetting apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getConnectors() - .createOrUpdateWithResponse(connectorName, this.innerModel(), context) - .getValue(); - return this; - } - - ConnectorSettingImpl( - ConnectorSettingInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.connectorName = Utils.getValueFromIdByName(innerObject.id(), "connectors"); - } - - public ConnectorSetting refresh() { - this.innerObject = - serviceManager.serviceClient().getConnectors().getWithResponse(connectorName, Context.NONE).getValue(); - return this; - } - - public ConnectorSetting refresh(Context context) { - this.innerObject = - serviceManager.serviceClient().getConnectors().getWithResponse(connectorName, context).getValue(); - return this; - } - - public ConnectorSettingImpl withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings) { - this.innerModel().withHybridComputeSettings(hybridComputeSettings); - return this; - } - - public ConnectorSettingImpl withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails) { - this.innerModel().withAuthenticationDetails(authenticationDetails); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsClientImpl.java deleted file mode 100644 index 21700bf0455a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsClientImpl.java +++ /dev/null @@ -1,726 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.ConnectorsClient; -import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; -import com.azure.resourcemanager.security.models.ConnectorSettingList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ConnectorsClient. */ -public final class ConnectorsClientImpl implements ConnectorsClient { - /** The proxy service used to perform REST calls. */ - private final ConnectorsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ConnectorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ConnectorsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(ConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterConnectors to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterConnec") - public interface ConnectorsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("connectorName") String connectorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("connectorName") String connectorName, - @BodyParam("application/json") ConnectorSettingInner connectorSetting, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("connectorName") String connectorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Cloud accounts connectors of a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Cloud accounts connectors of a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Cloud accounts connectors of a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Cloud accounts connectors of a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Cloud accounts connectors of a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Cloud accounts connectors of a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String connectorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - connectorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String connectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), connectorName, accept, context); - } - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String connectorName) { - return getWithResponseAsync(connectorName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String connectorName, Context context) { - return getWithResponseAsync(connectorName, context).block(); - } - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectorSettingInner get(String connectorName) { - return getWithResponse(connectorName, Context.NONE).getValue(); - } - - /** - * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either - * account credentials or role-based authentication. For GCP, use account organization credentials. - * - * @param connectorName Name of the cloud account connector. - * @param connectorSetting Settings for the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String connectorName, ConnectorSettingInner connectorSetting) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); - } - if (connectorSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectorSetting is required and cannot be null.")); - } else { - connectorSetting.validate(); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - connectorName, - connectorSetting, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either - * account credentials or role-based authentication. For GCP, use account organization credentials. - * - * @param connectorName Name of the cloud account connector. - * @param connectorSetting Settings for the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String connectorName, ConnectorSettingInner connectorSetting, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); - } - if (connectorSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter connectorSetting is required and cannot be null.")); - } else { - connectorSetting.validate(); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - connectorName, - connectorSetting, - accept, - context); - } - - /** - * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either - * account credentials or role-based authentication. For GCP, use account organization credentials. - * - * @param connectorName Name of the cloud account connector. - * @param connectorSetting Settings for the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String connectorName, ConnectorSettingInner connectorSetting) { - return createOrUpdateWithResponseAsync(connectorName, connectorSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either - * account credentials or role-based authentication. For GCP, use account organization credentials. - * - * @param connectorName Name of the cloud account connector. - * @param connectorSetting Settings for the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String connectorName, ConnectorSettingInner connectorSetting, Context context) { - return createOrUpdateWithResponseAsync(connectorName, connectorSetting, context).block(); - } - - /** - * Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either - * account credentials or role-based authentication. For GCP, use account organization credentials. - * - * @param connectorName Name of the cloud account connector. - * @param connectorSetting Settings for the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectorSettingInner createOrUpdate(String connectorName, ConnectorSettingInner connectorSetting) { - return createOrUpdateWithResponse(connectorName, connectorSetting, Context.NONE).getValue(); - } - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String connectorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - connectorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String connectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (connectorName == null) { - return Mono.error(new IllegalArgumentException("Parameter connectorName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), connectorName, accept, context); - } - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String connectorName) { - return deleteWithResponseAsync(connectorName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String connectorName, Context context) { - return deleteWithResponseAsync(connectorName, context).block(); - } - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String connectorName) { - deleteWithResponse(connectorName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 for a subscription, list of all cloud account connectors and their settings along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 for a subscription, list of all cloud account connectors and their settings along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsImpl.java deleted file mode 100644 index ba0dd85d8a64..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ConnectorsImpl.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.ConnectorsClient; -import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; -import com.azure.resourcemanager.security.models.ConnectorSetting; -import com.azure.resourcemanager.security.models.Connectors; - -public final class ConnectorsImpl implements Connectors { - private static final ClientLogger LOGGER = new ClientLogger(ConnectorsImpl.class); - - private final ConnectorsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ConnectorsImpl( - ConnectorsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ConnectorSettingImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ConnectorSettingImpl(inner1, this.manager())); - } - - public Response getWithResponse(String connectorName, Context context) { - Response inner = this.serviceClient().getWithResponse(connectorName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ConnectorSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ConnectorSetting get(String connectorName) { - ConnectorSettingInner inner = this.serviceClient().get(connectorName); - if (inner != null) { - return new ConnectorSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String connectorName, Context context) { - return this.serviceClient().deleteWithResponse(connectorName, context); - } - - public void delete(String connectorName) { - this.serviceClient().delete(connectorName); - } - - public ConnectorSetting getById(String id) { - String connectorName = Utils.getValueFromIdByName(id, "connectors"); - if (connectorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); - } - return this.getWithResponse(connectorName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String connectorName = Utils.getValueFromIdByName(id, "connectors"); - if (connectorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); - } - return this.getWithResponse(connectorName, context); - } - - public void deleteById(String id) { - String connectorName = Utils.getValueFromIdByName(id, "connectors"); - if (connectorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); - } - this.deleteWithResponse(connectorName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String connectorName = Utils.getValueFromIdByName(id, "connectors"); - if (connectorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'connectors'.", id))); - } - return this.deleteWithResponse(connectorName, context); - } - - private ConnectorsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public ConnectorSettingImpl define(String name) { - return new ConnectorSettingImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java deleted file mode 100644 index 4b7d59d784b0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationImpl.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; -import com.azure.resourcemanager.security.models.CustomAssessmentAutomation; -import com.azure.resourcemanager.security.models.CustomAssessmentAutomationRequest; -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; - -public final class CustomAssessmentAutomationImpl - implements CustomAssessmentAutomation, CustomAssessmentAutomation.Definition { - private CustomAssessmentAutomationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - CustomAssessmentAutomationImpl( - CustomAssessmentAutomationInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String compressedQuery() { - return this.innerModel().compressedQuery(); - } - - public SupportedCloudEnum supportedCloud() { - return this.innerModel().supportedCloud(); - } - - public SeverityEnum severity() { - return this.innerModel().severity(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public String remediationDescription() { - return this.innerModel().remediationDescription(); - } - - public String assessmentKey() { - return this.innerModel().assessmentKey(); - } - - public CustomAssessmentAutomationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String customAssessmentAutomationName; - - private CustomAssessmentAutomationRequest createCustomAssessmentAutomationBody; - - public CustomAssessmentAutomationImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public CustomAssessmentAutomation create() { - this.innerObject = - serviceManager - .serviceClient() - .getCustomAssessmentAutomations() - .createWithResponse( - resourceGroupName, - customAssessmentAutomationName, - createCustomAssessmentAutomationBody, - Context.NONE) - .getValue(); - return this; - } - - public CustomAssessmentAutomation create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCustomAssessmentAutomations() - .createWithResponse( - resourceGroupName, customAssessmentAutomationName, createCustomAssessmentAutomationBody, context) - .getValue(); - return this; - } - - CustomAssessmentAutomationImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new CustomAssessmentAutomationInner(); - this.serviceManager = serviceManager; - this.customAssessmentAutomationName = name; - this.createCustomAssessmentAutomationBody = new CustomAssessmentAutomationRequest(); - } - - public CustomAssessmentAutomation refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getCustomAssessmentAutomations() - .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE) - .getValue(); - return this; - } - - public CustomAssessmentAutomation refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCustomAssessmentAutomations() - .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, context) - .getValue(); - return this; - } - - public CustomAssessmentAutomationImpl withCompressedQuery(String compressedQuery) { - this.createCustomAssessmentAutomationBody.withCompressedQuery(compressedQuery); - return this; - } - - public CustomAssessmentAutomationImpl withSupportedCloud(SupportedCloudEnum supportedCloud) { - this.createCustomAssessmentAutomationBody.withSupportedCloud(supportedCloud); - return this; - } - - public CustomAssessmentAutomationImpl withSeverity(SeverityEnum severity) { - this.createCustomAssessmentAutomationBody.withSeverity(severity); - return this; - } - - public CustomAssessmentAutomationImpl withDisplayName(String displayName) { - this.createCustomAssessmentAutomationBody.withDisplayName(displayName); - return this; - } - - public CustomAssessmentAutomationImpl withDescription(String description) { - this.createCustomAssessmentAutomationBody.withDescription(description); - return this; - } - - public CustomAssessmentAutomationImpl withRemediationDescription(String remediationDescription) { - this.createCustomAssessmentAutomationBody.withRemediationDescription(remediationDescription); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java deleted file mode 100644 index 21111c2d2a9e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsClientImpl.java +++ /dev/null @@ -1,1191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.CustomAssessmentAutomationsClient; -import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; -import com.azure.resourcemanager.security.models.CustomAssessmentAutomationRequest; -import com.azure.resourcemanager.security.models.CustomAssessmentAutomationsListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in CustomAssessmentAutomationsClient. */ -public final class CustomAssessmentAutomationsClientImpl implements CustomAssessmentAutomationsClient { - /** The proxy service used to perform REST calls. */ - private final CustomAssessmentAutomationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of CustomAssessmentAutomationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CustomAssessmentAutomationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - CustomAssessmentAutomationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterCustomAssessmentAutomations to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterCustom") - public interface CustomAssessmentAutomationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("customAssessmentAutomationName") String customAssessmentAutomationName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("customAssessmentAutomationName") String customAssessmentAutomationName, - @BodyParam("application/json") CustomAssessmentAutomationRequest customAssessmentAutomationBody, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("customAssessmentAutomationName") String customAssessmentAutomationName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/customAssessmentAutomations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom assessment automation by name for the provided subscription and resource group along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String customAssessmentAutomationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (customAssessmentAutomationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationName is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customAssessmentAutomationName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom assessment automation by name for the provided subscription and resource group along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String customAssessmentAutomationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (customAssessmentAutomationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationName is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customAssessmentAutomationName, - accept, - context); - } - - /** - * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom assessment automation by name for the provided subscription and resource group on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String customAssessmentAutomationName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, customAssessmentAutomationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom assessment automation by name for the provided subscription and resource group along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String customAssessmentAutomationName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, customAssessmentAutomationName, context).block(); - } - - /** - * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom assessment automation by name for the provided subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CustomAssessmentAutomationInner getByResourceGroup( - String resourceGroupName, String customAssessmentAutomationName) { - return getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE) - .getValue(); - } - - /** - * Creates a custom assessment automation - * - *

Creates or updates a custom assessment automation for the provided subscription. Please note that providing an - * existing custom assessment automation will replace the existing record. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param customAssessmentAutomationBody Custom Assessment Automation body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Assessment Automation along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String customAssessmentAutomationName, - CustomAssessmentAutomationRequest customAssessmentAutomationBody) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (customAssessmentAutomationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationName is required and cannot be null.")); - } - if (customAssessmentAutomationBody == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationBody is required and cannot be null.")); - } else { - customAssessmentAutomationBody.validate(); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customAssessmentAutomationName, - customAssessmentAutomationBody, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a custom assessment automation - * - *

Creates or updates a custom assessment automation for the provided subscription. Please note that providing an - * existing custom assessment automation will replace the existing record. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param customAssessmentAutomationBody Custom Assessment Automation body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Assessment Automation along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String customAssessmentAutomationName, - CustomAssessmentAutomationRequest customAssessmentAutomationBody, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (customAssessmentAutomationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationName is required and cannot be null.")); - } - if (customAssessmentAutomationBody == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationBody is required and cannot be null.")); - } else { - customAssessmentAutomationBody.validate(); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customAssessmentAutomationName, - customAssessmentAutomationBody, - accept, - context); - } - - /** - * Creates a custom assessment automation - * - *

Creates or updates a custom assessment automation for the provided subscription. Please note that providing an - * existing custom assessment automation will replace the existing record. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param customAssessmentAutomationBody Custom Assessment Automation body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Assessment Automation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String customAssessmentAutomationName, - CustomAssessmentAutomationRequest customAssessmentAutomationBody) { - return createWithResponseAsync( - resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates a custom assessment automation - * - *

Creates or updates a custom assessment automation for the provided subscription. Please note that providing an - * existing custom assessment automation will replace the existing record. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param customAssessmentAutomationBody Custom Assessment Automation body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Assessment Automation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String customAssessmentAutomationName, - CustomAssessmentAutomationRequest customAssessmentAutomationBody, - Context context) { - return createWithResponseAsync( - resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody, context) - .block(); - } - - /** - * Creates a custom assessment automation - * - *

Creates or updates a custom assessment automation for the provided subscription. Please note that providing an - * existing custom assessment automation will replace the existing record. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param customAssessmentAutomationBody Custom Assessment Automation body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom Assessment Automation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CustomAssessmentAutomationInner create( - String resourceGroupName, - String customAssessmentAutomationName, - CustomAssessmentAutomationRequest customAssessmentAutomationBody) { - return createWithResponse( - resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody, Context.NONE) - .getValue(); - } - - /** - * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String customAssessmentAutomationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (customAssessmentAutomationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationName is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customAssessmentAutomationName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String customAssessmentAutomationName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (customAssessmentAutomationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customAssessmentAutomationName is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customAssessmentAutomationName, - accept, - context); - } - - /** - * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String customAssessmentAutomationName) { - return deleteWithResponseAsync(resourceGroupName, customAssessmentAutomationName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String customAssessmentAutomationName, Context context) { - return deleteWithResponseAsync(resourceGroupName, customAssessmentAutomationName, context).block(); - } - - /** - * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String customAssessmentAutomationName) { - deleteWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE); - } - - /** - * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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 along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java deleted file mode 100644 index 460555a46574..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomAssessmentAutomationsImpl.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.CustomAssessmentAutomationsClient; -import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; -import com.azure.resourcemanager.security.models.CustomAssessmentAutomation; -import com.azure.resourcemanager.security.models.CustomAssessmentAutomations; - -public final class CustomAssessmentAutomationsImpl implements CustomAssessmentAutomations { - private static final ClientLogger LOGGER = new ClientLogger(CustomAssessmentAutomationsImpl.class); - - private final CustomAssessmentAutomationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public CustomAssessmentAutomationsImpl( - CustomAssessmentAutomationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String customAssessmentAutomationName, Context context) { - Response inner = - this - .serviceClient() - .getByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CustomAssessmentAutomationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public CustomAssessmentAutomation getByResourceGroup( - String resourceGroupName, String customAssessmentAutomationName) { - CustomAssessmentAutomationInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, customAssessmentAutomationName); - if (inner != null) { - return new CustomAssessmentAutomationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String customAssessmentAutomationName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, customAssessmentAutomationName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String customAssessmentAutomationName) { - this.serviceClient().delete(resourceGroupName, customAssessmentAutomationName); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName); - return 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.deleteByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); - } - String customAssessmentAutomationName = Utils.getValueFromIdByName(id, "customAssessmentAutomations"); - if (customAssessmentAutomationName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'customAssessmentAutomations'.", - id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, customAssessmentAutomationName, context); - } - - private CustomAssessmentAutomationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public CustomAssessmentAutomationImpl define(String name) { - return new CustomAssessmentAutomationImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentImpl.java deleted file mode 100644 index fb658a418055..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentImpl.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignment; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentRequest; - -public final class CustomEntityStoreAssignmentImpl - implements CustomEntityStoreAssignment, CustomEntityStoreAssignment.Definition { - private CustomEntityStoreAssignmentInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - CustomEntityStoreAssignmentImpl( - CustomEntityStoreAssignmentInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String principal() { - return this.innerModel().principal(); - } - - public String entityStoreDatabaseLink() { - return this.innerModel().entityStoreDatabaseLink(); - } - - public CustomEntityStoreAssignmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String customEntityStoreAssignmentName; - - private CustomEntityStoreAssignmentRequest createCustomEntityStoreAssignmentRequestBody; - - public CustomEntityStoreAssignmentImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public CustomEntityStoreAssignment create() { - this.innerObject = - serviceManager - .serviceClient() - .getCustomEntityStoreAssignments() - .createWithResponse( - resourceGroupName, - customEntityStoreAssignmentName, - createCustomEntityStoreAssignmentRequestBody, - Context.NONE) - .getValue(); - return this; - } - - public CustomEntityStoreAssignment create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCustomEntityStoreAssignments() - .createWithResponse( - resourceGroupName, - customEntityStoreAssignmentName, - createCustomEntityStoreAssignmentRequestBody, - context) - .getValue(); - return this; - } - - CustomEntityStoreAssignmentImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new CustomEntityStoreAssignmentInner(); - this.serviceManager = serviceManager; - this.customEntityStoreAssignmentName = name; - this.createCustomEntityStoreAssignmentRequestBody = new CustomEntityStoreAssignmentRequest(); - } - - public CustomEntityStoreAssignment refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getCustomEntityStoreAssignments() - .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE) - .getValue(); - return this; - } - - public CustomEntityStoreAssignment refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getCustomEntityStoreAssignments() - .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, context) - .getValue(); - return this; - } - - public CustomEntityStoreAssignmentImpl withPrincipal(String principal) { - this.createCustomEntityStoreAssignmentRequestBody.withPrincipal(principal); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsClientImpl.java deleted file mode 100644 index 338a98a95a37..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsClientImpl.java +++ /dev/null @@ -1,1189 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.CustomEntityStoreAssignmentsClient; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentRequest; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentsListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in CustomEntityStoreAssignmentsClient. */ -public final class CustomEntityStoreAssignmentsClientImpl implements CustomEntityStoreAssignmentsClient { - /** The proxy service used to perform REST calls. */ - private final CustomEntityStoreAssignmentsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of CustomEntityStoreAssignmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CustomEntityStoreAssignmentsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - CustomEntityStoreAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterCustomEntityStoreAssignments to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterCustom") - public interface CustomEntityStoreAssignmentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("customEntityStoreAssignmentName") String customEntityStoreAssignmentName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("customEntityStoreAssignmentName") String customEntityStoreAssignmentName, - @BodyParam("application/json") CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("customEntityStoreAssignmentName") String customEntityStoreAssignmentName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/customEntityStoreAssignments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom entity store assignment by name for the provided subscription and resource group along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String customEntityStoreAssignmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (customEntityStoreAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customEntityStoreAssignmentName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom entity store assignment by name for the provided subscription and resource group along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String customEntityStoreAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (customEntityStoreAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customEntityStoreAssignmentName, - accept, - context); - } - - /** - * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom entity store assignment by name for the provided subscription and resource group on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String customEntityStoreAssignmentName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom entity store assignment by name for the provided subscription and resource group along - * with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName, context).block(); - } - - /** - * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom entity store assignment by name for the provided subscription and resource group. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CustomEntityStoreAssignmentInner getByResourceGroup( - String resourceGroupName, String customEntityStoreAssignmentName) { - return getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE) - .getValue(); - } - - /** - * Creates a custom entity store assignment - * - *

Creates a custom entity store assignment for the provided subscription, if not already exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom entity store assignment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String customEntityStoreAssignmentName, - CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (customEntityStoreAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentName is required and cannot be null.")); - } - if (customEntityStoreAssignmentRequestBody == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentRequestBody is required and cannot be null.")); - } else { - customEntityStoreAssignmentRequestBody.validate(); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customEntityStoreAssignmentName, - customEntityStoreAssignmentRequestBody, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a custom entity store assignment - * - *

Creates a custom entity store assignment for the provided subscription, if not already exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom entity store assignment along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String resourceGroupName, - String customEntityStoreAssignmentName, - CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (customEntityStoreAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentName is required and cannot be null.")); - } - if (customEntityStoreAssignmentRequestBody == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentRequestBody is required and cannot be null.")); - } else { - customEntityStoreAssignmentRequestBody.validate(); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customEntityStoreAssignmentName, - customEntityStoreAssignmentRequestBody, - accept, - context); - } - - /** - * Creates a custom entity store assignment - * - *

Creates a custom entity store assignment for the provided subscription, if not already exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom entity store assignment on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String resourceGroupName, - String customEntityStoreAssignmentName, - CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody) { - return createWithResponseAsync( - resourceGroupName, customEntityStoreAssignmentName, customEntityStoreAssignmentRequestBody) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates a custom entity store assignment - * - *

Creates a custom entity store assignment for the provided subscription, if not already exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom entity store assignment along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String resourceGroupName, - String customEntityStoreAssignmentName, - CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody, - Context context) { - return createWithResponseAsync( - resourceGroupName, customEntityStoreAssignmentName, customEntityStoreAssignmentRequestBody, context) - .block(); - } - - /** - * Creates a custom entity store assignment - * - *

Creates a custom entity store assignment for the provided subscription, if not already exists. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param customEntityStoreAssignmentRequestBody Custom entity store assignment body. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return custom entity store assignment. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CustomEntityStoreAssignmentInner create( - String resourceGroupName, - String customEntityStoreAssignmentName, - CustomEntityStoreAssignmentRequest customEntityStoreAssignmentRequestBody) { - return createWithResponse( - resourceGroupName, - customEntityStoreAssignmentName, - customEntityStoreAssignmentRequestBody, - Context.NONE) - .getValue(); - } - - /** - * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String customEntityStoreAssignmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (customEntityStoreAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customEntityStoreAssignmentName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String customEntityStoreAssignmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (customEntityStoreAssignmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter customEntityStoreAssignmentName is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - customEntityStoreAssignmentName, - accept, - context); - } - - /** - * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String customEntityStoreAssignmentName) { - return deleteWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context) { - return deleteWithResponseAsync(resourceGroupName, customEntityStoreAssignmentName, context).block(); - } - - /** - * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String customEntityStoreAssignmentName) { - deleteWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE); - } - - /** - * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsImpl.java deleted file mode 100644 index 2b1bdc19cc0e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/CustomEntityStoreAssignmentsImpl.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.CustomEntityStoreAssignmentsClient; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignment; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignments; - -public final class CustomEntityStoreAssignmentsImpl implements CustomEntityStoreAssignments { - private static final ClientLogger LOGGER = new ClientLogger(CustomEntityStoreAssignmentsImpl.class); - - private final CustomEntityStoreAssignmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public CustomEntityStoreAssignmentsImpl( - CustomEntityStoreAssignmentsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context) { - Response inner = - this - .serviceClient() - .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CustomEntityStoreAssignmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public CustomEntityStoreAssignment getByResourceGroup( - String resourceGroupName, String customEntityStoreAssignmentName) { - CustomEntityStoreAssignmentInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, customEntityStoreAssignmentName); - if (inner != null) { - return new CustomEntityStoreAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, customEntityStoreAssignmentName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String customEntityStoreAssignmentName) { - this.serviceClient().delete(resourceGroupName, customEntityStoreAssignmentName); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new CustomEntityStoreAssignmentImpl(inner1, this.manager())); - } - - public CustomEntityStoreAssignment getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); - } - String customEntityStoreAssignmentName = Utils.getValueFromIdByName(id, "customEntityStoreAssignments"); - if (customEntityStoreAssignmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'customEntityStoreAssignments'.", - id))); - } - return this - .getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE) - .getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); - } - String customEntityStoreAssignmentName = Utils.getValueFromIdByName(id, "customEntityStoreAssignments"); - if (customEntityStoreAssignmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'customEntityStoreAssignments'.", - id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); - } - String customEntityStoreAssignmentName = Utils.getValueFromIdByName(id, "customEntityStoreAssignments"); - if (customEntityStoreAssignmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'customEntityStoreAssignments'.", - id))); - } - this.deleteByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourcegroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourcegroups'.", id))); - } - String customEntityStoreAssignmentName = Utils.getValueFromIdByName(id, "customEntityStoreAssignments"); - if (customEntityStoreAssignmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'customEntityStoreAssignments'.", - id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, customEntityStoreAssignmentName, context); - } - - private CustomEntityStoreAssignmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public CustomEntityStoreAssignmentImpl define(String name) { - return new CustomEntityStoreAssignmentImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupImpl.java deleted file mode 100644 index 6edb2fe0dd31..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupImpl.java +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) Microsoft Corporation. All 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.DeviceSecurityGroupInner; -import com.azure.resourcemanager.security.models.AllowlistCustomAlertRule; -import com.azure.resourcemanager.security.models.DenylistCustomAlertRule; -import com.azure.resourcemanager.security.models.DeviceSecurityGroup; -import com.azure.resourcemanager.security.models.ThresholdCustomAlertRule; -import com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule; -import java.util.Collections; -import java.util.List; - -public final class DeviceSecurityGroupImpl - implements DeviceSecurityGroup, DeviceSecurityGroup.Definition, DeviceSecurityGroup.Update { - private DeviceSecurityGroupInner 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 List thresholdRules() { - List inner = this.innerModel().thresholdRules(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List timeWindowRules() { - List inner = this.innerModel().timeWindowRules(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List allowlistRules() { - List inner = this.innerModel().allowlistRules(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List denylistRules() { - List inner = this.innerModel().denylistRules(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public DeviceSecurityGroupInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceId; - - private String deviceSecurityGroupName; - - public DeviceSecurityGroupImpl withExistingResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - public DeviceSecurityGroup create() { - this.innerObject = - serviceManager - .serviceClient() - .getDeviceSecurityGroups() - .createOrUpdateWithResponse(resourceId, deviceSecurityGroupName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public DeviceSecurityGroup create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDeviceSecurityGroups() - .createOrUpdateWithResponse(resourceId, deviceSecurityGroupName, this.innerModel(), context) - .getValue(); - return this; - } - - DeviceSecurityGroupImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new DeviceSecurityGroupInner(); - this.serviceManager = serviceManager; - this.deviceSecurityGroupName = name; - } - - public DeviceSecurityGroupImpl update() { - return this; - } - - public DeviceSecurityGroup apply() { - this.innerObject = - serviceManager - .serviceClient() - .getDeviceSecurityGroups() - .createOrUpdateWithResponse(resourceId, deviceSecurityGroupName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public DeviceSecurityGroup apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDeviceSecurityGroups() - .createOrUpdateWithResponse(resourceId, deviceSecurityGroupName, this.innerModel(), context) - .getValue(); - return this; - } - - DeviceSecurityGroupImpl( - DeviceSecurityGroupInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceId = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "resourceId"); - this.deviceSecurityGroupName = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); - } - - public DeviceSecurityGroup refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getDeviceSecurityGroups() - .getWithResponse(resourceId, deviceSecurityGroupName, Context.NONE) - .getValue(); - return this; - } - - public DeviceSecurityGroup refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getDeviceSecurityGroups() - .getWithResponse(resourceId, deviceSecurityGroupName, context) - .getValue(); - return this; - } - - public DeviceSecurityGroupImpl withThresholdRules(List thresholdRules) { - this.innerModel().withThresholdRules(thresholdRules); - return this; - } - - public DeviceSecurityGroupImpl withTimeWindowRules(List timeWindowRules) { - this.innerModel().withTimeWindowRules(timeWindowRules); - return this; - } - - public DeviceSecurityGroupImpl withAllowlistRules(List allowlistRules) { - this.innerModel().withAllowlistRules(allowlistRules); - return this; - } - - public DeviceSecurityGroupImpl withDenylistRules(List denylistRules) { - this.innerModel().withDenylistRules(denylistRules); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsClientImpl.java deleted file mode 100644 index 0d3f936ce062..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsClientImpl.java +++ /dev/null @@ -1,749 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.DeviceSecurityGroupsClient; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; -import com.azure.resourcemanager.security.models.DeviceSecurityGroupList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DeviceSecurityGroupsClient. */ -public final class DeviceSecurityGroupsClientImpl implements DeviceSecurityGroupsClient { - /** The proxy service used to perform REST calls. */ - private final DeviceSecurityGroupsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DeviceSecurityGroupsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DeviceSecurityGroupsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(DeviceSecurityGroupsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDeviceSecurityGroups to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterDevice") - public interface DeviceSecurityGroupsService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("deviceSecurityGroupName") String deviceSecurityGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("deviceSecurityGroupName") String deviceSecurityGroupName, - @BodyParam("application/json") DeviceSecurityGroupInner deviceSecurityGroup, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("deviceSecurityGroupName") String deviceSecurityGroupName, - @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); - } - - /** - * Use this method get the list of device security groups 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 device security groups along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceId) { - 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 = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, resourceId, 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())); - } - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of device security groups along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, resourceId, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Use this method get the list of device security groups 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 device security groups as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceId) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceId), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of device security groups as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceId, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceId, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Use this method get the list of device security groups 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 device security groups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceId) { - return new PagedIterable<>(listAsync(resourceId)); - } - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of device security groups as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceId, Context context) { - return new PagedIterable<>(listAsync(resourceId, context)); - } - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceId, String deviceSecurityGroupName) { - 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 (deviceSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - resourceId, - deviceSecurityGroupName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceId, String deviceSecurityGroupName, 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 (deviceSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, deviceSecurityGroupName, accept, context); - } - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String deviceSecurityGroupName) { - return getWithResponseAsync(resourceId, deviceSecurityGroupName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceId, String deviceSecurityGroupName, Context context) { - return getWithResponseAsync(resourceId, deviceSecurityGroupName, context).block(); - } - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceSecurityGroupInner get(String resourceId, String deviceSecurityGroupName) { - return getWithResponse(resourceId, deviceSecurityGroupName, Context.NONE).getValue(); - } - - /** - * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param deviceSecurityGroup Security group object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceId, String deviceSecurityGroupName, DeviceSecurityGroupInner deviceSecurityGroup) { - 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 (deviceSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); - } - if (deviceSecurityGroup == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceSecurityGroup is required and cannot be null.")); - } else { - deviceSecurityGroup.validate(); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - resourceId, - deviceSecurityGroupName, - deviceSecurityGroup, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param deviceSecurityGroup Security group object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceId, - String deviceSecurityGroupName, - DeviceSecurityGroupInner deviceSecurityGroup, - 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 (deviceSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); - } - if (deviceSecurityGroup == null) { - return Mono - .error(new IllegalArgumentException("Parameter deviceSecurityGroup is required and cannot be null.")); - } else { - deviceSecurityGroup.validate(); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - resourceId, - deviceSecurityGroupName, - deviceSecurityGroup, - accept, - context); - } - - /** - * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param deviceSecurityGroup Security group object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceId, String deviceSecurityGroupName, DeviceSecurityGroupInner deviceSecurityGroup) { - return createOrUpdateWithResponseAsync(resourceId, deviceSecurityGroupName, deviceSecurityGroup) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param deviceSecurityGroup Security group object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceId, - String deviceSecurityGroupName, - DeviceSecurityGroupInner deviceSecurityGroup, - Context context) { - return createOrUpdateWithResponseAsync(resourceId, deviceSecurityGroupName, deviceSecurityGroup, context) - .block(); - } - - /** - * Use this method to creates or updates the device security group on a specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param deviceSecurityGroup Security group object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DeviceSecurityGroupInner createOrUpdate( - String resourceId, String deviceSecurityGroupName, DeviceSecurityGroupInner deviceSecurityGroup) { - return createOrUpdateWithResponse(resourceId, deviceSecurityGroupName, deviceSecurityGroup, Context.NONE) - .getValue(); - } - - /** - * User this method to deletes the device security group. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceId, String deviceSecurityGroupName) { - 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 (deviceSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - resourceId, - deviceSecurityGroupName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * User this method to deletes the device security group. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceId, String deviceSecurityGroupName, 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 (deviceSecurityGroupName == null) { - return Mono - .error( - new IllegalArgumentException("Parameter deviceSecurityGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete(this.client.getEndpoint(), apiVersion, resourceId, deviceSecurityGroupName, accept, context); - } - - /** - * User this method to deletes the device security group. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceId, String deviceSecurityGroupName) { - return deleteWithResponseAsync(resourceId, deviceSecurityGroupName).flatMap(ignored -> Mono.empty()); - } - - /** - * User this method to deletes the device security group. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceId, String deviceSecurityGroupName, Context context) { - return deleteWithResponseAsync(resourceId, deviceSecurityGroupName, context).block(); - } - - /** - * User this method to deletes the device security group. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceId, String deviceSecurityGroupName) { - deleteWithResponse(resourceId, deviceSecurityGroupName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of device security groups along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsImpl.java deleted file mode 100644 index 84a677f1ee3e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DeviceSecurityGroupsImpl.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.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.DeviceSecurityGroupsClient; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; -import com.azure.resourcemanager.security.models.DeviceSecurityGroup; -import com.azure.resourcemanager.security.models.DeviceSecurityGroups; - -public final class DeviceSecurityGroupsImpl implements DeviceSecurityGroups { - private static final ClientLogger LOGGER = new ClientLogger(DeviceSecurityGroupsImpl.class); - - private final DeviceSecurityGroupsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DeviceSecurityGroupsImpl( - DeviceSecurityGroupsClient 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 DeviceSecurityGroupImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceId, Context context) { - PagedIterable inner = this.serviceClient().list(resourceId, context); - return Utils.mapPage(inner, inner1 -> new DeviceSecurityGroupImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String resourceId, String deviceSecurityGroupName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceId, deviceSecurityGroupName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new DeviceSecurityGroupImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public DeviceSecurityGroup get(String resourceId, String deviceSecurityGroupName) { - DeviceSecurityGroupInner inner = this.serviceClient().get(resourceId, deviceSecurityGroupName); - if (inner != null) { - return new DeviceSecurityGroupImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse( - String resourceId, String deviceSecurityGroupName, Context context) { - return this.serviceClient().deleteWithResponse(resourceId, deviceSecurityGroupName, context); - } - - public void deleteByResourceGroup(String resourceId, String deviceSecurityGroupName) { - this.serviceClient().delete(resourceId, deviceSecurityGroupName); - } - - public DeviceSecurityGroup getById(String id) { - String resourceId = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "resourceId"); - if (resourceId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String deviceSecurityGroupName = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); - if (deviceSecurityGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'deviceSecurityGroups'.", - id))); - } - return this.getWithResponse(resourceId, deviceSecurityGroupName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceId = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "resourceId"); - if (resourceId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String deviceSecurityGroupName = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); - if (deviceSecurityGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'deviceSecurityGroups'.", - id))); - } - return this.getWithResponse(resourceId, deviceSecurityGroupName, context); - } - - public void deleteById(String id) { - String resourceId = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "resourceId"); - if (resourceId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String deviceSecurityGroupName = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); - if (deviceSecurityGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'deviceSecurityGroups'.", - id))); - } - this.deleteByResourceGroupWithResponse(resourceId, deviceSecurityGroupName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceId = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "resourceId"); - if (resourceId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'resourceId'.", id))); - } - String deviceSecurityGroupName = - Utils - .getValueFromIdByParameterName( - id, - "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}", - "deviceSecurityGroupName"); - if (deviceSecurityGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'deviceSecurityGroups'.", - id))); - } - return this.deleteByResourceGroupWithResponse(resourceId, deviceSecurityGroupName, context); - } - - private DeviceSecurityGroupsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public DeviceSecurityGroupImpl define(String name) { - return new DeviceSecurityGroupImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionImpl.java deleted file mode 100644 index 65e6eb8b1f5b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolution; -import com.azure.resourcemanager.security.models.SecurityFamily; - -public final class DiscoveredSecuritySolutionImpl implements DiscoveredSecuritySolution { - private DiscoveredSecuritySolutionInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - DiscoveredSecuritySolutionImpl( - DiscoveredSecuritySolutionInner 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 location() { - return this.innerModel().location(); - } - - public SecurityFamily securityFamily() { - return this.innerModel().securityFamily(); - } - - public String offer() { - return this.innerModel().offer(); - } - - public String publisher() { - return this.innerModel().publisher(); - } - - public String sku() { - return this.innerModel().sku(); - } - - public DiscoveredSecuritySolutionInner 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/DiscoveredSecuritySolutionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsClientImpl.java deleted file mode 100644 index ed28a5ae9ae9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsClientImpl.java +++ /dev/null @@ -1,753 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.DiscoveredSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolutionList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in DiscoveredSecuritySolutionsClient. */ -public final class DiscoveredSecuritySolutionsClientImpl implements DiscoveredSecuritySolutionsClient { - /** The proxy service used to perform REST calls. */ - private final DiscoveredSecuritySolutionsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of DiscoveredSecuritySolutionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - DiscoveredSecuritySolutionsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - DiscoveredSecuritySolutionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterDiscoveredSecuritySolutions to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterDiscov") - public interface DiscoveredSecuritySolutionsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("discoveredSecuritySolutionName") String discoveredSecuritySolutionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByHomeRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync( - String ascLocation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegion( - this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation, context), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation)); - } - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, context)); - } - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific discovered Security Solution along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (discoveredSecuritySolutionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter discoveredSecuritySolutionName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - discoveredSecuritySolutionName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific discovered Security Solution along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (discoveredSecuritySolutionName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter discoveredSecuritySolutionName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - discoveredSecuritySolutionName, - apiVersion, - accept, - context); - } - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific discovered Security Solution on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName) { - return getWithResponseAsync(resourceGroupName, ascLocation, discoveredSecuritySolutionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific discovered Security Solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName, Context context) { - return getWithResponseAsync(resourceGroupName, ascLocation, discoveredSecuritySolutionName, context).block(); - } - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific discovered Security Solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public DiscoveredSecuritySolutionInner get( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName) { - return getWithResponse(resourceGroupName, ascLocation, discoveredSecuritySolutionName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsImpl.java deleted file mode 100644 index 3fc2fb690fe9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/DiscoveredSecuritySolutionsImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.DiscoveredSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolution; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolutions; - -public final class DiscoveredSecuritySolutionsImpl implements DiscoveredSecuritySolutions { - private static final ClientLogger LOGGER = new ClientLogger(DiscoveredSecuritySolutionsImpl.class); - - private final DiscoveredSecuritySolutionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public DiscoveredSecuritySolutionsImpl( - DiscoveredSecuritySolutionsClient 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 DiscoveredSecuritySolutionImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new DiscoveredSecuritySolutionImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return Utils.mapPage(inner, inner1 -> new DiscoveredSecuritySolutionImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - PagedIterable inner = - this.serviceClient().listByHomeRegion(ascLocation, context); - return Utils.mapPage(inner, inner1 -> new DiscoveredSecuritySolutionImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, ascLocation, discoveredSecuritySolutionName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new DiscoveredSecuritySolutionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public DiscoveredSecuritySolution get( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName) { - DiscoveredSecuritySolutionInner inner = - this.serviceClient().get(resourceGroupName, ascLocation, discoveredSecuritySolutionName); - if (inner != null) { - return new DiscoveredSecuritySolutionImpl(inner, this.manager()); - } else { - return null; - } - } - - private DiscoveredSecuritySolutionsClient 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/ExternalSecuritySolutionImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionImpl.java deleted file mode 100644 index aca3c0f73e30..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionImpl.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.ExternalSecuritySolutionInner; -import com.azure.resourcemanager.security.models.ExternalSecuritySolution; - -public final class ExternalSecuritySolutionImpl implements ExternalSecuritySolution { - private ExternalSecuritySolutionInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ExternalSecuritySolutionImpl( - ExternalSecuritySolutionInner 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 location() { - return this.innerModel().location(); - } - - public ExternalSecuritySolutionInner 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/ExternalSecuritySolutionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsClientImpl.java deleted file mode 100644 index db970ccd5c33..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsClientImpl.java +++ /dev/null @@ -1,751 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.ExternalSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import com.azure.resourcemanager.security.models.ExternalSecuritySolutionList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExternalSecuritySolutionsClient. */ -public final class ExternalSecuritySolutionsClientImpl implements ExternalSecuritySolutionsClient { - /** The proxy service used to perform REST calls. */ - private final ExternalSecuritySolutionsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ExternalSecuritySolutionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExternalSecuritySolutionsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - ExternalSecuritySolutionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterExternalSecuritySolutions to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterExtern") - public interface ExternalSecuritySolutionsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("externalSecuritySolutionsName") String externalSecuritySolutionsName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of external security solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - 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())); - } - - /** - * Gets a list of external security solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - 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)); - } - - /** - * Gets a list of external security solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of external security solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of external security solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of external security solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByHomeRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync( - String ascLocation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegion( - this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation, context), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation)); - } - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, context)); - } - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific external Security Solution along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (externalSecuritySolutionsName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter externalSecuritySolutionsName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - externalSecuritySolutionsName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific external Security Solution along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (externalSecuritySolutionsName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter externalSecuritySolutionsName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - externalSecuritySolutionsName, - apiVersion, - accept, - context); - } - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific external Security Solution on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName) { - return getWithResponseAsync(resourceGroupName, ascLocation, externalSecuritySolutionsName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific external Security Solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName, Context context) { - return getWithResponseAsync(resourceGroupName, ascLocation, externalSecuritySolutionsName, context).block(); - } - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific external Security Solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExternalSecuritySolutionInner get( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName) { - return getWithResponse(resourceGroupName, ascLocation, externalSecuritySolutionsName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsImpl.java deleted file mode 100644 index 27d2cba5cf91..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ExternalSecuritySolutionsImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.ExternalSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import com.azure.resourcemanager.security.models.ExternalSecuritySolution; -import com.azure.resourcemanager.security.models.ExternalSecuritySolutions; - -public final class ExternalSecuritySolutionsImpl implements ExternalSecuritySolutions { - private static final ClientLogger LOGGER = new ClientLogger(ExternalSecuritySolutionsImpl.class); - - private final ExternalSecuritySolutionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ExternalSecuritySolutionsImpl( - ExternalSecuritySolutionsClient 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 ExternalSecuritySolutionImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new ExternalSecuritySolutionImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return Utils.mapPage(inner, inner1 -> new ExternalSecuritySolutionImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - PagedIterable inner = - this.serviceClient().listByHomeRegion(ascLocation, context); - return Utils.mapPage(inner, inner1 -> new ExternalSecuritySolutionImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, ascLocation, externalSecuritySolutionsName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ExternalSecuritySolutionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ExternalSecuritySolution get( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName) { - ExternalSecuritySolutionInner inner = - this.serviceClient().get(resourceGroupName, ascLocation, externalSecuritySolutionsName); - if (inner != null) { - return new ExternalSecuritySolutionImpl(inner, this.manager()); - } else { - return null; - } - } - - private ExternalSecuritySolutionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentImpl.java deleted file mode 100644 index ec7625401677..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentImpl.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; -import com.azure.resourcemanager.security.models.GovernanceAssignment; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.time.OffsetDateTime; - -public final class GovernanceAssignmentImpl - implements GovernanceAssignment, GovernanceAssignment.Definition, GovernanceAssignment.Update { - private GovernanceAssignmentInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String owner() { - return this.innerModel().owner(); - } - - public OffsetDateTime remediationDueDate() { - return this.innerModel().remediationDueDate(); - } - - public RemediationEta remediationEta() { - return this.innerModel().remediationEta(); - } - - public Boolean isGracePeriod() { - return this.innerModel().isGracePeriod(); - } - - public GovernanceEmailNotification governanceEmailNotification() { - return this.innerModel().governanceEmailNotification(); - } - - public GovernanceAssignmentAdditionalData additionalData() { - return this.innerModel().additionalData(); - } - - public GovernanceAssignmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String scope; - - private String assessmentName; - - private String assignmentKey; - - public GovernanceAssignmentImpl withExistingAssessment(String scope, String assessmentName) { - this.scope = scope; - this.assessmentName = assessmentName; - return this; - } - - public GovernanceAssignment create() { - this.innerObject = - serviceManager - .serviceClient() - .getGovernanceAssignments() - .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public GovernanceAssignment create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getGovernanceAssignments() - .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), context) - .getValue(); - return this; - } - - GovernanceAssignmentImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new GovernanceAssignmentInner(); - this.serviceManager = serviceManager; - this.assignmentKey = name; - } - - public GovernanceAssignmentImpl update() { - return this; - } - - public GovernanceAssignment apply() { - this.innerObject = - serviceManager - .serviceClient() - .getGovernanceAssignments() - .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public GovernanceAssignment apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getGovernanceAssignments() - .createOrUpdateWithResponse(scope, assessmentName, assignmentKey, this.innerModel(), context) - .getValue(); - return this; - } - - GovernanceAssignmentImpl( - GovernanceAssignmentInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.scope = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - this.assessmentName = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - this.assignmentKey = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - } - - public GovernanceAssignment refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getGovernanceAssignments() - .getWithResponse(scope, assessmentName, assignmentKey, Context.NONE) - .getValue(); - return this; - } - - public GovernanceAssignment refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getGovernanceAssignments() - .getWithResponse(scope, assessmentName, assignmentKey, context) - .getValue(); - return this; - } - - public GovernanceAssignmentImpl withOwner(String owner) { - this.innerModel().withOwner(owner); - return this; - } - - public GovernanceAssignmentImpl withRemediationDueDate(OffsetDateTime remediationDueDate) { - this.innerModel().withRemediationDueDate(remediationDueDate); - return this; - } - - public GovernanceAssignmentImpl withRemediationEta(RemediationEta remediationEta) { - this.innerModel().withRemediationEta(remediationEta); - return this; - } - - public GovernanceAssignmentImpl withIsGracePeriod(Boolean isGracePeriod) { - this.innerModel().withIsGracePeriod(isGracePeriod); - return this; - } - - public GovernanceAssignmentImpl withGovernanceEmailNotification( - GovernanceEmailNotification governanceEmailNotification) { - this.innerModel().withGovernanceEmailNotification(governanceEmailNotification); - return this; - } - - public GovernanceAssignmentImpl withAdditionalData(GovernanceAssignmentAdditionalData additionalData) { - this.innerModel().withAdditionalData(additionalData); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsClientImpl.java deleted file mode 100644 index 2f964e6ef3ee..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsClientImpl.java +++ /dev/null @@ -1,828 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.GovernanceAssignmentsClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; -import com.azure.resourcemanager.security.models.GovernanceAssignmentsList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GovernanceAssignmentsClient. */ -public final class GovernanceAssignmentsClientImpl implements GovernanceAssignmentsClient { - /** The proxy service used to perform REST calls. */ - private final GovernanceAssignmentsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GovernanceAssignmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GovernanceAssignmentsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(GovernanceAssignmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGovernanceAssignments to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterGovern") - public interface GovernanceAssignmentsService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("assessmentName") String assessmentName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("assessmentName") String assessmentName, - @PathParam("assignmentKey") String assignmentKey, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("assessmentName") String assessmentName, - @PathParam("assignmentKey") String assignmentKey, - @BodyParam("application/json") GovernanceAssignmentInner governanceAssignment, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("assessmentName") String assessmentName, - @PathParam("assignmentKey") String assignmentKey, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String assessmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), apiVersion, scope, assessmentName, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String scope, String assessmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, scope, assessmentName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String assessmentName) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, assessmentName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String assessmentName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, assessmentName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String assessmentName) { - return new PagedIterable<>(listAsync(scope, assessmentName)); - } - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String assessmentName, Context context) { - return new PagedIterable<>(listAsync(scope, assessmentName, context)); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String assessmentName, String assignmentKey) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - scope, - assessmentName, - assignmentKey, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String assessmentName, String assignmentKey, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), apiVersion, scope, assessmentName, assignmentKey, accept, context); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String assessmentName, String assignmentKey) { - return getWithResponseAsync(scope, assessmentName, assignmentKey) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String scope, String assessmentName, String assignmentKey, Context context) { - return getWithResponseAsync(scope, assessmentName, assignmentKey, context).block(); - } - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceAssignmentInner get(String scope, String assessmentName, String assignmentKey) { - return getWithResponse(scope, assessmentName, assignmentKey, Context.NONE).getValue(); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param governanceAssignment Governance assignment over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, String assessmentName, String assignmentKey, GovernanceAssignmentInner governanceAssignment) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - if (governanceAssignment == null) { - return Mono - .error(new IllegalArgumentException("Parameter governanceAssignment is required and cannot be null.")); - } else { - governanceAssignment.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - scope, - assessmentName, - assignmentKey, - governanceAssignment, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param governanceAssignment Governance assignment over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, - String assessmentName, - String assignmentKey, - GovernanceAssignmentInner governanceAssignment, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - if (governanceAssignment == null) { - return Mono - .error(new IllegalArgumentException("Parameter governanceAssignment is required and cannot be null.")); - } else { - governanceAssignment.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - scope, - assessmentName, - assignmentKey, - governanceAssignment, - accept, - context); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param governanceAssignment Governance assignment over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String scope, String assessmentName, String assignmentKey, GovernanceAssignmentInner governanceAssignment) { - return createOrUpdateWithResponseAsync(scope, assessmentName, assignmentKey, governanceAssignment) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param governanceAssignment Governance assignment over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String scope, - String assessmentName, - String assignmentKey, - GovernanceAssignmentInner governanceAssignment, - Context context) { - return createOrUpdateWithResponseAsync(scope, assessmentName, assignmentKey, governanceAssignment, context) - .block(); - } - - /** - * Creates or updates a governance assignment on the given subscription. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param governanceAssignment Governance assignment over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignment over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceAssignmentInner createOrUpdate( - String scope, String assessmentName, String assignmentKey, GovernanceAssignmentInner governanceAssignment) { - return createOrUpdateWithResponse(scope, assessmentName, assignmentKey, governanceAssignment, Context.NONE) - .getValue(); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String scope, String assessmentName, String assignmentKey) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - return FluxUtil - .withContext( - context -> - service - .delete(this.client.getEndpoint(), apiVersion, scope, assessmentName, assignmentKey, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String scope, String assessmentName, String assignmentKey, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (assignmentKey == null) { - return Mono.error(new IllegalArgumentException("Parameter assignmentKey is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, scope, assessmentName, assignmentKey, context); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String scope, String assessmentName, String assignmentKey) { - return deleteWithResponseAsync(scope, assessmentName, assignmentKey).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String scope, String assessmentName, String assignmentKey, Context context) { - return deleteWithResponseAsync(scope, assessmentName, assignmentKey, context).block(); - } - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String scope, String assessmentName, String assignmentKey) { - deleteWithResponse(scope, assessmentName, assignmentKey, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a governance assignments list along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsImpl.java deleted file mode 100644 index d02b5180c6c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceAssignmentsImpl.java +++ /dev/null @@ -1,256 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.GovernanceAssignmentsClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; -import com.azure.resourcemanager.security.models.GovernanceAssignment; -import com.azure.resourcemanager.security.models.GovernanceAssignments; - -public final class GovernanceAssignmentsImpl implements GovernanceAssignments { - private static final ClientLogger LOGGER = new ClientLogger(GovernanceAssignmentsImpl.class); - - private final GovernanceAssignmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GovernanceAssignmentsImpl( - GovernanceAssignmentsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String scope, String assessmentName) { - PagedIterable inner = this.serviceClient().list(scope, assessmentName); - return Utils.mapPage(inner, inner1 -> new GovernanceAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, String assessmentName, Context context) { - PagedIterable inner = this.serviceClient().list(scope, assessmentName, context); - return Utils.mapPage(inner, inner1 -> new GovernanceAssignmentImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String scope, String assessmentName, String assignmentKey, Context context) { - Response inner = - this.serviceClient().getWithResponse(scope, assessmentName, assignmentKey, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new GovernanceAssignmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GovernanceAssignment get(String scope, String assessmentName, String assignmentKey) { - GovernanceAssignmentInner inner = this.serviceClient().get(scope, assessmentName, assignmentKey); - if (inner != null) { - return new GovernanceAssignmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse( - String scope, String assessmentName, String assignmentKey, Context context) { - return this.serviceClient().deleteWithResponse(scope, assessmentName, assignmentKey, context); - } - - public void delete(String scope, String assessmentName, String assignmentKey) { - this.serviceClient().delete(scope, assessmentName, assignmentKey); - } - - public GovernanceAssignment getById(String id) { - String scope = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - if (scope == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - if (assessmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - String assignmentKey = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - if (assignmentKey == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'governanceAssignments'.", - id))); - } - return this.getWithResponse(scope, assessmentName, assignmentKey, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String scope = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - if (scope == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - if (assessmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - String assignmentKey = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - if (assignmentKey == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'governanceAssignments'.", - id))); - } - return this.getWithResponse(scope, assessmentName, assignmentKey, context); - } - - public void deleteById(String id) { - String scope = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - if (scope == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - if (assessmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - String assignmentKey = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - if (assignmentKey == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'governanceAssignments'.", - id))); - } - this.deleteWithResponse(scope, assessmentName, assignmentKey, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String scope = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "scope"); - if (scope == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String assessmentName = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assessmentName"); - if (assessmentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'assessments'.", id))); - } - String assignmentKey = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}", - "assignmentKey"); - if (assignmentKey == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'governanceAssignments'.", - id))); - } - return this.deleteWithResponse(scope, assessmentName, assignmentKey, context); - } - - private GovernanceAssignmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public GovernanceAssignmentImpl define(String name) { - return new GovernanceAssignmentImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRuleImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRuleImpl.java deleted file mode 100644 index da9ab6f2522b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRuleImpl.java +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.util.Collections; -import java.util.List; - -public final class GovernanceRuleImpl implements GovernanceRule, GovernanceRule.Definition, GovernanceRule.Update { - private GovernanceRuleInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String tenantId() { - return this.innerModel().tenantId(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public String remediationTimeframe() { - return this.innerModel().remediationTimeframe(); - } - - public Boolean isGracePeriod() { - return this.innerModel().isGracePeriod(); - } - - public int rulePriority() { - return this.innerModel().rulePriority(); - } - - public Boolean isDisabled() { - return this.innerModel().isDisabled(); - } - - public GovernanceRuleType ruleType() { - return this.innerModel().ruleType(); - } - - public GovernanceRuleSourceResourceType sourceResourceType() { - return this.innerModel().sourceResourceType(); - } - - public List excludedScopes() { - List inner = this.innerModel().excludedScopes(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List conditionSets() { - List inner = this.innerModel().conditionSets(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Boolean includeMemberScopes() { - return this.innerModel().includeMemberScopes(); - } - - public GovernanceRuleOwnerSource ownerSource() { - return this.innerModel().ownerSource(); - } - - public GovernanceRuleEmailNotification governanceEmailNotification() { - return this.innerModel().governanceEmailNotification(); - } - - public GovernanceRuleMetadata metadata() { - return this.innerModel().metadata(); - } - - public GovernanceRuleInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String scope; - - private String ruleId; - - public GovernanceRuleImpl withExistingScope(String scope) { - this.scope = scope; - return this; - } - - public GovernanceRule create() { - this.innerObject = - serviceManager - .serviceClient() - .getGovernanceRules() - .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public GovernanceRule create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getGovernanceRules() - .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), context) - .getValue(); - return this; - } - - GovernanceRuleImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new GovernanceRuleInner(); - this.serviceManager = serviceManager; - this.ruleId = name; - } - - public GovernanceRuleImpl update() { - return this; - } - - public GovernanceRule apply() { - this.innerObject = - serviceManager - .serviceClient() - .getGovernanceRules() - .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public GovernanceRule apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getGovernanceRules() - .createOrUpdateWithResponse(scope, ruleId, this.innerModel(), context) - .getValue(); - return this; - } - - GovernanceRuleImpl( - GovernanceRuleInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.scope = - Utils - .getValueFromIdByParameterName( - innerObject.id(), "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - this.ruleId = - Utils - .getValueFromIdByParameterName( - innerObject.id(), "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - } - - public GovernanceRule refresh() { - this.innerObject = - serviceManager.serviceClient().getGovernanceRules().getWithResponse(scope, ruleId, Context.NONE).getValue(); - return this; - } - - public GovernanceRule refresh(Context context) { - this.innerObject = - serviceManager.serviceClient().getGovernanceRules().getWithResponse(scope, ruleId, context).getValue(); - return this; - } - - public void execute() { - serviceManager.governanceRules().execute(scope, ruleId); - } - - public void execute(ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - serviceManager.governanceRules().execute(scope, ruleId, executeGovernanceRuleParams, context); - } - - public GovernanceRuleImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public GovernanceRuleImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - public GovernanceRuleImpl withRemediationTimeframe(String remediationTimeframe) { - this.innerModel().withRemediationTimeframe(remediationTimeframe); - return this; - } - - public GovernanceRuleImpl withIsGracePeriod(Boolean isGracePeriod) { - this.innerModel().withIsGracePeriod(isGracePeriod); - return this; - } - - public GovernanceRuleImpl withRulePriority(int rulePriority) { - this.innerModel().withRulePriority(rulePriority); - return this; - } - - public GovernanceRuleImpl withIsDisabled(Boolean isDisabled) { - this.innerModel().withIsDisabled(isDisabled); - return this; - } - - public GovernanceRuleImpl withRuleType(GovernanceRuleType ruleType) { - this.innerModel().withRuleType(ruleType); - return this; - } - - public GovernanceRuleImpl withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType) { - this.innerModel().withSourceResourceType(sourceResourceType); - return this; - } - - public GovernanceRuleImpl withExcludedScopes(List excludedScopes) { - this.innerModel().withExcludedScopes(excludedScopes); - return this; - } - - public GovernanceRuleImpl withConditionSets(List conditionSets) { - this.innerModel().withConditionSets(conditionSets); - return this; - } - - public GovernanceRuleImpl withIncludeMemberScopes(Boolean includeMemberScopes) { - this.innerModel().withIncludeMemberScopes(includeMemberScopes); - return this; - } - - public GovernanceRuleImpl withOwnerSource(GovernanceRuleOwnerSource ownerSource) { - this.innerModel().withOwnerSource(ownerSource); - return this; - } - - public GovernanceRuleImpl withGovernanceEmailNotification( - GovernanceRuleEmailNotification governanceEmailNotification) { - this.innerModel().withGovernanceEmailNotification(governanceEmailNotification); - return this; - } - - public GovernanceRuleImpl withMetadata(GovernanceRuleMetadata metadata) { - this.innerModel().withMetadata(metadata); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesClientImpl.java deleted file mode 100644 index 011360e5c693..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesClientImpl.java +++ /dev/null @@ -1,1328 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.GovernanceRulesClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import com.azure.resourcemanager.security.models.GovernanceRuleList; -import com.azure.resourcemanager.security.models.GovernanceRulesOperationResultsResponse; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in GovernanceRulesClient. */ -public final class GovernanceRulesClientImpl implements GovernanceRulesClient { - /** The proxy service used to perform REST calls. */ - private final GovernanceRulesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of GovernanceRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - GovernanceRulesClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(GovernanceRulesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterGovernanceRules to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterGovern") - public interface GovernanceRulesService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/governanceRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("ruleId") String ruleId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("ruleId") String ruleId, - @BodyParam("application/json") GovernanceRuleInner governanceRule, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("ruleId") String ruleId, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/execute") - @ExpectedResponses({202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> execute( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("ruleId") String ruleId, - @BodyParam("application/json") ExecuteGovernanceRuleParams executeGovernanceRuleParams, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}") - @ExpectedResponses({200, 202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono operationResults( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("scope") String scope, - @PathParam("ruleId") String ruleId, - @PathParam("operationId") String operationId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governance rule for the requested scope by ruleId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String ruleId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, scope, ruleId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governance rule for the requested scope by ruleId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, String ruleId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, scope, ruleId, accept, context); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governance rule for the requested scope by ruleId on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String ruleId) { - return getWithResponseAsync(scope, ruleId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String ruleId, Context context) { - return getWithResponseAsync(scope, ruleId, context).block(); - } - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governance rule for the requested scope by ruleId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceRuleInner get(String scope, String ruleId) { - return getWithResponse(scope, ruleId, Context.NONE).getValue(); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, String ruleId, GovernanceRuleInner governanceRule) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (governanceRule == null) { - return Mono.error(new IllegalArgumentException("Parameter governanceRule is required and cannot be null.")); - } else { - governanceRule.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), apiVersion, scope, ruleId, governanceRule, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, String ruleId, GovernanceRuleInner governanceRule, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (governanceRule == null) { - return Mono.error(new IllegalArgumentException("Parameter governanceRule is required and cannot be null.")); - } else { - governanceRule.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate(this.client.getEndpoint(), apiVersion, scope, ruleId, governanceRule, accept, context); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String scope, String ruleId, GovernanceRuleInner governanceRule) { - return createOrUpdateWithResponseAsync(scope, ruleId, governanceRule) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String scope, String ruleId, GovernanceRuleInner governanceRule, Context context) { - return createOrUpdateWithResponseAsync(scope, ruleId, governanceRule, context).block(); - } - - /** - * Creates or updates a governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param governanceRule Governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rule over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceRuleInner createOrUpdate(String scope, String ruleId, GovernanceRuleInner governanceRule) { - return createOrUpdateWithResponse(scope, ruleId, governanceRule, Context.NONE).getValue(); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String scope, String ruleId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, scope, ruleId, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String scope, String ruleId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, scope, ruleId, context); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String scope, String ruleId) { - Mono>> mono = deleteWithResponseAsync(scope, ruleId); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String scope, String ruleId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(scope, ruleId, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String scope, String ruleId) { - return this.beginDeleteAsync(scope, ruleId).getSyncPoller(); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String scope, String ruleId, Context context) { - return this.beginDeleteAsync(scope, ruleId, context).getSyncPoller(); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String scope, String ruleId) { - return beginDeleteAsync(scope, ruleId).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String scope, String ruleId, Context context) { - return beginDeleteAsync(scope, ruleId, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String scope, String ruleId) { - deleteAsync(scope, ruleId).block(); - } - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String scope, String ruleId, Context context) { - deleteAsync(scope, ruleId, context).block(); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> executeWithResponseAsync( - String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (executeGovernanceRuleParams != null) { - executeGovernanceRuleParams.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .execute( - this.client.getEndpoint(), - apiVersion, - scope, - ruleId, - executeGovernanceRuleParams, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> executeWithResponseAsync( - String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (executeGovernanceRuleParams != null) { - executeGovernanceRuleParams.validate(); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .execute( - this.client.getEndpoint(), apiVersion, scope, ruleId, executeGovernanceRuleParams, accept, context); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginExecuteAsync( - String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - Mono>> mono = executeWithResponseAsync(scope, ruleId, executeGovernanceRuleParams); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginExecuteAsync(String scope, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - Mono>> mono = executeWithResponseAsync(scope, ruleId, executeGovernanceRuleParams); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginExecuteAsync( - String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - executeWithResponseAsync(scope, ruleId, executeGovernanceRuleParams, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginExecute(String scope, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - return this.beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams).getSyncPoller(); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginExecute( - String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - return this.beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams, context).getSyncPoller(); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono executeAsync( - String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams) { - return beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono executeAsync(String scope, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - return beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono executeAsync( - String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - return beginExecuteAsync(scope, ruleId, executeGovernanceRuleParams, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void execute(String scope, String ruleId) { - final ExecuteGovernanceRuleParams executeGovernanceRuleParams = null; - executeAsync(scope, ruleId, executeGovernanceRuleParams).block(); - } - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void execute( - String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - executeAsync(scope, ruleId, executeGovernanceRuleParams, context).block(); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono operationResultsWithResponseAsync( - String scope, String ruleId, String operationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .operationResults( - this.client.getEndpoint(), apiVersion, scope, ruleId, operationId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono operationResultsWithResponseAsync( - String scope, String ruleId, String operationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (operationId == null) { - return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); - } - final String apiVersion = "2022-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .operationResults(this.client.getEndpoint(), apiVersion, scope, ruleId, operationId, accept, context); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono operationResultsAsync( - String scope, String ruleId, String operationId) { - return operationResultsWithResponseAsync(scope, ruleId, operationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public GovernanceRulesOperationResultsResponse operationResultsWithResponse( - String scope, String ruleId, String operationId, Context context) { - return operationResultsWithResponseAsync(scope, ruleId, operationId, context).block(); - } - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationResultAutoGeneratedInner operationResults(String scope, String ruleId, String operationId) { - return operationResultsWithResponse(scope, ruleId, operationId, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a governance rules list along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesImpl.java deleted file mode 100644 index 30860d8f1e41..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GovernanceRulesImpl.java +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.GovernanceRulesClient; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.GovernanceRules; -import com.azure.resourcemanager.security.models.GovernanceRulesOperationResultsResponse; -import com.azure.resourcemanager.security.models.OperationResultAutoGenerated; - -public final class GovernanceRulesImpl implements GovernanceRules { - private static final ClientLogger LOGGER = new ClientLogger(GovernanceRulesImpl.class); - - private final GovernanceRulesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public GovernanceRulesImpl( - GovernanceRulesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return Utils.mapPage(inner, inner1 -> new GovernanceRuleImpl(inner1, this.manager())); - } - - public Response getWithResponse(String scope, String ruleId, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, ruleId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new GovernanceRuleImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public GovernanceRule get(String scope, String ruleId) { - GovernanceRuleInner inner = this.serviceClient().get(scope, ruleId); - if (inner != null) { - return new GovernanceRuleImpl(inner, this.manager()); - } else { - return null; - } - } - - public void deleteByResourceGroup(String scope, String ruleId) { - this.serviceClient().delete(scope, ruleId); - } - - public void delete(String scope, String ruleId, Context context) { - this.serviceClient().delete(scope, ruleId, context); - } - - public void execute(String scope, String ruleId) { - this.serviceClient().execute(scope, ruleId); - } - - public void execute( - String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context) { - this.serviceClient().execute(scope, ruleId, executeGovernanceRuleParams, context); - } - - public Response operationResultsWithResponse( - String scope, String ruleId, String operationId, Context context) { - GovernanceRulesOperationResultsResponse inner = - this.serviceClient().operationResultsWithResponse(scope, ruleId, operationId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new OperationResultAutoGeneratedImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public OperationResultAutoGenerated operationResults(String scope, String ruleId, String operationId) { - OperationResultAutoGeneratedInner inner = this.serviceClient().operationResults(scope, ruleId, operationId); - if (inner != null) { - return new OperationResultAutoGeneratedImpl(inner, this.manager()); - } else { - return null; - } - } - - public GovernanceRule getById(String id) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - if (scope == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String ruleId = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - if (ruleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - return this.getWithResponse(scope, ruleId, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - if (scope == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String ruleId = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - if (ruleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - return this.getWithResponse(scope, ruleId, context); - } - - public void deleteById(String id) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - if (scope == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String ruleId = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - if (ruleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - this.delete(scope, ruleId, Context.NONE); - } - - public void deleteByIdWithResponse(String id, Context context) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "scope"); - if (scope == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String ruleId = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}", "ruleId"); - if (ruleId == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'governanceRules'.", id))); - } - this.delete(scope, ruleId, context); - } - - private GovernanceRulesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public GovernanceRuleImpl define(String name) { - return new GovernanceRuleImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java deleted file mode 100644 index e93fab68ae8e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import com.azure.resourcemanager.security.models.EnvironmentDetails; -import com.azure.resourcemanager.security.models.HealthDataClassification; -import com.azure.resourcemanager.security.models.HealthReport; -import com.azure.resourcemanager.security.models.Issue; -import com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated; -import com.azure.resourcemanager.security.models.StatusAutoGenerated; -import java.util.Collections; -import java.util.List; - -public final class HealthReportImpl implements HealthReport { - private HealthReportInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - HealthReportImpl(HealthReportInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ResourceDetailsAutoGenerated resourceDetails() { - return this.innerModel().resourceDetails(); - } - - public EnvironmentDetails environmentDetails() { - return this.innerModel().environmentDetails(); - } - - public HealthDataClassification healthDataClassification() { - return this.innerModel().healthDataClassification(); - } - - public StatusAutoGenerated status() { - return this.innerModel().status(); - } - - public List affectedDefendersPlans() { - List inner = this.innerModel().affectedDefendersPlans(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List issues() { - List inner = this.innerModel().issues(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public HealthReportInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsClientImpl.java deleted file mode 100644 index d2c16f0a8577..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsClientImpl.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.HealthReportOperationsClient; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in HealthReportOperationsClient. */ -public final class HealthReportOperationsClientImpl implements HealthReportOperationsClient { - /** The proxy service used to perform REST calls. */ - private final HealthReportOperationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of HealthReportOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - HealthReportOperationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(HealthReportOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterHealthReportOperations to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterHealth") - public interface HealthReportOperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/healthReports/{healthReportName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @PathParam("healthReportName") String healthReportName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceId, String healthReportName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (healthReportName == null) { - return Mono - .error(new IllegalArgumentException("Parameter healthReportName is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.get(this.client.getEndpoint(), apiVersion, resourceId, healthReportName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceId, String healthReportName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (healthReportName == null) { - return Mono - .error(new IllegalArgumentException("Parameter healthReportName is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, resourceId, healthReportName, accept, context); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceId, String healthReportName) { - return getWithResponseAsync(resourceId, healthReportName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceId, String healthReportName, Context context) { - return getWithResponseAsync(resourceId, healthReportName, context).block(); - } - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HealthReportInner get(String resourceId, String healthReportName) { - return getWithResponse(resourceId, healthReportName, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsImpl.java deleted file mode 100644 index 6824b37162f9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportOperationsImpl.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.HealthReportOperationsClient; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import com.azure.resourcemanager.security.models.HealthReport; -import com.azure.resourcemanager.security.models.HealthReportOperations; - -public final class HealthReportOperationsImpl implements HealthReportOperations { - private static final ClientLogger LOGGER = new ClientLogger(HealthReportOperationsImpl.class); - - private final HealthReportOperationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public HealthReportOperationsImpl( - HealthReportOperationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String resourceId, String healthReportName, Context context) { - Response inner = this.serviceClient().getWithResponse(resourceId, healthReportName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new HealthReportImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public HealthReport get(String resourceId, String healthReportName) { - HealthReportInner inner = this.serviceClient().get(resourceId, healthReportName); - if (inner != null) { - return new HealthReportImpl(inner, this.manager()); - } else { - return null; - } - } - - private HealthReportOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java deleted file mode 100644 index 06047bcaac58..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsClientImpl.java +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.HealthReportsClient; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import com.azure.resourcemanager.security.models.HealthReportsList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in HealthReportsClient. */ -public final class HealthReportsClientImpl implements HealthReportsClient { - /** The proxy service used to perform REST calls. */ - private final HealthReportsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of HealthReportsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - HealthReportsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(HealthReportsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterHealthReports to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterHealth") - public interface HealthReportsService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/healthReports") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of health reports list along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java deleted file mode 100644 index cf87726c0272..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/HealthReportsImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.HealthReportsClient; -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import com.azure.resourcemanager.security.models.HealthReport; -import com.azure.resourcemanager.security.models.HealthReports; - -public final class HealthReportsImpl implements HealthReports { - private static final ClientLogger LOGGER = new ClientLogger(HealthReportsImpl.class); - - private final HealthReportsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public HealthReportsImpl( - HealthReportsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new HealthReportImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return Utils.mapPage(inner, inner1 -> new HealthReportImpl(inner1, this.manager())); - } - - private HealthReportsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesClientImpl.java deleted file mode 100644 index c766c7e38b84..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesClientImpl.java +++ /dev/null @@ -1,645 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.InformationProtectionPoliciesClient; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyList; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in InformationProtectionPoliciesClient. */ -public final class InformationProtectionPoliciesClientImpl implements InformationProtectionPoliciesClient { - /** The proxy service used to perform REST calls. */ - private final InformationProtectionPoliciesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of InformationProtectionPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - InformationProtectionPoliciesClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - InformationProtectionPoliciesService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterInformationProtectionPolicies to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterInform") - public interface InformationProtectionPoliciesService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("informationProtectionPolicyName") - InformationProtectionPolicyName informationProtectionPolicyName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("informationProtectionPolicyName") - InformationProtectionPolicyName informationProtectionPolicyName, - @BodyParam("application/json") InformationProtectionPolicyInner informationProtectionPolicy, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/informationProtectionPolicies") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, InformationProtectionPolicyName informationProtectionPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (informationProtectionPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter informationProtectionPolicyName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - scope, - informationProtectionPolicyName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, InformationProtectionPolicyName informationProtectionPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (informationProtectionPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter informationProtectionPolicyName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), apiVersion, scope, informationProtectionPolicyName, accept, context); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String scope, InformationProtectionPolicyName informationProtectionPolicyName) { - return getWithResponseAsync(scope, informationProtectionPolicyName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String scope, InformationProtectionPolicyName informationProtectionPolicyName, Context context) { - return getWithResponseAsync(scope, informationProtectionPolicyName, context).block(); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InformationProtectionPolicyInner get( - String scope, InformationProtectionPolicyName informationProtectionPolicyName) { - return getWithResponse(scope, informationProtectionPolicyName, Context.NONE).getValue(); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (informationProtectionPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter informationProtectionPolicyName is required and cannot be null.")); - } - if (informationProtectionPolicy == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter informationProtectionPolicy is required and cannot be null.")); - } else { - informationProtectionPolicy.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - scope, - informationProtectionPolicyName, - informationProtectionPolicy, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (informationProtectionPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter informationProtectionPolicyName is required and cannot be null.")); - } - if (informationProtectionPolicy == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter informationProtectionPolicy is required and cannot be null.")); - } else { - informationProtectionPolicy.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - scope, - informationProtectionPolicyName, - informationProtectionPolicy, - accept, - context); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy) { - return createOrUpdateWithResponseAsync(scope, informationProtectionPolicyName, informationProtectionPolicy) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy, - Context context) { - return createOrUpdateWithResponseAsync( - scope, informationProtectionPolicyName, informationProtectionPolicy, context) - .block(); - } - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param informationProtectionPolicy Information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public InformationProtectionPolicyInner createOrUpdate( - String scope, - InformationProtectionPolicyName informationProtectionPolicyName, - InformationProtectionPolicyInner informationProtectionPolicy) { - return createOrUpdateWithResponse( - scope, informationProtectionPolicyName, informationProtectionPolicy, Context.NONE) - .getValue(); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policies response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policies response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policies response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policies response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policies response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); - } - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policies response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 information protection policies response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 information protection policies response along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesImpl.java deleted file mode 100644 index 708c43674c30..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPoliciesImpl.java +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.InformationProtectionPoliciesClient; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import com.azure.resourcemanager.security.models.InformationProtectionPolicies; -import com.azure.resourcemanager.security.models.InformationProtectionPolicy; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; - -public final class InformationProtectionPoliciesImpl implements InformationProtectionPolicies { - private static final ClientLogger LOGGER = new ClientLogger(InformationProtectionPoliciesImpl.class); - - private final InformationProtectionPoliciesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public InformationProtectionPoliciesImpl( - InformationProtectionPoliciesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse( - String scope, InformationProtectionPolicyName informationProtectionPolicyName, Context context) { - Response inner = - this.serviceClient().getWithResponse(scope, informationProtectionPolicyName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new InformationProtectionPolicyImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public InformationProtectionPolicy get( - String scope, InformationProtectionPolicyName informationProtectionPolicyName) { - InformationProtectionPolicyInner inner = this.serviceClient().get(scope, informationProtectionPolicyName); - if (inner != null) { - return new InformationProtectionPolicyImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new InformationProtectionPolicyImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); - return Utils.mapPage(inner, inner1 -> new InformationProtectionPolicyImpl(inner1, this.manager())); - } - - public InformationProtectionPolicy getById(String id) { - String scope = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "scope"); - if (scope == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String informationProtectionPolicyNameLocal = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "informationProtectionPolicyName"); - if (informationProtectionPolicyNameLocal == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'informationProtectionPolicies'.", - id))); - } - InformationProtectionPolicyName informationProtectionPolicyName = - InformationProtectionPolicyName.fromString(informationProtectionPolicyNameLocal); - return this.getWithResponse(scope, informationProtectionPolicyName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String scope = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "scope"); - if (scope == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); - } - String informationProtectionPolicyNameLocal = - Utils - .getValueFromIdByParameterName( - id, - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "informationProtectionPolicyName"); - if (informationProtectionPolicyNameLocal == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment" - + " 'informationProtectionPolicies'.", - id))); - } - InformationProtectionPolicyName informationProtectionPolicyName = - InformationProtectionPolicyName.fromString(informationProtectionPolicyNameLocal); - return this.getWithResponse(scope, informationProtectionPolicyName, context); - } - - private InformationProtectionPoliciesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public InformationProtectionPolicyImpl define(InformationProtectionPolicyName name) { - return new InformationProtectionPolicyImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPolicyImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPolicyImpl.java deleted file mode 100644 index a470297b2563..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/InformationProtectionPolicyImpl.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import com.azure.resourcemanager.security.models.InformationProtectionPolicy; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; -import com.azure.resourcemanager.security.models.InformationType; -import com.azure.resourcemanager.security.models.SensitivityLabel; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.Map; - -public final class InformationProtectionPolicyImpl - implements InformationProtectionPolicy, InformationProtectionPolicy.Definition, InformationProtectionPolicy.Update { - private InformationProtectionPolicyInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public OffsetDateTime lastModifiedUtc() { - return this.innerModel().lastModifiedUtc(); - } - - public String version() { - return this.innerModel().version(); - } - - public Map labels() { - Map inner = this.innerModel().labels(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public Map informationTypes() { - Map inner = this.innerModel().informationTypes(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public InformationProtectionPolicyInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String scope; - - private InformationProtectionPolicyName informationProtectionPolicyName; - - public InformationProtectionPolicyImpl withExistingScope(String scope) { - this.scope = scope; - return this; - } - - public InformationProtectionPolicy create() { - this.innerObject = - serviceManager - .serviceClient() - .getInformationProtectionPolicies() - .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public InformationProtectionPolicy create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getInformationProtectionPolicies() - .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), context) - .getValue(); - return this; - } - - InformationProtectionPolicyImpl( - InformationProtectionPolicyName name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new InformationProtectionPolicyInner(); - this.serviceManager = serviceManager; - this.informationProtectionPolicyName = name; - } - - public InformationProtectionPolicyImpl update() { - return this; - } - - public InformationProtectionPolicy apply() { - this.innerObject = - serviceManager - .serviceClient() - .getInformationProtectionPolicies() - .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public InformationProtectionPolicy apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getInformationProtectionPolicies() - .createOrUpdateWithResponse(scope, informationProtectionPolicyName, this.innerModel(), context) - .getValue(); - return this; - } - - InformationProtectionPolicyImpl( - InformationProtectionPolicyInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.scope = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "scope"); - this.informationProtectionPolicyName = - InformationProtectionPolicyName - .fromString( - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", - "informationProtectionPolicyName")); - } - - public InformationProtectionPolicy refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getInformationProtectionPolicies() - .getWithResponse(scope, informationProtectionPolicyName, Context.NONE) - .getValue(); - return this; - } - - public InformationProtectionPolicy refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getInformationProtectionPolicies() - .getWithResponse(scope, informationProtectionPolicyName, context) - .getValue(); - return this; - } - - public InformationProtectionPolicyImpl withLabels(Map labels) { - this.innerModel().withLabels(labels); - return this; - } - - public InformationProtectionPolicyImpl withInformationTypes(Map informationTypes) { - this.innerModel().withInformationTypes(informationTypes); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingImpl.java deleted file mode 100644 index 0100de28a14d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; -import com.azure.resourcemanager.security.models.ConnectionStrings; -import com.azure.resourcemanager.security.models.IngestionSetting; -import com.azure.resourcemanager.security.models.IngestionSettingToken; - -public final class IngestionSettingImpl implements IngestionSetting, IngestionSetting.Definition { - private IngestionSettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IngestionSettingImpl( - IngestionSettingInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public Object properties() { - return this.innerModel().properties(); - } - - public IngestionSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String ingestionSettingName; - - public IngestionSetting create() { - this.innerObject = - serviceManager - .serviceClient() - .getIngestionSettings() - .createWithResponse(ingestionSettingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public IngestionSetting create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIngestionSettings() - .createWithResponse(ingestionSettingName, this.innerModel(), context) - .getValue(); - return this; - } - - IngestionSettingImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new IngestionSettingInner(); - this.serviceManager = serviceManager; - this.ingestionSettingName = name; - } - - public IngestionSetting refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getIngestionSettings() - .getWithResponse(ingestionSettingName, Context.NONE) - .getValue(); - return this; - } - - public IngestionSetting refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIngestionSettings() - .getWithResponse(ingestionSettingName, context) - .getValue(); - return this; - } - - public Response listTokensWithResponse(Context context) { - return serviceManager.ingestionSettings().listTokensWithResponse(ingestionSettingName, context); - } - - public IngestionSettingToken listTokens() { - return serviceManager.ingestionSettings().listTokens(ingestionSettingName); - } - - public Response listConnectionStringsWithResponse(Context context) { - return serviceManager.ingestionSettings().listConnectionStringsWithResponse(ingestionSettingName, context); - } - - public ConnectionStrings listConnectionStrings() { - return serviceManager.ingestionSettings().listConnectionStrings(ingestionSettingName); - } - - public IngestionSettingImpl withProperties(Object properties) { - this.innerModel().withProperties(properties); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingTokenImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingTokenImpl.java deleted file mode 100644 index 260f3548df8f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingTokenImpl.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner; -import com.azure.resourcemanager.security.models.IngestionSettingToken; - -public final class IngestionSettingTokenImpl implements IngestionSettingToken { - private IngestionSettingTokenInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IngestionSettingTokenImpl( - IngestionSettingTokenInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String token() { - return this.innerModel().token(); - } - - public IngestionSettingTokenInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsClientImpl.java deleted file mode 100644 index 0ded97111c93..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsClientImpl.java +++ /dev/null @@ -1,1030 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.IngestionSettingsClient; -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner; -import com.azure.resourcemanager.security.models.IngestionSettingList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IngestionSettingsClient. */ -public final class IngestionSettingsClientImpl implements IngestionSettingsClient { - /** The proxy service used to perform REST calls. */ - private final IngestionSettingsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IngestionSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IngestionSettingsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(IngestionSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIngestionSettings to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIngest") - public interface IngestionSettingsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @BodyParam("application/json") IngestionSettingInner ingestionSetting, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listTokens( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listConnectionStrings( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ingestionSettingName") String ingestionSettingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ingestionSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ingestionSettingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String ingestionSettingName) { - return getWithResponseAsync(ingestionSettingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String ingestionSettingName, Context context) { - return getWithResponseAsync(ingestionSettingName, context).block(); - } - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IngestionSettingInner get(String ingestionSettingName) { - return getWithResponse(ingestionSettingName, Context.NONE).getValue(); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String ingestionSettingName, IngestionSettingInner ingestionSetting) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - if (ingestionSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSetting is required and cannot be null.")); - } else { - ingestionSetting.validate(); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - ingestionSetting, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String ingestionSettingName, IngestionSettingInner ingestionSetting, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - if (ingestionSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSetting is required and cannot be null.")); - } else { - ingestionSetting.validate(); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - ingestionSetting, - accept, - context); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String ingestionSettingName, IngestionSettingInner ingestionSetting) { - return createWithResponseAsync(ingestionSettingName, ingestionSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String ingestionSettingName, IngestionSettingInner ingestionSetting, Context context) { - return createWithResponseAsync(ingestionSettingName, ingestionSetting, context).block(); - } - - /** - * Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param ingestionSetting Ingestion setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IngestionSettingInner create(String ingestionSettingName, IngestionSettingInner ingestionSetting) { - return createWithResponse(ingestionSettingName, ingestionSetting, Context.NONE).getValue(); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String ingestionSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String ingestionSettingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String ingestionSettingName) { - return deleteWithResponseAsync(ingestionSettingName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String ingestionSettingName, Context context) { - return deleteWithResponseAsync(ingestionSettingName, context).block(); - } - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String ingestionSettingName) { - deleteWithResponse(ingestionSettingName, Context.NONE); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTokensWithResponseAsync(String ingestionSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listTokens( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listTokensWithResponseAsync( - String ingestionSettingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listTokens( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listTokensAsync(String ingestionSettingName) { - return listTokensWithResponseAsync(ingestionSettingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listTokensWithResponse(String ingestionSettingName, Context context) { - return listTokensWithResponseAsync(ingestionSettingName, context).block(); - } - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IngestionSettingTokenInner listTokens(String ingestionSettingName) { - return listTokensWithResponse(ingestionSettingName, Context.NONE).getValue(); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConnectionStringsWithResponseAsync(String ingestionSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listConnectionStrings( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listConnectionStringsWithResponseAsync( - String ingestionSettingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ingestionSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter ingestionSettingName is required and cannot be null.")); - } - final String apiVersion = "2021-01-15-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listConnectionStrings( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ingestionSettingName, - accept, - context); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listConnectionStringsAsync(String ingestionSettingName) { - return listConnectionStringsWithResponseAsync(ingestionSettingName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listConnectionStringsWithResponse( - String ingestionSettingName, Context context) { - return listConnectionStringsWithResponseAsync(ingestionSettingName, context).block(); - } - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConnectionStringsInner listConnectionStrings(String ingestionSettingName) { - return listConnectionStringsWithResponse(ingestionSettingName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsImpl.java deleted file mode 100644 index da9c5111770e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IngestionSettingsImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.IngestionSettingsClient; -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner; -import com.azure.resourcemanager.security.models.ConnectionStrings; -import com.azure.resourcemanager.security.models.IngestionSetting; -import com.azure.resourcemanager.security.models.IngestionSettingToken; -import com.azure.resourcemanager.security.models.IngestionSettings; - -public final class IngestionSettingsImpl implements IngestionSettings { - private static final ClientLogger LOGGER = new ClientLogger(IngestionSettingsImpl.class); - - private final IngestionSettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IngestionSettingsImpl( - IngestionSettingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new IngestionSettingImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new IngestionSettingImpl(inner1, this.manager())); - } - - public Response getWithResponse(String ingestionSettingName, Context context) { - Response inner = this.serviceClient().getWithResponse(ingestionSettingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IngestionSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IngestionSetting get(String ingestionSettingName) { - IngestionSettingInner inner = this.serviceClient().get(ingestionSettingName); - if (inner != null) { - return new IngestionSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String ingestionSettingName, Context context) { - return this.serviceClient().deleteWithResponse(ingestionSettingName, context); - } - - public void delete(String ingestionSettingName) { - this.serviceClient().delete(ingestionSettingName); - } - - public Response listTokensWithResponse(String ingestionSettingName, Context context) { - Response inner = - this.serviceClient().listTokensWithResponse(ingestionSettingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IngestionSettingTokenImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IngestionSettingToken listTokens(String ingestionSettingName) { - IngestionSettingTokenInner inner = this.serviceClient().listTokens(ingestionSettingName); - if (inner != null) { - return new IngestionSettingTokenImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listConnectionStringsWithResponse(String ingestionSettingName, Context context) { - Response inner = - this.serviceClient().listConnectionStringsWithResponse(ingestionSettingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ConnectionStringsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ConnectionStrings listConnectionStrings(String ingestionSettingName) { - ConnectionStringsInner inner = this.serviceClient().listConnectionStrings(ingestionSettingName); - if (inner != null) { - return new ConnectionStringsImpl(inner, this.manager()); - } else { - return null; - } - } - - public IngestionSetting getById(String id) { - String ingestionSettingName = Utils.getValueFromIdByName(id, "ingestionSettings"); - if (ingestionSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'ingestionSettings'.", id))); - } - return this.getWithResponse(ingestionSettingName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String ingestionSettingName = Utils.getValueFromIdByName(id, "ingestionSettings"); - if (ingestionSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'ingestionSettings'.", id))); - } - return this.getWithResponse(ingestionSettingName, context); - } - - public void deleteById(String id) { - String ingestionSettingName = Utils.getValueFromIdByName(id, "ingestionSettings"); - if (ingestionSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'ingestionSettings'.", id))); - } - this.deleteWithResponse(ingestionSettingName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String ingestionSettingName = Utils.getValueFromIdByName(id, "ingestionSettings"); - if (ingestionSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'ingestionSettings'.", id))); - } - return this.deleteWithResponse(ingestionSettingName, context); - } - - private IngestionSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public IngestionSettingImpl define(String name) { - return new IngestionSettingImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedAlertImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedAlertImpl.java deleted file mode 100644 index b6ba40c4985e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedAlertImpl.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlert; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem; -import com.azure.resourcemanager.security.models.ReportedSeverity; -import java.time.LocalDate; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class IoTSecurityAggregatedAlertImpl implements IoTSecurityAggregatedAlert { - private IoTSecurityAggregatedAlertInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IoTSecurityAggregatedAlertImpl( - IoTSecurityAggregatedAlertInner 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 Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String alertType() { - return this.innerModel().alertType(); - } - - public String alertDisplayName() { - return this.innerModel().alertDisplayName(); - } - - public LocalDate aggregatedDateUtc() { - return this.innerModel().aggregatedDateUtc(); - } - - public String vendorName() { - return this.innerModel().vendorName(); - } - - public ReportedSeverity reportedSeverity() { - return this.innerModel().reportedSeverity(); - } - - public String remediationSteps() { - return this.innerModel().remediationSteps(); - } - - public String description() { - return this.innerModel().description(); - } - - public Long count() { - return this.innerModel().count(); - } - - public String effectedResourceType() { - return this.innerModel().effectedResourceType(); - } - - public String systemSource() { - return this.innerModel().systemSource(); - } - - public String actionTaken() { - return this.innerModel().actionTaken(); - } - - public String logAnalyticsQuery() { - return this.innerModel().logAnalyticsQuery(); - } - - public List topDevicesList() { - List inner = this.innerModel().topDevicesList(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public IoTSecurityAggregatedAlertInner 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/IoTSecurityAggregatedRecommendationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedRecommendationImpl.java deleted file mode 100644 index 8b33589368a0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecurityAggregatedRecommendationImpl.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedRecommendation; -import com.azure.resourcemanager.security.models.ReportedSeverity; -import java.util.Collections; -import java.util.Map; - -public final class IoTSecurityAggregatedRecommendationImpl implements IoTSecurityAggregatedRecommendation { - private IoTSecurityAggregatedRecommendationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IoTSecurityAggregatedRecommendationImpl( - IoTSecurityAggregatedRecommendationInner 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 Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String recommendationName() { - return this.innerModel().recommendationName(); - } - - public String recommendationDisplayName() { - return this.innerModel().recommendationDisplayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public String recommendationTypeId() { - return this.innerModel().recommendationTypeId(); - } - - public String detectedBy() { - return this.innerModel().detectedBy(); - } - - public String remediationSteps() { - return this.innerModel().remediationSteps(); - } - - public ReportedSeverity reportedSeverity() { - return this.innerModel().reportedSeverity(); - } - - public Long healthyDevices() { - return this.innerModel().healthyDevices(); - } - - public Long unhealthyDeviceCount() { - return this.innerModel().unhealthyDeviceCount(); - } - - public String logAnalyticsQuery() { - return this.innerModel().logAnalyticsQuery(); - } - - public IoTSecurityAggregatedRecommendationInner 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/IoTSecuritySolutionAnalyticsModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionAnalyticsModelImpl.java deleted file mode 100644 index 40b21a2f1404..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionAnalyticsModelImpl.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.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner; -import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModel; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem; -import com.azure.resourcemanager.security.models.IoTSeverityMetrics; -import java.util.Collections; -import java.util.List; - -public final class IoTSecuritySolutionAnalyticsModelImpl implements IoTSecuritySolutionAnalyticsModel { - private IoTSecuritySolutionAnalyticsModelInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IoTSecuritySolutionAnalyticsModelImpl( - IoTSecuritySolutionAnalyticsModelInner 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 IoTSeverityMetrics metrics() { - return this.innerModel().metrics(); - } - - public Long unhealthyDeviceCount() { - return this.innerModel().unhealthyDeviceCount(); - } - - public List devicesMetrics() { - List inner = this.innerModel().devicesMetrics(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List topAlertedDevices() { - List inner = this.innerModel().topAlertedDevices(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List mostPrevalentDeviceAlerts() { - List inner = this.innerModel().mostPrevalentDeviceAlerts(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List mostPrevalentDeviceRecommendations() { - List inner = this.innerModel().mostPrevalentDeviceRecommendations(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public IoTSecuritySolutionAnalyticsModelInner 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/IoTSecuritySolutionAnalyticsModelListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionAnalyticsModelListImpl.java deleted file mode 100644 index f8cf0fe29c55..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionAnalyticsModelListImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelListInner; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModel; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class IoTSecuritySolutionAnalyticsModelListImpl implements IoTSecuritySolutionAnalyticsModelList { - private IoTSecuritySolutionAnalyticsModelListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - IoTSecuritySolutionAnalyticsModelListImpl( - IoTSecuritySolutionAnalyticsModelListInner 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 IoTSecuritySolutionAnalyticsModelImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public String nextLink() { - return this.innerModel().nextLink(); - } - - public IoTSecuritySolutionAnalyticsModelListInner 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/IoTSecuritySolutionModelImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionModelImpl.java deleted file mode 100644 index 849907cb0bb6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IoTSecuritySolutionModelImpl.java +++ /dev/null @@ -1,328 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner; -import com.azure.resourcemanager.security.models.AdditionalWorkspacesProperties; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import com.azure.resourcemanager.security.models.UpdateIotSecuritySolutionData; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class IoTSecuritySolutionModelImpl - implements IoTSecuritySolutionModel, IoTSecuritySolutionModel.Definition, IoTSecuritySolutionModel.Update { - private IoTSecuritySolutionModelInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public String workspace() { - return this.innerModel().workspace(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public SecuritySolutionStatus status() { - return this.innerModel().status(); - } - - public List export() { - List inner = this.innerModel().export(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List disabledDataSources() { - List inner = this.innerModel().disabledDataSources(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List iotHubs() { - List inner = this.innerModel().iotHubs(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public UserDefinedResourcesProperties userDefinedResources() { - return this.innerModel().userDefinedResources(); - } - - public List autoDiscoveredResources() { - List inner = this.innerModel().autoDiscoveredResources(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List recommendationsConfiguration() { - List inner = this.innerModel().recommendationsConfiguration(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public UnmaskedIpLoggingStatus unmaskedIpLoggingStatus() { - return this.innerModel().unmaskedIpLoggingStatus(); - } - - public List additionalWorkspaces() { - List inner = this.innerModel().additionalWorkspaces(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public IoTSecuritySolutionModelInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String solutionName; - - private UpdateIotSecuritySolutionData updateUpdateIotSecuritySolutionData; - - public IoTSecuritySolutionModelImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public IoTSecuritySolutionModel create() { - this.innerObject = - serviceManager - .serviceClient() - .getIotSecuritySolutions() - .createOrUpdateWithResponse(resourceGroupName, solutionName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public IoTSecuritySolutionModel create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIotSecuritySolutions() - .createOrUpdateWithResponse(resourceGroupName, solutionName, this.innerModel(), context) - .getValue(); - return this; - } - - IoTSecuritySolutionModelImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new IoTSecuritySolutionModelInner(); - this.serviceManager = serviceManager; - this.solutionName = name; - } - - public IoTSecuritySolutionModelImpl update() { - this.updateUpdateIotSecuritySolutionData = new UpdateIotSecuritySolutionData(); - return this; - } - - public IoTSecuritySolutionModel apply() { - this.innerObject = - serviceManager - .serviceClient() - .getIotSecuritySolutions() - .updateWithResponse(resourceGroupName, solutionName, updateUpdateIotSecuritySolutionData, Context.NONE) - .getValue(); - return this; - } - - public IoTSecuritySolutionModel apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIotSecuritySolutions() - .updateWithResponse(resourceGroupName, solutionName, updateUpdateIotSecuritySolutionData, context) - .getValue(); - return this; - } - - IoTSecuritySolutionModelImpl( - IoTSecuritySolutionModelInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.solutionName = Utils.getValueFromIdByName(innerObject.id(), "iotSecuritySolutions"); - } - - public IoTSecuritySolutionModel refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getIotSecuritySolutions() - .getByResourceGroupWithResponse(resourceGroupName, solutionName, Context.NONE) - .getValue(); - return this; - } - - public IoTSecuritySolutionModel refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getIotSecuritySolutions() - .getByResourceGroupWithResponse(resourceGroupName, solutionName, context) - .getValue(); - return this; - } - - public IoTSecuritySolutionModelImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public IoTSecuritySolutionModelImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public IoTSecuritySolutionModelImpl withTags(Map tags) { - if (isInCreateMode()) { - this.innerModel().withTags(tags); - return this; - } else { - this.updateUpdateIotSecuritySolutionData.withTags(tags); - return this; - } - } - - public IoTSecuritySolutionModelImpl withWorkspace(String workspace) { - this.innerModel().withWorkspace(workspace); - return this; - } - - public IoTSecuritySolutionModelImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public IoTSecuritySolutionModelImpl withStatus(SecuritySolutionStatus status) { - this.innerModel().withStatus(status); - return this; - } - - public IoTSecuritySolutionModelImpl withExport(List export) { - this.innerModel().withExport(export); - return this; - } - - public IoTSecuritySolutionModelImpl withDisabledDataSources(List disabledDataSources) { - this.innerModel().withDisabledDataSources(disabledDataSources); - return this; - } - - public IoTSecuritySolutionModelImpl withIotHubs(List iotHubs) { - this.innerModel().withIotHubs(iotHubs); - return this; - } - - public IoTSecuritySolutionModelImpl withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources) { - if (isInCreateMode()) { - this.innerModel().withUserDefinedResources(userDefinedResources); - return this; - } else { - this.updateUpdateIotSecuritySolutionData.withUserDefinedResources(userDefinedResources); - return this; - } - } - - public IoTSecuritySolutionModelImpl withRecommendationsConfiguration( - List recommendationsConfiguration) { - if (isInCreateMode()) { - this.innerModel().withRecommendationsConfiguration(recommendationsConfiguration); - return this; - } else { - this.updateUpdateIotSecuritySolutionData.withRecommendationsConfiguration(recommendationsConfiguration); - return this; - } - } - - public IoTSecuritySolutionModelImpl withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus unmaskedIpLoggingStatus) { - this.innerModel().withUnmaskedIpLoggingStatus(unmaskedIpLoggingStatus); - return this; - } - - public IoTSecuritySolutionModelImpl withAdditionalWorkspaces( - List additionalWorkspaces) { - this.innerModel().withAdditionalWorkspaces(additionalWorkspaces); - 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/IotSecuritySolutionAnalyticsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionAnalyticsClientImpl.java deleted file mode 100644 index d047f7931d33..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionAnalyticsClientImpl.java +++ /dev/null @@ -1,385 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionAnalyticsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelListInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotSecuritySolutionAnalyticsClient. */ -public final class IotSecuritySolutionAnalyticsClientImpl implements IotSecuritySolutionAnalyticsClient { - /** The proxy service used to perform REST calls. */ - private final IotSecuritySolutionAnalyticsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotSecuritySolutionAnalyticsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotSecuritySolutionAnalyticsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - IotSecuritySolutionAnalyticsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotSecuritySolutionAnalytics to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotSec") - public interface IotSecuritySolutionAnalyticsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("solutionName") String solutionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("solutionName") String solutionName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String solutionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String resourceGroupName, String solutionName, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - accept, - context); - } - - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String resourceGroupName, String solutionName) { - return listWithResponseAsync(resourceGroupName, solutionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String resourceGroupName, String solutionName, Context context) { - return listWithResponseAsync(resourceGroupName, solutionName, context).block(); - } - - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecuritySolutionAnalyticsModelListInner list(String resourceGroupName, String solutionName) { - return listWithResponse(resourceGroupName, solutionName, Context.NONE).getValue(); - } - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 analytics of your IoT Security solution along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String solutionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 analytics of your IoT Security solution along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String solutionName, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - accept, - context); - } - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 analytics of your IoT Security solution on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String resourceGroupName, String solutionName) { - return getWithResponseAsync(resourceGroupName, solutionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 analytics of your IoT Security solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String solutionName, Context context) { - return getWithResponseAsync(resourceGroupName, solutionName, context).block(); - } - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 analytics of your IoT Security solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecuritySolutionAnalyticsModelInner get(String resourceGroupName, String solutionName) { - return getWithResponse(resourceGroupName, solutionName, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionAnalyticsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionAnalyticsImpl.java deleted file mode 100644 index 23c075d86a6d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionAnalyticsImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.IotSecuritySolutionAnalyticsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelListInner; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModel; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelList; -import com.azure.resourcemanager.security.models.IotSecuritySolutionAnalytics; - -public final class IotSecuritySolutionAnalyticsImpl implements IotSecuritySolutionAnalytics { - private static final ClientLogger LOGGER = new ClientLogger(IotSecuritySolutionAnalyticsImpl.class); - - private final IotSecuritySolutionAnalyticsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotSecuritySolutionAnalyticsImpl( - IotSecuritySolutionAnalyticsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listWithResponse( - String resourceGroupName, String solutionName, Context context) { - Response inner = - this.serviceClient().listWithResponse(resourceGroupName, solutionName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IoTSecuritySolutionAnalyticsModelListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IoTSecuritySolutionAnalyticsModelList list(String resourceGroupName, String solutionName) { - IoTSecuritySolutionAnalyticsModelListInner inner = this.serviceClient().list(resourceGroupName, solutionName); - if (inner != null) { - return new IoTSecuritySolutionAnalyticsModelListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String solutionName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, solutionName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IoTSecuritySolutionAnalyticsModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IoTSecuritySolutionAnalyticsModel get(String resourceGroupName, String solutionName) { - IoTSecuritySolutionAnalyticsModelInner inner = this.serviceClient().get(resourceGroupName, solutionName); - if (inner != null) { - return new IoTSecuritySolutionAnalyticsModelImpl(inner, this.manager()); - } else { - return null; - } - } - - private IotSecuritySolutionAnalyticsClient 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/IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl.java deleted file mode 100644 index 9ec5cec7cd57..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl.java +++ /dev/null @@ -1,753 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsAggregatedAlertsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * IotSecuritySolutionsAnalyticsAggregatedAlertsClient. - */ -public final class IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl - implements IotSecuritySolutionsAnalyticsAggregatedAlertsClient { - /** The proxy service used to perform REST calls. */ - private final IotSecuritySolutionsAnalyticsAggregatedAlertsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - IotSecuritySolutionsAnalyticsAggregatedAlertsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotSecuritySolutionsAnalyticsAggregatedAlerts to be - * used by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotSec") - public interface IotSecuritySolutionsAnalyticsAggregatedAlertsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("solutionName") String solutionName, - @QueryParam("$top") Integer top, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("solutionName") String solutionName, - @PathParam("aggregatedAlertName") String aggregatedAlertName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}/dismiss") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> dismiss( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("solutionName") String solutionName, - @PathParam("aggregatedAlertName") String aggregatedAlertName, - @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); - } - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solution aggregated alert data along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String solutionName, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - top, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solution aggregated alert data along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String solutionName, Integer top, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - top, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solution aggregated alert data as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String solutionName, Integer top) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, solutionName, top), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solution aggregated alert data as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String solutionName) { - final Integer top = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, solutionName, top), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solution aggregated alert data as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String solutionName, Integer top, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, solutionName, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solution aggregated alert data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String solutionName) { - final Integer top = null; - return new PagedIterable<>(listAsync(resourceGroupName, solutionName, top)); - } - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solution aggregated alert data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String solutionName, Integer top, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, solutionName, top, context)); - } - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 security Solution Aggregated Alert information along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String solutionName, String aggregatedAlertName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (aggregatedAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter aggregatedAlertName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - aggregatedAlertName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 security Solution Aggregated Alert information along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String solutionName, String aggregatedAlertName, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (aggregatedAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter aggregatedAlertName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - aggregatedAlertName, - accept, - context); - } - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 security Solution Aggregated Alert information on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String solutionName, String aggregatedAlertName) { - return getWithResponseAsync(resourceGroupName, solutionName, aggregatedAlertName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 security Solution Aggregated Alert information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String solutionName, String aggregatedAlertName, Context context) { - return getWithResponseAsync(resourceGroupName, solutionName, aggregatedAlertName, context).block(); - } - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 security Solution Aggregated Alert information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecurityAggregatedAlertInner get( - String resourceGroupName, String solutionName, String aggregatedAlertName) { - return getWithResponse(resourceGroupName, solutionName, aggregatedAlertName, Context.NONE).getValue(); - } - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> dismissWithResponseAsync( - String resourceGroupName, String solutionName, String aggregatedAlertName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (aggregatedAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter aggregatedAlertName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .dismiss( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - aggregatedAlertName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> dismissWithResponseAsync( - String resourceGroupName, String solutionName, String aggregatedAlertName, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (aggregatedAlertName == null) { - return Mono - .error(new IllegalArgumentException("Parameter aggregatedAlertName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .dismiss( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - aggregatedAlertName, - accept, - context); - } - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono dismissAsync(String resourceGroupName, String solutionName, String aggregatedAlertName) { - return dismissWithResponseAsync(resourceGroupName, solutionName, aggregatedAlertName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response dismissWithResponse( - String resourceGroupName, String solutionName, String aggregatedAlertName, Context context) { - return dismissWithResponseAsync(resourceGroupName, solutionName, aggregatedAlertName, context).block(); - } - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void dismiss(String resourceGroupName, String solutionName, String aggregatedAlertName) { - dismissWithResponse(resourceGroupName, solutionName, aggregatedAlertName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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 Security solution aggregated alert data along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsAggregatedAlertsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsAggregatedAlertsImpl.java deleted file mode 100644 index be131cbc5431..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsAggregatedAlertsImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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.IotSecuritySolutionsAnalyticsAggregatedAlertsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlert; -import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsAggregatedAlerts; - -public final class IotSecuritySolutionsAnalyticsAggregatedAlertsImpl - implements IotSecuritySolutionsAnalyticsAggregatedAlerts { - private static final ClientLogger LOGGER = - new ClientLogger(IotSecuritySolutionsAnalyticsAggregatedAlertsImpl.class); - - private final IotSecuritySolutionsAnalyticsAggregatedAlertsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotSecuritySolutionsAnalyticsAggregatedAlertsImpl( - IotSecuritySolutionsAnalyticsAggregatedAlertsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String solutionName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, solutionName); - return Utils.mapPage(inner, inner1 -> new IoTSecurityAggregatedAlertImpl(inner1, this.manager())); - } - - public PagedIterable list( - String resourceGroupName, String solutionName, Integer top, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, solutionName, top, context); - return Utils.mapPage(inner, inner1 -> new IoTSecurityAggregatedAlertImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String resourceGroupName, String solutionName, String aggregatedAlertName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, solutionName, aggregatedAlertName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IoTSecurityAggregatedAlertImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IoTSecurityAggregatedAlert get(String resourceGroupName, String solutionName, String aggregatedAlertName) { - IoTSecurityAggregatedAlertInner inner = - this.serviceClient().get(resourceGroupName, solutionName, aggregatedAlertName); - if (inner != null) { - return new IoTSecurityAggregatedAlertImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response dismissWithResponse( - String resourceGroupName, String solutionName, String aggregatedAlertName, Context context) { - return this.serviceClient().dismissWithResponse(resourceGroupName, solutionName, aggregatedAlertName, context); - } - - public void dismiss(String resourceGroupName, String solutionName, String aggregatedAlertName) { - this.serviceClient().dismiss(resourceGroupName, solutionName, aggregatedAlertName); - } - - private IotSecuritySolutionsAnalyticsAggregatedAlertsClient 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/IotSecuritySolutionsAnalyticsRecommendationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsRecommendationsClientImpl.java deleted file mode 100644 index 606ce1248876..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsRecommendationsClientImpl.java +++ /dev/null @@ -1,581 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsRecommendationsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedRecommendationList; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * IotSecuritySolutionsAnalyticsRecommendationsClient. - */ -public final class IotSecuritySolutionsAnalyticsRecommendationsClientImpl - implements IotSecuritySolutionsAnalyticsRecommendationsClient { - /** The proxy service used to perform REST calls. */ - private final IotSecuritySolutionsAnalyticsRecommendationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotSecuritySolutionsAnalyticsRecommendationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotSecuritySolutionsAnalyticsRecommendationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - IotSecuritySolutionsAnalyticsRecommendationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotSecuritySolutionsAnalyticsRecommendations to be used - * by the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotSec") - public interface IotSecuritySolutionsAnalyticsRecommendationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("solutionName") String solutionName, - @PathParam("aggregatedRecommendationName") String aggregatedRecommendationName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("solutionName") String solutionName, - @QueryParam("$top") Integer top, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution recommendation information along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String solutionName, String aggregatedRecommendationName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (aggregatedRecommendationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter aggregatedRecommendationName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - aggregatedRecommendationName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution recommendation information along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String solutionName, String aggregatedRecommendationName, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (aggregatedRecommendationName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter aggregatedRecommendationName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - aggregatedRecommendationName, - accept, - context); - } - - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution recommendation information on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String solutionName, String aggregatedRecommendationName) { - return getWithResponseAsync(resourceGroupName, solutionName, aggregatedRecommendationName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution recommendation information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String solutionName, String aggregatedRecommendationName, Context context) { - return getWithResponseAsync(resourceGroupName, solutionName, aggregatedRecommendationName, context).block(); - } - - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution recommendation information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecurityAggregatedRecommendationInner get( - String resourceGroupName, String solutionName, String aggregatedRecommendationName) { - return getWithResponse(resourceGroupName, solutionName, aggregatedRecommendationName, Context.NONE).getValue(); - } - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solution aggregated recommendations along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String solutionName, Integer top) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - top, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solution aggregated recommendations along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String solutionName, Integer top, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - top, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solution aggregated recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String solutionName, Integer top) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, solutionName, top), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solution aggregated recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String solutionName) { - final Integer top = null; - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, solutionName, top), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solution aggregated recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String solutionName, Integer top, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, solutionName, top, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solution aggregated recommendations as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String solutionName) { - final Integer top = null; - return new PagedIterable<>(listAsync(resourceGroupName, solutionName, top)); - } - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solution aggregated recommendations as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String solutionName, Integer top, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, solutionName, top, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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 Security solution aggregated recommendations along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsRecommendationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsRecommendationsImpl.java deleted file mode 100644 index 785dc37759ab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsAnalyticsRecommendationsImpl.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.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.IotSecuritySolutionsAnalyticsRecommendationsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedRecommendation; -import com.azure.resourcemanager.security.models.IotSecuritySolutionsAnalyticsRecommendations; - -public final class IotSecuritySolutionsAnalyticsRecommendationsImpl - implements IotSecuritySolutionsAnalyticsRecommendations { - private static final ClientLogger LOGGER = new ClientLogger(IotSecuritySolutionsAnalyticsRecommendationsImpl.class); - - private final IotSecuritySolutionsAnalyticsRecommendationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotSecuritySolutionsAnalyticsRecommendationsImpl( - IotSecuritySolutionsAnalyticsRecommendationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse( - String resourceGroupName, String solutionName, String aggregatedRecommendationName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, solutionName, aggregatedRecommendationName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IoTSecurityAggregatedRecommendationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IoTSecurityAggregatedRecommendation get( - String resourceGroupName, String solutionName, String aggregatedRecommendationName) { - IoTSecurityAggregatedRecommendationInner inner = - this.serviceClient().get(resourceGroupName, solutionName, aggregatedRecommendationName); - if (inner != null) { - return new IoTSecurityAggregatedRecommendationImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable list(String resourceGroupName, String solutionName) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, solutionName); - return Utils.mapPage(inner, inner1 -> new IoTSecurityAggregatedRecommendationImpl(inner1, this.manager())); - } - - public PagedIterable list( - String resourceGroupName, String solutionName, Integer top, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, solutionName, top, context); - return Utils.mapPage(inner, inner1 -> new IoTSecurityAggregatedRecommendationImpl(inner1, this.manager())); - } - - private IotSecuritySolutionsAnalyticsRecommendationsClient 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/IotSecuritySolutionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsClientImpl.java deleted file mode 100644 index c91df12da6ce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsClientImpl.java +++ /dev/null @@ -1,1347 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionsList; -import com.azure.resourcemanager.security.models.UpdateIotSecuritySolutionData; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in IotSecuritySolutionsClient. */ -public final class IotSecuritySolutionsClientImpl implements IotSecuritySolutionsClient { - /** The proxy service used to perform REST calls. */ - private final IotSecuritySolutionsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of IotSecuritySolutionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - IotSecuritySolutionsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(IotSecuritySolutionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterIotSecuritySolutions to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterIotSec") - public interface IotSecuritySolutionsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") - @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("solutionName") String solutionName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("solutionName") String solutionName, - @BodyParam("application/json") IoTSecuritySolutionModelInner iotSecuritySolutionData, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("solutionName") String solutionName, - @BodyParam("application/json") UpdateIotSecuritySolutionData updateIotSecuritySolutionData, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}") - @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("solutionName") String solutionName, - @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); - - @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); - } - - /** - * Use this method to get the list of IoT Security solutions by subscription. - * - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solutions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to get the list of IoT Security solutions by subscription. - * - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solutions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Use this method to get the list of IoT Security solutions by subscription. - * - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solutions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the list of IoT Security solutions by 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 IoT Security solutions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the list of IoT Security solutions by subscription. - * - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solutions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Use this method to get the list of IoT Security solutions by 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 IoT Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Use this method to get the list of IoT Security solutions by subscription. - * - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solutions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solutions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solutions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final String filter = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solutions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String filter, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final String filter = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter)); - } - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown 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 Security solutions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); - } - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String solutionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String solutionName, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - accept, - context); - } - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String solutionName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, solutionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String solutionName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, solutionName, context).block(); - } - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecuritySolutionModelInner getByResourceGroup(String resourceGroupName, String solutionName) { - return getByResourceGroupWithResponse(resourceGroupName, solutionName, Context.NONE).getValue(); - } - - /** - * Use this method to create or update yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param iotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String solutionName, IoTSecuritySolutionModelInner iotSecuritySolutionData) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (iotSecuritySolutionData == null) { - return Mono - .error( - new IllegalArgumentException("Parameter iotSecuritySolutionData is required and cannot be null.")); - } else { - iotSecuritySolutionData.validate(); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - iotSecuritySolutionData, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to create or update yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param iotSecuritySolutionData The security solution data. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String solutionName, - IoTSecuritySolutionModelInner iotSecuritySolutionData, - 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (iotSecuritySolutionData == null) { - return Mono - .error( - new IllegalArgumentException("Parameter iotSecuritySolutionData is required and cannot be null.")); - } else { - iotSecuritySolutionData.validate(); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - iotSecuritySolutionData, - accept, - context); - } - - /** - * Use this method to create or update yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param iotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String solutionName, IoTSecuritySolutionModelInner iotSecuritySolutionData) { - return createOrUpdateWithResponseAsync(resourceGroupName, solutionName, iotSecuritySolutionData) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to create or update yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param iotSecuritySolutionData The security solution data. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String solutionName, - IoTSecuritySolutionModelInner iotSecuritySolutionData, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, solutionName, iotSecuritySolutionData, context) - .block(); - } - - /** - * Use this method to create or update yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param iotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecuritySolutionModelInner createOrUpdate( - String resourceGroupName, String solutionName, IoTSecuritySolutionModelInner iotSecuritySolutionData) { - return createOrUpdateWithResponse(resourceGroupName, solutionName, iotSecuritySolutionData, Context.NONE) - .getValue(); - } - - /** - * Use this method to update existing IoT Security solution tags or user defined resources. To update other fields - * use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param updateIotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String solutionName, UpdateIotSecuritySolutionData updateIotSecuritySolutionData) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (updateIotSecuritySolutionData == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter updateIotSecuritySolutionData is required and cannot be null.")); - } else { - updateIotSecuritySolutionData.validate(); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - updateIotSecuritySolutionData, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to update existing IoT Security solution tags or user defined resources. To update other fields - * use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param updateIotSecuritySolutionData The security solution data. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String solutionName, - UpdateIotSecuritySolutionData updateIotSecuritySolutionData, - 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - if (updateIotSecuritySolutionData == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter updateIotSecuritySolutionData is required and cannot be null.")); - } else { - updateIotSecuritySolutionData.validate(); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - updateIotSecuritySolutionData, - accept, - context); - } - - /** - * Use this method to update existing IoT Security solution tags or user defined resources. To update other fields - * use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param updateIotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String solutionName, UpdateIotSecuritySolutionData updateIotSecuritySolutionData) { - return updateWithResponseAsync(resourceGroupName, solutionName, updateIotSecuritySolutionData) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Use this method to update existing IoT Security solution tags or user defined resources. To update other fields - * use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param updateIotSecuritySolutionData The security solution data. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String solutionName, - UpdateIotSecuritySolutionData updateIotSecuritySolutionData, - Context context) { - return updateWithResponseAsync(resourceGroupName, solutionName, updateIotSecuritySolutionData, context).block(); - } - - /** - * Use this method to update existing IoT Security solution tags or user defined resources. To update other fields - * use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param updateIotSecuritySolutionData The security solution data. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 Security solution configuration and resource information. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public IoTSecuritySolutionModelInner update( - String resourceGroupName, String solutionName, UpdateIotSecuritySolutionData updateIotSecuritySolutionData) { - return updateWithResponse(resourceGroupName, solutionName, updateIotSecuritySolutionData, Context.NONE) - .getValue(); - } - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String solutionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String solutionName, 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 (solutionName == null) { - return Mono.error(new IllegalArgumentException("Parameter solutionName is required and cannot be null.")); - } - final String apiVersion = "2019-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - solutionName, - accept, - context); - } - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String solutionName) { - return deleteWithResponseAsync(resourceGroupName, solutionName).flatMap(ignored -> Mono.empty()); - } - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String solutionName, Context context) { - return deleteWithResponseAsync(resourceGroupName, solutionName, context).block(); - } - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @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 solutionName) { - deleteWithResponse(resourceGroupName, solutionName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsImpl.java deleted file mode 100644 index 157e75226a14..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/IotSecuritySolutionsImpl.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.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.IotSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; -import com.azure.resourcemanager.security.models.IotSecuritySolutions; - -public final class IotSecuritySolutionsImpl implements IotSecuritySolutions { - private static final ClientLogger LOGGER = new ClientLogger(IotSecuritySolutionsImpl.class); - - private final IotSecuritySolutionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public IotSecuritySolutionsImpl( - IotSecuritySolutionsClient 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 IoTSecuritySolutionModelImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return Utils.mapPage(inner, inner1 -> new IoTSecuritySolutionModelImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new IoTSecuritySolutionModelImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, filter, context); - return Utils.mapPage(inner, inner1 -> new IoTSecuritySolutionModelImpl(inner1, this.manager())); - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String solutionName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, solutionName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new IoTSecuritySolutionModelImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public IoTSecuritySolutionModel getByResourceGroup(String resourceGroupName, String solutionName) { - IoTSecuritySolutionModelInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, solutionName); - if (inner != null) { - return new IoTSecuritySolutionModelImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String solutionName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, solutionName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String solutionName) { - this.serviceClient().delete(resourceGroupName, solutionName); - } - - public IoTSecuritySolutionModel 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 solutionName = Utils.getValueFromIdByName(id, "iotSecuritySolutions"); - if (solutionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'iotSecuritySolutions'.", - id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, solutionName, 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 solutionName = Utils.getValueFromIdByName(id, "iotSecuritySolutions"); - if (solutionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'iotSecuritySolutions'.", - id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, solutionName, 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 solutionName = Utils.getValueFromIdByName(id, "iotSecuritySolutions"); - if (solutionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'iotSecuritySolutions'.", - id))); - } - this.deleteByResourceGroupWithResponse(resourceGroupName, solutionName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String solutionName = Utils.getValueFromIdByName(id, "iotSecuritySolutions"); - if (solutionName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'iotSecuritySolutions'.", - id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, solutionName, context); - } - - private IotSecuritySolutionsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public IoTSecuritySolutionModelImpl define(String name) { - return new IoTSecuritySolutionModelImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesClientImpl.java deleted file mode 100644 index 1a990d30535c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesClientImpl.java +++ /dev/null @@ -1,1957 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.JitNetworkAccessPoliciesClient; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPoliciesList; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in JitNetworkAccessPoliciesClient. */ -public final class JitNetworkAccessPoliciesClientImpl implements JitNetworkAccessPoliciesClient { - /** The proxy service used to perform REST calls. */ - private final JitNetworkAccessPoliciesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of JitNetworkAccessPoliciesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - JitNetworkAccessPoliciesClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create(JitNetworkAccessPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterJitNetworkAccessPolicies to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterJitNet") - public interface JitNetworkAccessPoliciesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByRegion( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupAndRegion( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("jitNetworkAccessPolicyName") String jitNetworkAccessPolicyName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("jitNetworkAccessPolicyName") String jitNetworkAccessPolicyName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") JitNetworkAccessPolicyInner body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("jitNetworkAccessPolicyName") String jitNetworkAccessPolicyName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType}") - @ExpectedResponses({202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> initiate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("jitNetworkAccessPolicyName") String jitNetworkAccessPolicyName, - @PathParam("jitNetworkAccessPolicyInitiateType") String jitNetworkAccessPolicyInitiateType, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") JitNetworkAccessPolicyInitiateRequest body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupAndRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRegionSinglePageAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRegionSinglePageAsync( - String ascLocation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByRegion( - this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByRegionAsync(String ascLocation) { - return new PagedFlux<>( - () -> listByRegionSinglePageAsync(ascLocation), nextLink -> listByRegionNextSinglePageAsync(nextLink)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>( - () -> listByRegionSinglePageAsync(ascLocation, context), - nextLink -> listByRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByRegion(String ascLocation) { - return new PagedIterable<>(listByRegionAsync(ascLocation)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByRegion(String ascLocation, Context context) { - return new PagedIterable<>(listByRegionAsync(ascLocation, context)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupAndRegionSinglePageAsync( - String resourceGroupName, String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroupAndRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupAndRegionSinglePageAsync( - String resourceGroupName, String ascLocation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupAndRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAndRegionAsync( - String resourceGroupName, String ascLocation) { - return new PagedFlux<>( - () -> listByResourceGroupAndRegionSinglePageAsync(resourceGroupName, ascLocation), - nextLink -> listByResourceGroupAndRegionNextSinglePageAsync(nextLink)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAndRegionAsync( - String resourceGroupName, String ascLocation, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupAndRegionSinglePageAsync(resourceGroupName, ascLocation, context), - nextLink -> listByResourceGroupAndRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroupAndRegion( - String resourceGroupName, String ascLocation) { - return new PagedIterable<>(listByResourceGroupAndRegionAsync(resourceGroupName, ascLocation)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroupAndRegion( - String resourceGroupName, String ascLocation, Context context) { - return new PagedIterable<>(listByResourceGroupAndRegionAsync(resourceGroupName, ascLocation, context)); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter jitNetworkAccessPolicyName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter jitNetworkAccessPolicyName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - apiVersion, - accept, - context); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { - return getWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context) { - return getWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context).block(); - } - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public JitNetworkAccessPolicyInner get( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { - return getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, Context.NONE).getValue(); - } - - /** - * Create a policy for protecting resources using Just-in-Time access control. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body 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 the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInner 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter jitNetworkAccessPolicyName 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-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - apiVersion, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create a policy for protecting resources using Just-in-Time access control. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body 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 the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInner 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter jitNetworkAccessPolicyName 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-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - apiVersion, - body, - accept, - context); - } - - /** - * Create a policy for protecting resources using Just-in-Time access control. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body 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 the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInner body) { - return createOrUpdateWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create a policy for protecting resources using Just-in-Time access control. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body 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 the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInner body, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, context) - .block(); - } - - /** - * Create a policy for protecting resources using Just-in-Time access control. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body 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 the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public JitNetworkAccessPolicyInner createOrUpdate( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInner body) { - return createOrUpdateWithResponse( - resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, Context.NONE) - .getValue(); - } - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter jitNetworkAccessPolicyName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter jitNetworkAccessPolicyName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - apiVersion, - accept, - context); - } - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { - return deleteWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context) { - return deleteWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context).block(); - } - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { - deleteWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, Context.NONE); - } - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body 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 the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> initiateWithResponseAsync( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter jitNetworkAccessPolicyName 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 jitNetworkAccessPolicyInitiateType = "initiate"; - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .initiate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - jitNetworkAccessPolicyInitiateType, - apiVersion, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body 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 the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> initiateWithResponseAsync( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest 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 (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (jitNetworkAccessPolicyName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter jitNetworkAccessPolicyName 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 jitNetworkAccessPolicyInitiateType = "initiate"; - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .initiate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - jitNetworkAccessPolicyName, - jitNetworkAccessPolicyInitiateType, - apiVersion, - body, - accept, - context); - } - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body 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 the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono initiateAsync( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest body) { - return initiateWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body 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 the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response initiateWithResponse( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest body, - Context context) { - return initiateWithResponseAsync(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, context) - .block(); - } - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body 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 the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public JitNetworkAccessRequestInner initiate( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest body) { - return initiateWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, Context.NONE) - .getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRegionNextSinglePageAsync(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.listByRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByRegionNextSinglePageAsync( - 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 - .listByRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupAndRegionNextSinglePageAsync( - 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.listByResourceGroupAndRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupAndRegionNextSinglePageAsync( - 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 - .listByResourceGroupAndRegionNext(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/JitNetworkAccessPoliciesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesImpl.java deleted file mode 100644 index b9d9dcc313b6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPoliciesImpl.java +++ /dev/null @@ -1,278 +0,0 @@ -// Copyright (c) Microsoft Corporation. All 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.JitNetworkAccessPoliciesClient; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicies; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequest; - -public final class JitNetworkAccessPoliciesImpl implements JitNetworkAccessPolicies { - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessPoliciesImpl.class); - - private final JitNetworkAccessPoliciesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public JitNetworkAccessPoliciesImpl( - JitNetworkAccessPoliciesClient 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 JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public PagedIterable listByRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listByRegion(ascLocation); - return Utils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public PagedIterable listByRegion(String ascLocation, Context context) { - PagedIterable inner = this.serviceClient().listByRegion(ascLocation, context); - return Utils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroupAndRegion( - String resourceGroupName, String ascLocation) { - PagedIterable inner = - this.serviceClient().listByResourceGroupAndRegion(resourceGroupName, ascLocation); - return Utils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroupAndRegion( - String resourceGroupName, String ascLocation, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroupAndRegion(resourceGroupName, ascLocation, context); - return Utils.mapPage(inner, inner1 -> new JitNetworkAccessPolicyImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new JitNetworkAccessPolicyImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public JitNetworkAccessPolicy get(String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { - JitNetworkAccessPolicyInner inner = - this.serviceClient().get(resourceGroupName, ascLocation, jitNetworkAccessPolicyName); - if (inner != null) { - return new JitNetworkAccessPolicyImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context) { - return this - .serviceClient() - .deleteWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context); - } - - public void delete(String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName) { - this.serviceClient().delete(resourceGroupName, ascLocation, jitNetworkAccessPolicyName); - } - - public Response initiateWithResponse( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest body, - Context context) { - Response inner = - this - .serviceClient() - .initiateWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new JitNetworkAccessRequestImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public JitNetworkAccessRequest initiate( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest body) { - JitNetworkAccessRequestInner inner = - this.serviceClient().initiate(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body); - if (inner != null) { - return new JitNetworkAccessRequestImpl(inner, this.manager()); - } else { - return null; - } - } - - public JitNetworkAccessPolicy 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 ascLocation = Utils.getValueFromIdByName(id, "locations"); - if (ascLocation == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); - } - String jitNetworkAccessPolicyName = Utils.getValueFromIdByName(id, "jitNetworkAccessPolicies"); - if (jitNetworkAccessPolicyName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'jitNetworkAccessPolicies'.", - id))); - } - return this - .getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, 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 ascLocation = Utils.getValueFromIdByName(id, "locations"); - if (ascLocation == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); - } - String jitNetworkAccessPolicyName = Utils.getValueFromIdByName(id, "jitNetworkAccessPolicies"); - if (jitNetworkAccessPolicyName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'jitNetworkAccessPolicies'.", - id))); - } - return this.getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, 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 ascLocation = Utils.getValueFromIdByName(id, "locations"); - if (ascLocation == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); - } - String jitNetworkAccessPolicyName = Utils.getValueFromIdByName(id, "jitNetworkAccessPolicies"); - if (jitNetworkAccessPolicyName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'jitNetworkAccessPolicies'.", - id))); - } - this.deleteWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String ascLocation = Utils.getValueFromIdByName(id, "locations"); - if (ascLocation == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'locations'.", id))); - } - String jitNetworkAccessPolicyName = Utils.getValueFromIdByName(id, "jitNetworkAccessPolicies"); - if (jitNetworkAccessPolicyName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'jitNetworkAccessPolicies'.", - id))); - } - return this.deleteWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context); - } - - private JitNetworkAccessPoliciesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public JitNetworkAccessPolicyImpl define(String name) { - return new JitNetworkAccessPolicyImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPolicyImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPolicyImpl.java deleted file mode 100644 index 570ed838040b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessPolicyImpl.java +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequest; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class JitNetworkAccessPolicyImpl - implements JitNetworkAccessPolicy, JitNetworkAccessPolicy.Definition, JitNetworkAccessPolicy.Update { - private JitNetworkAccessPolicyInner 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 kind() { - return this.innerModel().kind(); - } - - public String location() { - return this.innerModel().location(); - } - - public List virtualMachines() { - List inner = this.innerModel().virtualMachines(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List requests() { - List inner = this.innerModel().requests(); - if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new JitNetworkAccessRequestImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public String provisioningState() { - return this.innerModel().provisioningState(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public JitNetworkAccessPolicyInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String ascLocation; - - private String jitNetworkAccessPolicyName; - - public JitNetworkAccessPolicyImpl withExistingLocation(String resourceGroupName, String ascLocation) { - this.resourceGroupName = resourceGroupName; - this.ascLocation = ascLocation; - return this; - } - - public JitNetworkAccessPolicy create() { - this.innerObject = - serviceManager - .serviceClient() - .getJitNetworkAccessPolicies() - .createOrUpdateWithResponse( - resourceGroupName, ascLocation, jitNetworkAccessPolicyName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public JitNetworkAccessPolicy create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getJitNetworkAccessPolicies() - .createOrUpdateWithResponse( - resourceGroupName, ascLocation, jitNetworkAccessPolicyName, this.innerModel(), context) - .getValue(); - return this; - } - - JitNetworkAccessPolicyImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new JitNetworkAccessPolicyInner(); - this.serviceManager = serviceManager; - this.jitNetworkAccessPolicyName = name; - } - - public JitNetworkAccessPolicyImpl update() { - return this; - } - - public JitNetworkAccessPolicy apply() { - this.innerObject = - serviceManager - .serviceClient() - .getJitNetworkAccessPolicies() - .createOrUpdateWithResponse( - resourceGroupName, ascLocation, jitNetworkAccessPolicyName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public JitNetworkAccessPolicy apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getJitNetworkAccessPolicies() - .createOrUpdateWithResponse( - resourceGroupName, ascLocation, jitNetworkAccessPolicyName, this.innerModel(), context) - .getValue(); - return this; - } - - JitNetworkAccessPolicyImpl( - JitNetworkAccessPolicyInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.ascLocation = Utils.getValueFromIdByName(innerObject.id(), "locations"); - this.jitNetworkAccessPolicyName = Utils.getValueFromIdByName(innerObject.id(), "jitNetworkAccessPolicies"); - } - - public JitNetworkAccessPolicy refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getJitNetworkAccessPolicies() - .getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, Context.NONE) - .getValue(); - return this; - } - - public JitNetworkAccessPolicy refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getJitNetworkAccessPolicies() - .getWithResponse(resourceGroupName, ascLocation, jitNetworkAccessPolicyName, context) - .getValue(); - return this; - } - - public JitNetworkAccessPolicyImpl withVirtualMachines(List virtualMachines) { - this.innerModel().withVirtualMachines(virtualMachines); - return this; - } - - public JitNetworkAccessPolicyImpl withKind(String kind) { - this.innerModel().withKind(kind); - return this; - } - - public JitNetworkAccessPolicyImpl withRequests(List requests) { - this.innerModel().withRequests(requests); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessRequestImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessRequestImpl.java deleted file mode 100644 index 0cf244c2e8b9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/JitNetworkAccessRequestImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequest; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestVirtualMachine; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class JitNetworkAccessRequestImpl implements JitNetworkAccessRequest { - private JitNetworkAccessRequestInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - JitNetworkAccessRequestImpl( - JitNetworkAccessRequestInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List virtualMachines() { - List inner = this.innerModel().virtualMachines(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public OffsetDateTime startTimeUtc() { - return this.innerModel().startTimeUtc(); - } - - public String requestor() { - return this.innerModel().requestor(); - } - - public String justification() { - return this.innerModel().justification(); - } - - public JitNetworkAccessRequestInner 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/LocationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsClientImpl.java deleted file mode 100644 index 7cb672fbf87c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsClientImpl.java +++ /dev/null @@ -1,439 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.LocationsClient; -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; -import com.azure.resourcemanager.security.models.AscLocationList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in LocationsClient. */ -public final class LocationsClientImpl implements LocationsClient { - /** The proxy service used to perform REST calls. */ - private final LocationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of LocationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - LocationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(LocationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterLocations to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterLocati") - public interface LocationsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String ascLocation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), ascLocation, accept, context); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String ascLocation) { - return getWithResponseAsync(ascLocation).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String ascLocation, Context context) { - return getWithResponseAsync(ascLocation, context).block(); - } - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public AscLocationInner get(String ascLocation) { - return getWithResponse(ascLocation, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 locations where ASC saves your data along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 locations where ASC saves your data along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsImpl.java deleted file mode 100644 index d946db5d2e1a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/LocationsImpl.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.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.LocationsClient; -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; -import com.azure.resourcemanager.security.models.AscLocation; -import com.azure.resourcemanager.security.models.Locations; - -public final class LocationsImpl implements Locations { - private static final ClientLogger LOGGER = new ClientLogger(LocationsImpl.class); - - private final LocationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public LocationsImpl( - LocationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new AscLocationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new AscLocationImpl(inner1, this.manager())); - } - - public Response getWithResponse(String ascLocation, Context context) { - Response inner = this.serviceClient().getWithResponse(ascLocation, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new AscLocationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public AscLocation get(String ascLocation) { - AscLocationInner inner = this.serviceClient().get(ascLocation); - if (inner != null) { - return new AscLocationImpl(inner, this.manager()); - } else { - return null; - } - } - - private LocationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataImpl.java deleted file mode 100644 index fdf2e0b92f46..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; -import com.azure.resourcemanager.security.models.MdeOnboardingData; - -public final class MdeOnboardingDataImpl implements MdeOnboardingData { - private MdeOnboardingDataInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - MdeOnboardingDataImpl( - MdeOnboardingDataInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public byte[] onboardingPackageWindows() { - return this.innerModel().onboardingPackageWindows(); - } - - public byte[] onboardingPackageLinux() { - return this.innerModel().onboardingPackageLinux(); - } - - public MdeOnboardingDataInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataListImpl.java deleted file mode 100644 index a6a826ba3714..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingDataListImpl.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.MdeOnboardingDataInner; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; -import com.azure.resourcemanager.security.models.MdeOnboardingData; -import com.azure.resourcemanager.security.models.MdeOnboardingDataList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class MdeOnboardingDataListImpl implements MdeOnboardingDataList { - private MdeOnboardingDataListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - MdeOnboardingDataListImpl( - MdeOnboardingDataListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new MdeOnboardingDataImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public MdeOnboardingDataListInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsClientImpl.java deleted file mode 100644 index 1425b43ebbf4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsClientImpl.java +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.MdeOnboardingsClient; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in MdeOnboardingsClient. */ -public final class MdeOnboardingsClientImpl implements MdeOnboardingsClient { - /** The proxy service used to perform REST calls. */ - private final MdeOnboardingsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of MdeOnboardingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - MdeOnboardingsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(MdeOnboardingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterMdeOnboardings to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterMdeOnb") - public interface MdeOnboardingsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MdeOnboardingDataListInner list() { - return listWithResponse(Context.NONE).getValue(); - } - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-10-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-10-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync() { - return getWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(Context context) { - return getWithResponseAsync(context).block(); - } - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MdeOnboardingDataInner get() { - return getWithResponse(Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsImpl.java deleted file mode 100644 index 4a594ef5dc78..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/MdeOnboardingsImpl.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.MdeOnboardingsClient; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; -import com.azure.resourcemanager.security.models.MdeOnboardingData; -import com.azure.resourcemanager.security.models.MdeOnboardingDataList; -import com.azure.resourcemanager.security.models.MdeOnboardings; - -public final class MdeOnboardingsImpl implements MdeOnboardings { - private static final ClientLogger LOGGER = new ClientLogger(MdeOnboardingsImpl.class); - - private final MdeOnboardingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public MdeOnboardingsImpl( - MdeOnboardingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new MdeOnboardingDataListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public MdeOnboardingDataList list() { - MdeOnboardingDataListInner inner = this.serviceClient().list(); - if (inner != null) { - return new MdeOnboardingDataListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(Context context) { - Response inner = this.serviceClient().getWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new MdeOnboardingDataImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public MdeOnboardingData get() { - MdeOnboardingDataInner inner = this.serviceClient().get(); - if (inner != null) { - return new MdeOnboardingDataImpl(inner, this.manager()); - } else { - return null; - } - } - - private MdeOnboardingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationImpl.java deleted file mode 100644 index 9621ea680926..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationImpl.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.OperationInner; -import com.azure.resourcemanager.security.models.Operation; -import com.azure.resourcemanager.security.models.OperationDisplay; - -public final class OperationImpl implements Operation { - private OperationInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - OperationImpl(OperationInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public String origin() { - return this.innerModel().origin(); - } - - public OperationDisplay display() { - return this.innerModel().display(); - } - - public OperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultAutoGeneratedImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultAutoGeneratedImpl.java deleted file mode 100644 index dc4835d2f4bc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationResultAutoGeneratedImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; -import com.azure.resourcemanager.security.models.OperationResult; -import com.azure.resourcemanager.security.models.OperationResultAutoGenerated; - -public final class OperationResultAutoGeneratedImpl implements OperationResultAutoGenerated { - private OperationResultAutoGeneratedInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - OperationResultAutoGeneratedImpl( - OperationResultAutoGeneratedInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public OperationResult status() { - return this.innerModel().status(); - } - - public OperationResultAutoGeneratedInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java deleted file mode 100644 index df2c60d733e3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.OperationsClient; -import com.azure.resourcemanager.security.fluent.models.OperationInner; -import com.azure.resourcemanager.security.models.OperationList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterOperations to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterOperat") - public interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Security/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft.Security resource provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft.Security resource provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft.Security resource provider as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft.Security resource provider as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft.Security resource provider as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Exposes all available operations for discovery purposes. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft.Security resource provider as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 possible operations for Microsoft.Security resource provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 possible operations for Microsoft.Security resource provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsImpl.java deleted file mode 100644 index 4d0d7488ce5f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/OperationsImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.OperationsClient; -import com.azure.resourcemanager.security.fluent.models.OperationInner; -import com.azure.resourcemanager.security.models.Operation; -import com.azure.resourcemanager.security.models.Operations; - -public final class OperationsImpl implements Operations { - private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public OperationsImpl( - OperationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingImpl.java deleted file mode 100644 index 46e348a6d463..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingImpl.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.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.models.Extension; -import com.azure.resourcemanager.security.models.Pricing; -import com.azure.resourcemanager.security.models.PricingTier; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class PricingImpl implements Pricing { - private PricingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - PricingImpl(PricingInner 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 PricingTier pricingTier() { - return this.innerModel().pricingTier(); - } - - public String subPlan() { - return this.innerModel().subPlan(); - } - - public Duration freeTrialRemainingTime() { - return this.innerModel().freeTrialRemainingTime(); - } - - public OffsetDateTime enablementTime() { - return this.innerModel().enablementTime(); - } - - public Boolean deprecated() { - return this.innerModel().deprecated(); - } - - public List replacedBy() { - List inner = this.innerModel().replacedBy(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List extensions() { - List inner = this.innerModel().extensions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public PricingInner 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/PricingListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingListImpl.java deleted file mode 100644 index fce69ede7db3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingListImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.fluent.models.PricingListInner; -import com.azure.resourcemanager.security.models.Pricing; -import com.azure.resourcemanager.security.models.PricingList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class PricingListImpl implements PricingList { - private PricingListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - PricingListImpl(PricingListInner 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 PricingImpl(inner1, this.manager())).collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public PricingListInner 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/PricingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingsClientImpl.java deleted file mode 100644 index d1e7fb2693c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingsClientImpl.java +++ /dev/null @@ -1,462 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.PricingsClient; -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.fluent.models.PricingListInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in PricingsClient. */ -public final class PricingsClientImpl implements PricingsClient { - /** The proxy service used to perform REST calls. */ - private final PricingsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of PricingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - PricingsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(PricingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterPricings to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterPricin") - public interface PricingsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings") - @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/pricings/{pricingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @BodyParam("application/json") PricingInner pricing, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of pricing configurations response along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-01-01"; - 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())); - } - - /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of pricing configurations response along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context); - } - - /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of pricing configurations response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of pricing configurations response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of pricing configurations response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PricingListInner list() { - return listWithResponse(Context.NONE).getValue(); - } - - /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a provided Microsoft Defender for Cloud pricing configuration in the subscription along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String pricingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a provided Microsoft Defender for Cloud pricing configuration in the subscription along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String pricingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), pricingName, accept, context); - } - - /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a provided Microsoft Defender for Cloud pricing configuration in the subscription on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String pricingName) { - return getWithResponseAsync(pricingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a provided Microsoft Defender for Cloud pricing configuration in the subscription along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String pricingName, Context context) { - return getWithResponseAsync(pricingName, context).block(); - } - - /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a provided Microsoft Defender for Cloud pricing configuration in the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PricingInner get(String pricingName) { - return getWithResponse(pricingName, Context.NONE).getValue(); - } - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String pricingName, PricingInner pricing) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (pricing == null) { - return Mono.error(new IllegalArgumentException("Parameter pricing is required and cannot be null.")); - } else { - pricing.validate(); - } - final String apiVersion = "2023-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - pricing, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String pricingName, PricingInner pricing, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (pricing == null) { - return Mono.error(new IllegalArgumentException("Parameter pricing is required and cannot be null.")); - } else { - pricing.validate(); - } - final String apiVersion = "2023-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - pricing, - accept, - context); - } - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String pricingName, PricingInner pricing) { - return updateWithResponseAsync(pricingName, pricing).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String pricingName, PricingInner pricing, Context context) { - return updateWithResponseAsync(pricingName, pricing, context).block(); - } - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PricingInner update(String pricingName, PricingInner pricing) { - return updateWithResponse(pricingName, pricing, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingsImpl.java deleted file mode 100644 index 99ea26d48734..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/PricingsImpl.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.PricingsClient; -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.fluent.models.PricingListInner; -import com.azure.resourcemanager.security.models.Pricing; -import com.azure.resourcemanager.security.models.PricingList; -import com.azure.resourcemanager.security.models.Pricings; - -public final class PricingsImpl implements Pricings { - private static final ClientLogger LOGGER = new ClientLogger(PricingsImpl.class); - - private final PricingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public PricingsImpl(PricingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PricingListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public PricingList list() { - PricingListInner inner = this.serviceClient().list(); - if (inner != null) { - return new PricingListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse(String pricingName, Context context) { - Response inner = this.serviceClient().getWithResponse(pricingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PricingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Pricing get(String pricingName) { - PricingInner inner = this.serviceClient().get(pricingName); - if (inner != null) { - return new PricingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse(String pricingName, PricingInner pricing, Context context) { - Response inner = this.serviceClient().updateWithResponse(pricingName, pricing, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PricingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Pricing update(String pricingName, PricingInner pricing) { - PricingInner inner = this.serviceClient().update(pricingName, pricing); - if (inner != null) { - return new PricingImpl(inner, this.manager()); - } else { - return null; - } - } - - private PricingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentImpl.java deleted file mode 100644 index d83de36d26c9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessment; -import com.azure.resourcemanager.security.models.State; - -public final class RegulatoryComplianceAssessmentImpl implements RegulatoryComplianceAssessment { - private RegulatoryComplianceAssessmentInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - RegulatoryComplianceAssessmentImpl( - RegulatoryComplianceAssessmentInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String description() { - return this.innerModel().description(); - } - - public String assessmentType() { - return this.innerModel().assessmentType(); - } - - public String assessmentDetailsLink() { - return this.innerModel().assessmentDetailsLink(); - } - - public State state() { - return this.innerModel().state(); - } - - public Integer passedResources() { - return this.innerModel().passedResources(); - } - - public Integer failedResources() { - return this.innerModel().failedResources(); - } - - public Integer skippedResources() { - return this.innerModel().skippedResources(); - } - - public Integer unsupportedResources() { - return this.innerModel().unsupportedResources(); - } - - public RegulatoryComplianceAssessmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsClientImpl.java deleted file mode 100644 index 90b9f8738eda..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsClientImpl.java +++ /dev/null @@ -1,614 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessmentList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RegulatoryComplianceAssessmentsClient. */ -public final class RegulatoryComplianceAssessmentsClientImpl implements RegulatoryComplianceAssessmentsClient { - /** The proxy service used to perform REST calls. */ - private final RegulatoryComplianceAssessmentsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of RegulatoryComplianceAssessmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RegulatoryComplianceAssessmentsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - RegulatoryComplianceAssessmentsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterRegulatoryComplianceAssessments to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterRegula") - public interface RegulatoryComplianceAssessmentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @PathParam("regulatoryComplianceControlName") String regulatoryComplianceControlName, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @PathParam("regulatoryComplianceControlName") String regulatoryComplianceControlName, - @PathParam("regulatoryComplianceAssessmentName") String regulatoryComplianceAssessmentName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regulatoryComplianceStandardName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - regulatoryComplianceStandardName, - regulatoryComplianceControlName, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String filter, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regulatoryComplianceStandardName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - regulatoryComplianceStandardName, - regulatoryComplianceControlName, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String filter, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { - final String filter = null; - return new PagedIterable<>( - listAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter)); - } - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String filter, - Context context) { - return new PagedIterable<>( - listAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter, context)); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regulatoryComplianceStandardName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - if (regulatoryComplianceAssessmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceAssessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - regulatoryComplianceStandardName, - regulatoryComplianceControlName, - regulatoryComplianceAssessmentName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regulatoryComplianceStandardName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - if (regulatoryComplianceAssessmentName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceAssessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - regulatoryComplianceStandardName, - regulatoryComplianceControlName, - regulatoryComplianceAssessmentName, - accept, - context); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName) { - return getWithResponseAsync( - regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName, - Context context) { - return getWithResponseAsync( - regulatoryComplianceStandardName, - regulatoryComplianceControlName, - regulatoryComplianceAssessmentName, - context) - .block(); - } - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegulatoryComplianceAssessmentInner get( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName) { - return getWithResponse( - regulatoryComplianceStandardName, - regulatoryComplianceControlName, - regulatoryComplianceAssessmentName, - Context.NONE) - .getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 regulatory compliance assessment response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 regulatory compliance assessment response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsImpl.java deleted file mode 100644 index 222a4ee49b8b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceAssessmentsImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessment; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessments; - -public final class RegulatoryComplianceAssessmentsImpl implements RegulatoryComplianceAssessments { - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceAssessmentsImpl.class); - - private final RegulatoryComplianceAssessmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public RegulatoryComplianceAssessmentsImpl( - RegulatoryComplianceAssessmentsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { - PagedIterable inner = - this.serviceClient().list(regulatoryComplianceStandardName, regulatoryComplianceControlName); - return Utils.mapPage(inner, inner1 -> new RegulatoryComplianceAssessmentImpl(inner1, this.manager())); - } - - public PagedIterable list( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String filter, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list(regulatoryComplianceStandardName, regulatoryComplianceControlName, filter, context); - return Utils.mapPage(inner, inner1 -> new RegulatoryComplianceAssessmentImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName, - Context context) { - Response inner = - this - .serviceClient() - .getWithResponse( - regulatoryComplianceStandardName, - regulatoryComplianceControlName, - regulatoryComplianceAssessmentName, - context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new RegulatoryComplianceAssessmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RegulatoryComplianceAssessment get( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName) { - RegulatoryComplianceAssessmentInner inner = - this - .serviceClient() - .get( - regulatoryComplianceStandardName, - regulatoryComplianceControlName, - regulatoryComplianceAssessmentName); - if (inner != null) { - return new RegulatoryComplianceAssessmentImpl(inner, this.manager()); - } else { - return null; - } - } - - private RegulatoryComplianceAssessmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlImpl.java deleted file mode 100644 index b51b1ed37d11..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControl; -import com.azure.resourcemanager.security.models.State; - -public final class RegulatoryComplianceControlImpl implements RegulatoryComplianceControl { - private RegulatoryComplianceControlInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - RegulatoryComplianceControlImpl( - RegulatoryComplianceControlInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String description() { - return this.innerModel().description(); - } - - public State state() { - return this.innerModel().state(); - } - - public Integer passedAssessments() { - return this.innerModel().passedAssessments(); - } - - public Integer failedAssessments() { - return this.innerModel().failedAssessments(); - } - - public Integer skippedAssessments() { - return this.innerModel().skippedAssessments(); - } - - public RegulatoryComplianceControlInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsClientImpl.java deleted file mode 100644 index a1bf42ba21da..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsClientImpl.java +++ /dev/null @@ -1,534 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceControlsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControlList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RegulatoryComplianceControlsClient. */ -public final class RegulatoryComplianceControlsClientImpl implements RegulatoryComplianceControlsClient { - /** The proxy service used to perform REST calls. */ - private final RegulatoryComplianceControlsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of RegulatoryComplianceControlsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RegulatoryComplianceControlsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - RegulatoryComplianceControlsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterRegulatoryComplianceControls to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterRegula") - public interface RegulatoryComplianceControlsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @PathParam("regulatoryComplianceControlName") String regulatoryComplianceControlName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String regulatoryComplianceStandardName, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regulatoryComplianceStandardName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - regulatoryComplianceStandardName, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String regulatoryComplianceStandardName, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regulatoryComplianceStandardName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - regulatoryComplianceStandardName, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String regulatoryComplianceStandardName, String filter) { - return new PagedFlux<>( - () -> listSinglePageAsync(regulatoryComplianceStandardName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String regulatoryComplianceStandardName) { - final String filter = null; - return new PagedFlux<>( - () -> listSinglePageAsync(regulatoryComplianceStandardName, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String regulatoryComplianceStandardName, String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(regulatoryComplianceStandardName, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String regulatoryComplianceStandardName) { - final String filter = null; - return new PagedIterable<>(listAsync(regulatoryComplianceStandardName, filter)); - } - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String regulatoryComplianceStandardName, String filter, Context context) { - return new PagedIterable<>(listAsync(regulatoryComplianceStandardName, filter, context)); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regulatoryComplianceStandardName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - regulatoryComplianceStandardName, - regulatoryComplianceControlName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regulatoryComplianceStandardName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - if (regulatoryComplianceControlName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceControlName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - regulatoryComplianceStandardName, - regulatoryComplianceControlName, - accept, - context); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { - return getWithResponseAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, Context context) { - return getWithResponseAsync(regulatoryComplianceStandardName, regulatoryComplianceControlName, context).block(); - } - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegulatoryComplianceControlInner get( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { - return getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, Context.NONE) - .getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 regulatory compliance controls response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 regulatory compliance controls response along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsImpl.java deleted file mode 100644 index 31f2bb559139..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceControlsImpl.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.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceControlsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControl; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControls; - -public final class RegulatoryComplianceControlsImpl implements RegulatoryComplianceControls { - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceControlsImpl.class); - - private final RegulatoryComplianceControlsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public RegulatoryComplianceControlsImpl( - RegulatoryComplianceControlsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String regulatoryComplianceStandardName) { - PagedIterable inner = - this.serviceClient().list(regulatoryComplianceStandardName); - return Utils.mapPage(inner, inner1 -> new RegulatoryComplianceControlImpl(inner1, this.manager())); - } - - public PagedIterable list( - String regulatoryComplianceStandardName, String filter, Context context) { - PagedIterable inner = - this.serviceClient().list(regulatoryComplianceStandardName, filter, context); - return Utils.mapPage(inner, inner1 -> new RegulatoryComplianceControlImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(regulatoryComplianceStandardName, regulatoryComplianceControlName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new RegulatoryComplianceControlImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RegulatoryComplianceControl get( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName) { - RegulatoryComplianceControlInner inner = - this.serviceClient().get(regulatoryComplianceStandardName, regulatoryComplianceControlName); - if (inner != null) { - return new RegulatoryComplianceControlImpl(inner, this.manager()); - } else { - return null; - } - } - - private RegulatoryComplianceControlsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardImpl.java deleted file mode 100644 index 19762eafd251..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandard; -import com.azure.resourcemanager.security.models.State; - -public final class RegulatoryComplianceStandardImpl implements RegulatoryComplianceStandard { - private RegulatoryComplianceStandardInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - RegulatoryComplianceStandardImpl( - RegulatoryComplianceStandardInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public State state() { - return this.innerModel().state(); - } - - public Integer passedControls() { - return this.innerModel().passedControls(); - } - - public Integer failedControls() { - return this.innerModel().failedControls(); - } - - public Integer skippedControls() { - return this.innerModel().skippedControls(); - } - - public Integer unsupportedControls() { - return this.innerModel().unsupportedControls(); - } - - public RegulatoryComplianceStandardInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsClientImpl.java deleted file mode 100644 index 9c58140377cb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsClientImpl.java +++ /dev/null @@ -1,471 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceStandardsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandardList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in RegulatoryComplianceStandardsClient. */ -public final class RegulatoryComplianceStandardsClientImpl implements RegulatoryComplianceStandardsClient { - /** The proxy service used to perform REST calls. */ - private final RegulatoryComplianceStandardsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of RegulatoryComplianceStandardsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - RegulatoryComplianceStandardsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - RegulatoryComplianceStandardsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterRegulatoryComplianceStandards to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterRegula") - public interface RegulatoryComplianceStandardsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("regulatoryComplianceStandardName") String regulatoryComplianceStandardName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regulatoryComplianceStandardName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - regulatoryComplianceStandardName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String regulatoryComplianceStandardName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (regulatoryComplianceStandardName == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter regulatoryComplianceStandardName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - regulatoryComplianceStandardName, - accept, - context); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String regulatoryComplianceStandardName) { - return getWithResponseAsync(regulatoryComplianceStandardName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String regulatoryComplianceStandardName, Context context) { - return getWithResponseAsync(regulatoryComplianceStandardName, context).block(); - } - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RegulatoryComplianceStandardInner get(String regulatoryComplianceStandardName) { - return getWithResponse(regulatoryComplianceStandardName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 regulatory compliance standards response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 regulatory compliance standards response along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsImpl.java deleted file mode 100644 index 8f57bbcd3d41..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RegulatoryComplianceStandardsImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceStandardsClient; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandard; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandards; - -public final class RegulatoryComplianceStandardsImpl implements RegulatoryComplianceStandards { - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceStandardsImpl.class); - - private final RegulatoryComplianceStandardsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public RegulatoryComplianceStandardsImpl( - RegulatoryComplianceStandardsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new RegulatoryComplianceStandardImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return Utils.mapPage(inner, inner1 -> new RegulatoryComplianceStandardImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String regulatoryComplianceStandardName, Context context) { - Response inner = - this.serviceClient().getWithResponse(regulatoryComplianceStandardName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new RegulatoryComplianceStandardImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RegulatoryComplianceStandard get(String regulatoryComplianceStandardName) { - RegulatoryComplianceStandardInner inner = this.serviceClient().get(regulatoryComplianceStandardName); - if (inner != null) { - return new RegulatoryComplianceStandardImpl(inner, this.manager()); - } else { - return null; - } - } - - private RegulatoryComplianceStandardsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RuleResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RuleResultsImpl.java deleted file mode 100644 index 82aeae996a3c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RuleResultsImpl.java +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.models.RuleResults; -import com.azure.resourcemanager.security.models.RuleResultsInput; -import com.azure.resourcemanager.security.models.RuleResultsProperties; -import java.util.List; - -public final class RuleResultsImpl implements RuleResults, RuleResults.Definition, RuleResults.Update { - private RuleResultsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public RuleResultsProperties properties() { - return this.innerModel().properties(); - } - - public RuleResultsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String ruleId; - - private String resourceId; - - private String createWorkspaceId; - - private RuleResultsInput createBody; - - private String updateWorkspaceId; - - private RuleResultsInput updateBody; - - public RuleResultsImpl withExistingResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - public RuleResults create() { - this.innerObject = - serviceManager - .serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(ruleId, createWorkspaceId, resourceId, createBody, Context.NONE) - .getValue(); - return this; - } - - public RuleResults create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(ruleId, createWorkspaceId, resourceId, createBody, context) - .getValue(); - return this; - } - - RuleResultsImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new RuleResultsInner(); - this.serviceManager = serviceManager; - this.ruleId = name; - this.createWorkspaceId = null; - this.createBody = new RuleResultsInput(); - } - - public RuleResultsImpl update() { - this.updateWorkspaceId = null; - this.updateBody = new RuleResultsInput(); - return this; - } - - public RuleResults apply() { - this.innerObject = - serviceManager - .serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(ruleId, updateWorkspaceId, resourceId, updateBody, Context.NONE) - .getValue(); - return this; - } - - public RuleResults apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSqlVulnerabilityAssessmentBaselineRules() - .createOrUpdateWithResponse(ruleId, updateWorkspaceId, resourceId, updateBody, context) - .getValue(); - return this; - } - - RuleResultsImpl(RuleResultsInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.ruleId = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "ruleId"); - this.resourceId = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", - "resourceId"); - } - - public RuleResultsImpl withLatestScan(Boolean latestScan) { - if (isInCreateMode()) { - this.createBody.withLatestScan(latestScan); - return this; - } else { - this.updateBody.withLatestScan(latestScan); - return this; - } - } - - public RuleResultsImpl withResults(List> results) { - if (isInCreateMode()) { - this.createBody.withResults(results); - return this; - } else { - this.updateBody.withResults(results); - return this; - } - } - - public RuleResultsImpl withWorkspaceId(String workspaceId) { - if (isInCreateMode()) { - this.createWorkspaceId = workspaceId; - return this; - } else { - this.updateWorkspaceId = workspaceId; - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RulesResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RulesResultsImpl.java deleted file mode 100644 index d048424ac5cb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/RulesResultsImpl.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.RuleResultsInner; -import com.azure.resourcemanager.security.fluent.models.RulesResultsInner; -import com.azure.resourcemanager.security.models.RuleResults; -import com.azure.resourcemanager.security.models.RulesResults; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class RulesResultsImpl implements RulesResults { - private RulesResultsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - RulesResultsImpl(RulesResultsInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new RuleResultsImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public RulesResultsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanImpl.java deleted file mode 100644 index d9478f1ddc00..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ScanInner; -import com.azure.resourcemanager.security.models.Scan; -import com.azure.resourcemanager.security.models.ScanProperties; - -public final class ScanImpl implements Scan { - private ScanInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ScanImpl(ScanInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ScanProperties properties() { - return this.innerModel().properties(); - } - - public ScanInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultImpl.java deleted file mode 100644 index cfda06c821fe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.models.ScanResult; -import com.azure.resourcemanager.security.models.ScanResultProperties; - -public final class ScanResultImpl implements ScanResult { - private ScanResultInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ScanResultImpl(ScanResultInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public ScanResultProperties properties() { - return this.innerModel().properties(); - } - - public ScanResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultsImpl.java deleted file mode 100644 index 0380f7db5b05..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScanResultsImpl.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.ScanResultInner; -import com.azure.resourcemanager.security.fluent.models.ScanResultsInner; -import com.azure.resourcemanager.security.models.ScanResult; -import com.azure.resourcemanager.security.models.ScanResults; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class ScanResultsImpl implements ScanResults { - private ScanResultsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ScanResultsImpl(ScanResultsInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new ScanResultImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public ScanResultsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScansImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScansImpl.java deleted file mode 100644 index 0b79bb6484c4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ScansImpl.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ScanInner; -import com.azure.resourcemanager.security.fluent.models.ScansInner; -import com.azure.resourcemanager.security.models.Scan; -import com.azure.resourcemanager.security.models.Scans; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class ScansImpl implements Scans { - private ScansInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ScansImpl(ScansInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections - .unmodifiableList( - inner.stream().map(inner1 -> new ScanImpl(inner1, this.manager())).collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public ScansInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionItemImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionItemImpl.java deleted file mode 100644 index 0e0464933445..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionItemImpl.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.azure.resourcemanager.security.models.AzureResourceLink; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionItem; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionSource; -import java.util.Collections; -import java.util.List; - -public final class SecureScoreControlDefinitionItemImpl implements SecureScoreControlDefinitionItem { - private SecureScoreControlDefinitionItemInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecureScoreControlDefinitionItemImpl( - SecureScoreControlDefinitionItemInner 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 description() { - return this.innerModel().description(); - } - - public Integer maxScore() { - return this.innerModel().maxScore(); - } - - public SecureScoreControlDefinitionSource source() { - return this.innerModel().source(); - } - - public List assessmentDefinitions() { - List inner = this.innerModel().assessmentDefinitions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public SecureScoreControlDefinitionItemInner 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/SecureScoreControlDefinitionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionsClientImpl.java deleted file mode 100644 index 8ed2fc1ff10f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionsClientImpl.java +++ /dev/null @@ -1,515 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecureScoreControlDefinitionsClient; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SecureScoreControlDefinitionsClient. */ -public final class SecureScoreControlDefinitionsClientImpl implements SecureScoreControlDefinitionsClient { - /** The proxy service used to perform REST calls. */ - private final SecureScoreControlDefinitionsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecureScoreControlDefinitionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecureScoreControlDefinitionsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - SecureScoreControlDefinitionsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecureScoreControlDefinitions to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecure") - public interface SecureScoreControlDefinitionsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Security/secureScoreControlDefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscription( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @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); - } - - /** - * List the available security controls, their assessments, and the max score. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List the available security controls, their assessments, and the max score. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List the available security controls, their assessments, and the max score. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listBySubscription( - 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())); - } - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionSinglePageAsync( - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscription(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)); - } - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionAsync() { - return new PagedFlux<>( - () -> listBySubscriptionSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySubscriptionAsync(Context context) { - return new PagedFlux<>( - () -> listBySubscriptionSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscription() { - return new PagedIterable<>(listBySubscriptionAsync()); - } - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySubscription(Context context) { - return new PagedIterable<>(listBySubscriptionAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionsImpl.java deleted file mode 100644 index 6e0346a7e536..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDefinitionsImpl.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.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecureScoreControlDefinitionsClient; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionItem; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitions; - -public final class SecureScoreControlDefinitionsImpl implements SecureScoreControlDefinitions { - private static final ClientLogger LOGGER = new ClientLogger(SecureScoreControlDefinitionsImpl.class); - - private final SecureScoreControlDefinitionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecureScoreControlDefinitionsImpl( - SecureScoreControlDefinitionsClient 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 SecureScoreControlDefinitionItemImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); - } - - public PagedIterable listBySubscription() { - PagedIterable inner = this.serviceClient().listBySubscription(); - return Utils.mapPage(inner, inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); - } - - public PagedIterable listBySubscription(Context context) { - PagedIterable inner = this.serviceClient().listBySubscription(context); - return Utils.mapPage(inner, inner1 -> new SecureScoreControlDefinitionItemImpl(inner1, this.manager())); - } - - private SecureScoreControlDefinitionsClient 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/SecureScoreControlDetailsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDetailsImpl.java deleted file mode 100644 index 98ebfdf2afba..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlDetailsImpl.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.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDetailsInner; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionItem; -import com.azure.resourcemanager.security.models.SecureScoreControlDetails; - -public final class SecureScoreControlDetailsImpl implements SecureScoreControlDetails { - private SecureScoreControlDetailsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecureScoreControlDetailsImpl( - SecureScoreControlDetailsInner 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 Integer healthyResourceCount() { - return this.innerModel().healthyResourceCount(); - } - - public Integer unhealthyResourceCount() { - return this.innerModel().unhealthyResourceCount(); - } - - public Integer notApplicableResourceCount() { - return this.innerModel().notApplicableResourceCount(); - } - - public Long weight() { - return this.innerModel().weight(); - } - - public SecureScoreControlDefinitionItem definition() { - SecureScoreControlDefinitionItemInner inner = this.innerModel().definition(); - if (inner != null) { - return new SecureScoreControlDefinitionItemImpl(inner, this.manager()); - } else { - return null; - } - } - - public Integer max() { - return this.innerModel().max(); - } - - public Double current() { - return this.innerModel().current(); - } - - public Double percentage() { - return this.innerModel().percentage(); - } - - public SecureScoreControlDetailsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlScoreDetailsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlScoreDetailsImpl.java deleted file mode 100644 index d3a1b368b1f6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlScoreDetailsImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlScoreDetailsInner; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionItem; -import com.azure.resourcemanager.security.models.SecureScoreControlScoreDetails; - -public final class SecureScoreControlScoreDetailsImpl implements SecureScoreControlScoreDetails { - private SecureScoreControlScoreDetailsInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecureScoreControlScoreDetailsImpl( - SecureScoreControlScoreDetailsInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public Integer healthyResourceCount() { - return this.innerModel().healthyResourceCount(); - } - - public Integer unhealthyResourceCount() { - return this.innerModel().unhealthyResourceCount(); - } - - public Integer notApplicableResourceCount() { - return this.innerModel().notApplicableResourceCount(); - } - - public Long weight() { - return this.innerModel().weight(); - } - - public SecureScoreControlDefinitionItem definition() { - SecureScoreControlDefinitionItemInner inner = this.innerModel().definition(); - if (inner != null) { - return new SecureScoreControlDefinitionItemImpl(inner, this.manager()); - } else { - return null; - } - } - - public Integer max() { - return this.innerModel().max(); - } - - public Double current() { - return this.innerModel().current(); - } - - public Double percentage() { - return this.innerModel().percentage(); - } - - public SecureScoreControlScoreDetailsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlsClientImpl.java deleted file mode 100644 index 198a22b386af..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlsClientImpl.java +++ /dev/null @@ -1,624 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecureScoreControlsClient; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDetailsInner; -import com.azure.resourcemanager.security.models.ExpandControlsEnum; -import com.azure.resourcemanager.security.models.SecureScoreControlList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SecureScoreControlsClient. */ -public final class SecureScoreControlsClientImpl implements SecureScoreControlsClient { - /** The proxy service used to perform REST calls. */ - private final SecureScoreControlsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecureScoreControlsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecureScoreControlsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(SecureScoreControlsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecureScoreControls to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecure") - public interface SecureScoreControlsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySecureScore( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("secureScoreName") String secureScoreName, - @QueryParam("$expand") ExpandControlsEnum expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$expand") ExpandControlsEnum expand, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySecureScoreNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param expand OData expand. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls for a specific initiative within a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySecureScoreSinglePageAsync( - String secureScoreName, ExpandControlsEnum expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (secureScoreName == null) { - return Mono - .error(new IllegalArgumentException("Parameter secureScoreName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listBySecureScore( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - secureScoreName, - expand, - 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 all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls for a specific initiative within a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySecureScoreSinglePageAsync( - String secureScoreName, ExpandControlsEnum expand, 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 (secureScoreName == null) { - return Mono - .error(new IllegalArgumentException("Parameter secureScoreName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySecureScore( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - secureScoreName, - expand, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param expand OData expand. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls for a specific initiative within a scope as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySecureScoreAsync( - String secureScoreName, ExpandControlsEnum expand) { - return new PagedFlux<>( - () -> listBySecureScoreSinglePageAsync(secureScoreName, expand), - nextLink -> listBySecureScoreNextSinglePageAsync(nextLink)); - } - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls for a specific initiative within a scope as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySecureScoreAsync(String secureScoreName) { - final ExpandControlsEnum expand = null; - return new PagedFlux<>( - () -> listBySecureScoreSinglePageAsync(secureScoreName, expand), - nextLink -> listBySecureScoreNextSinglePageAsync(nextLink)); - } - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls for a specific initiative within a scope as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listBySecureScoreAsync( - String secureScoreName, ExpandControlsEnum expand, Context context) { - return new PagedFlux<>( - () -> listBySecureScoreSinglePageAsync(secureScoreName, expand, context), - nextLink -> listBySecureScoreNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls for a specific initiative within a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySecureScore(String secureScoreName) { - final ExpandControlsEnum expand = null; - return new PagedIterable<>(listBySecureScoreAsync(secureScoreName, expand)); - } - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls for a specific initiative within a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listBySecureScore( - String secureScoreName, ExpandControlsEnum expand, Context context) { - return new PagedIterable<>(listBySecureScoreAsync(secureScoreName, expand, context)); - } - - /** - * Get all security controls within a scope. - * - * @param expand OData expand. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls within a scope along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(ExpandControlsEnum expand) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - expand, - 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 all security controls within a scope. - * - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls within a scope along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - ExpandControlsEnum expand, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), expand, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get all security controls within a scope. - * - * @param expand OData expand. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls within a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(ExpandControlsEnum expand) { - return new PagedFlux<>(() -> listSinglePageAsync(expand), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all security controls within a scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls within a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final ExpandControlsEnum expand = null; - return new PagedFlux<>(() -> listSinglePageAsync(expand), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get all security controls within a scope. - * - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls within a scope as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(ExpandControlsEnum expand, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(expand, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get all security controls within a scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls within a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final ExpandControlsEnum expand = null; - return new PagedIterable<>(listAsync(expand)); - } - - /** - * Get all security controls within a scope. - * - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls within a scope as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(ExpandControlsEnum expand, Context context) { - return new PagedIterable<>(listAsync(expand, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySecureScoreNextSinglePageAsync(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.listBySecureScoreNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySecureScoreNextSinglePageAsync( - 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 - .listBySecureScoreNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlsImpl.java deleted file mode 100644 index ddce15948c30..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreControlsImpl.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.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecureScoreControlsClient; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDetailsInner; -import com.azure.resourcemanager.security.models.ExpandControlsEnum; -import com.azure.resourcemanager.security.models.SecureScoreControlDetails; -import com.azure.resourcemanager.security.models.SecureScoreControls; - -public final class SecureScoreControlsImpl implements SecureScoreControls { - private static final ClientLogger LOGGER = new ClientLogger(SecureScoreControlsImpl.class); - - private final SecureScoreControlsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecureScoreControlsImpl( - SecureScoreControlsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listBySecureScore(String secureScoreName) { - PagedIterable inner = this.serviceClient().listBySecureScore(secureScoreName); - return Utils.mapPage(inner, inner1 -> new SecureScoreControlDetailsImpl(inner1, this.manager())); - } - - public PagedIterable listBySecureScore( - String secureScoreName, ExpandControlsEnum expand, Context context) { - PagedIterable inner = - this.serviceClient().listBySecureScore(secureScoreName, expand, context); - return Utils.mapPage(inner, inner1 -> new SecureScoreControlDetailsImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SecureScoreControlDetailsImpl(inner1, this.manager())); - } - - public PagedIterable list(ExpandControlsEnum expand, Context context) { - PagedIterable inner = this.serviceClient().list(expand, context); - return Utils.mapPage(inner, inner1 -> new SecureScoreControlDetailsImpl(inner1, this.manager())); - } - - private SecureScoreControlsClient 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/SecureScoreItemImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreItemImpl.java deleted file mode 100644 index b7b5a90f0ae9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoreItemImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.SecureScoreItemInner; -import com.azure.resourcemanager.security.models.SecureScoreItem; - -public final class SecureScoreItemImpl implements SecureScoreItem { - private SecureScoreItemInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecureScoreItemImpl( - SecureScoreItemInner 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 Long weight() { - return this.innerModel().weight(); - } - - public Integer max() { - return this.innerModel().max(); - } - - public Double current() { - return this.innerModel().current(); - } - - public Double percentage() { - return this.innerModel().percentage(); - } - - public SecureScoreItemInner 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/SecureScoresClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoresClientImpl.java deleted file mode 100644 index 91d2496b7feb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoresClientImpl.java +++ /dev/null @@ -1,438 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecureScoresClient; -import com.azure.resourcemanager.security.fluent.models.SecureScoreItemInner; -import com.azure.resourcemanager.security.models.SecureScoresList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SecureScoresClient. */ -public final class SecureScoresClientImpl implements SecureScoresClient { - /** The proxy service used to perform REST calls. */ - private final SecureScoresService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecureScoresClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecureScoresClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(SecureScoresService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecureScores to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecure") - public interface SecureScoresService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores") - @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/secureScores/{secureScoreName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("secureScoreName") String secureScoreName, - @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 secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - 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 secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - 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 secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String secureScoreName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (secureScoreName == null) { - return Mono - .error(new IllegalArgumentException("Parameter secureScoreName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - secureScoreName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String secureScoreName, 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 (secureScoreName == null) { - return Mono - .error(new IllegalArgumentException("Parameter secureScoreName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - secureScoreName, - accept, - context); - } - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String secureScoreName) { - return getWithResponseAsync(secureScoreName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String secureScoreName, Context context) { - return getWithResponseAsync(secureScoreName, context).block(); - } - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecureScoreItemInner get(String secureScoreName) { - return getWithResponse(secureScoreName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoresImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoresImpl.java deleted file mode 100644 index 2f6dbe759c03..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecureScoresImpl.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.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.SecureScoresClient; -import com.azure.resourcemanager.security.fluent.models.SecureScoreItemInner; -import com.azure.resourcemanager.security.models.SecureScoreItem; -import com.azure.resourcemanager.security.models.SecureScores; - -public final class SecureScoresImpl implements SecureScores { - private static final ClientLogger LOGGER = new ClientLogger(SecureScoresImpl.class); - - private final SecureScoresClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecureScoresImpl( - SecureScoresClient 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 SecureScoreItemImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SecureScoreItemImpl(inner1, this.manager())); - } - - public Response getWithResponse(String secureScoreName, Context context) { - Response inner = this.serviceClient().getWithResponse(secureScoreName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecureScoreItemImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecureScoreItem get(String secureScoreName) { - SecureScoreItemInner inner = this.serviceClient().get(secureScoreName); - if (inner != null) { - return new SecureScoreItemImpl(inner, this.manager()); - } else { - return null; - } - } - - private SecureScoresClient 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/SecurityAssessmentMetadataResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataResponseImpl.java deleted file mode 100644 index 7455b39d5a29..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentMetadataResponseImpl.java +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) Microsoft Corporation. All 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.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.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 SecurityAssessmentMetadataResponseImpl - implements SecurityAssessmentMetadataResponse, SecurityAssessmentMetadataResponse.Definition { - private SecurityAssessmentMetadataResponseInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecurityAssessmentMetadataResponseImpl( - SecurityAssessmentMetadataResponseInner 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 SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() { - return this.innerModel().publishDates(); - } - - public String plannedDeprecationDate() { - return this.innerModel().plannedDeprecationDate(); - } - - public List tactics() { - List inner = this.innerModel().tactics(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List techniques() { - List inner = this.innerModel().techniques(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String policyDefinitionId() { - return this.innerModel().policyDefinitionId(); - } - - public String description() { - return this.innerModel().description(); - } - - public String remediationDescription() { - return this.innerModel().remediationDescription(); - } - - public List categories() { - List inner = this.innerModel().categories(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Severity severity() { - return this.innerModel().severity(); - } - - public UserImpact userImpact() { - return this.innerModel().userImpact(); - } - - public ImplementationEffort implementationEffort() { - return this.innerModel().implementationEffort(); - } - - public List threats() { - List inner = this.innerModel().threats(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Boolean preview() { - return this.innerModel().preview(); - } - - public AssessmentType assessmentType() { - return this.innerModel().assessmentType(); - } - - public SecurityAssessmentMetadataPartnerData partnerData() { - return this.innerModel().partnerData(); - } - - public SecurityAssessmentMetadataResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String assessmentMetadataName; - - public SecurityAssessmentMetadataResponse create() { - this.innerObject = - serviceManager - .serviceClient() - .getAssessmentsMetadatas() - .createInSubscriptionWithResponse(assessmentMetadataName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public SecurityAssessmentMetadataResponse create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAssessmentsMetadatas() - .createInSubscriptionWithResponse(assessmentMetadataName, this.innerModel(), context) - .getValue(); - return this; - } - - SecurityAssessmentMetadataResponseImpl( - String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new SecurityAssessmentMetadataResponseInner(); - this.serviceManager = serviceManager; - this.assessmentMetadataName = name; - } - - public SecurityAssessmentMetadataResponse refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getAssessmentsMetadatas() - .getInSubscriptionWithResponse(assessmentMetadataName, Context.NONE) - .getValue(); - return this; - } - - public SecurityAssessmentMetadataResponse refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAssessmentsMetadatas() - .getInSubscriptionWithResponse(assessmentMetadataName, context) - .getValue(); - 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; - } - - public SecurityAssessmentMetadataResponseImpl withDisplayName(String displayName) { - this.innerModel().withDisplayName(displayName); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withDescription(String description) { - this.innerModel().withDescription(description); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withRemediationDescription(String remediationDescription) { - this.innerModel().withRemediationDescription(remediationDescription); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withCategories(List categories) { - this.innerModel().withCategories(categories); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withSeverity(Severity severity) { - this.innerModel().withSeverity(severity); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withUserImpact(UserImpact userImpact) { - this.innerModel().withUserImpact(userImpact); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withImplementationEffort(ImplementationEffort implementationEffort) { - this.innerModel().withImplementationEffort(implementationEffort); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withThreats(List threats) { - this.innerModel().withThreats(threats); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withPreview(Boolean preview) { - this.innerModel().withPreview(preview); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withAssessmentType(AssessmentType assessmentType) { - this.innerModel().withAssessmentType(assessmentType); - return this; - } - - public SecurityAssessmentMetadataResponseImpl withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) { - this.innerModel().withPartnerData(partnerData); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentResponseImpl.java deleted file mode 100644 index b589cb09daae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityAssessmentResponseImpl.java +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataProperties; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; -import com.azure.resourcemanager.security.models.AssessmentLinks; -import com.azure.resourcemanager.security.models.AssessmentStatus; -import com.azure.resourcemanager.security.models.AssessmentStatusResponse; -import com.azure.resourcemanager.security.models.ExpandEnum; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SecurityAssessment; -import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData; -import com.azure.resourcemanager.security.models.SecurityAssessmentResponse; -import java.util.Collections; -import java.util.Map; - -public final class SecurityAssessmentResponseImpl - implements SecurityAssessmentResponse, SecurityAssessmentResponse.Definition, SecurityAssessmentResponse.Update { - private SecurityAssessmentResponseInner 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 AssessmentStatusResponse status() { - return this.innerModel().status(); - } - - public ResourceDetails resourceDetails() { - return this.innerModel().resourceDetails(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public Map additionalData() { - Map inner = this.innerModel().additionalData(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public AssessmentLinks links() { - return this.innerModel().links(); - } - - public SecurityAssessmentMetadataProperties metadata() { - return this.innerModel().metadata(); - } - - public SecurityAssessmentPartnerData partnersData() { - return this.innerModel().partnersData(); - } - - public SecurityAssessmentResponseInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceId; - - private String assessmentName; - - private SecurityAssessment createAssessment; - - private SecurityAssessment updateAssessment; - - public SecurityAssessmentResponseImpl withExistingResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - public SecurityAssessmentResponse create() { - this.innerObject = - serviceManager - .serviceClient() - .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, createAssessment, Context.NONE) - .getValue(); - return this; - } - - public SecurityAssessmentResponse create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, createAssessment, context) - .getValue(); - return this; - } - - SecurityAssessmentResponseImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new SecurityAssessmentResponseInner(); - this.serviceManager = serviceManager; - this.assessmentName = name; - this.createAssessment = new SecurityAssessment(); - } - - public SecurityAssessmentResponseImpl update() { - this.updateAssessment = new SecurityAssessment(); - return this; - } - - public SecurityAssessmentResponse apply() { - this.innerObject = - serviceManager - .serviceClient() - .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, updateAssessment, Context.NONE) - .getValue(); - return this; - } - - public SecurityAssessmentResponse apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAssessments() - .createOrUpdateWithResponse(resourceId, assessmentName, updateAssessment, context) - .getValue(); - return this; - } - - SecurityAssessmentResponseImpl( - SecurityAssessmentResponseInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceId = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", - "resourceId"); - this.assessmentName = - Utils - .getValueFromIdByParameterName( - innerObject.id(), - "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}", - "assessmentName"); - } - - public SecurityAssessmentResponse refresh() { - ExpandEnum localExpand = null; - this.innerObject = - serviceManager - .serviceClient() - .getAssessments() - .getWithResponse(resourceId, assessmentName, localExpand, Context.NONE) - .getValue(); - return this; - } - - public SecurityAssessmentResponse refresh(Context context) { - ExpandEnum localExpand = null; - this.innerObject = - serviceManager - .serviceClient() - .getAssessments() - .getWithResponse(resourceId, assessmentName, localExpand, context) - .getValue(); - return this; - } - - public SecurityAssessmentResponseImpl withStatus(AssessmentStatus status) { - if (isInCreateMode()) { - this.createAssessment.withStatus(status); - return this; - } else { - this.updateAssessment.withStatus(status); - return this; - } - } - - public SecurityAssessmentResponseImpl withResourceDetails(ResourceDetails resourceDetails) { - if (isInCreateMode()) { - this.createAssessment.withResourceDetails(resourceDetails); - return this; - } else { - this.updateAssessment.withResourceDetails(resourceDetails); - return this; - } - } - - public SecurityAssessmentResponseImpl withAdditionalData(Map additionalData) { - if (isInCreateMode()) { - this.createAssessment.withAdditionalData(additionalData); - return this; - } else { - this.updateAssessment.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 SecurityAssessmentResponseImpl withPartnersData(SecurityAssessmentPartnerData partnersData) { - if (isInCreateMode()) { - this.createAssessment.withPartnersData(partnersData); - return this; - } else { - this.updateAssessment.withPartnersData(partnersData); - return this; - } - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterBuilder.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterBuilder.java deleted file mode 100644 index ff42af6d88d6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterBuilder.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the SecurityCenterImpl type. */ -@ServiceClientBuilder(serviceClients = {SecurityCenterImpl.class}) -public final class SecurityCenterBuilder { - /* - * Azure subscription ID - */ - private String subscriptionId; - - /** - * Sets Azure subscription ID. - * - * @param subscriptionId the subscriptionId value. - * @return the SecurityCenterBuilder. - */ - public SecurityCenterBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the SecurityCenterBuilder. - */ - public SecurityCenterBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the SecurityCenterBuilder. - */ - public SecurityCenterBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the SecurityCenterBuilder. - */ - public SecurityCenterBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the SecurityCenterBuilder. - */ - public SecurityCenterBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the SecurityCenterBuilder. - */ - public SecurityCenterBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of SecurityCenterImpl with the provided parameters. - * - * @return an instance of SecurityCenterImpl. - */ - public SecurityCenterImpl buildClient() { - String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; - AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - SecurityCenterImpl client = - new SecurityCenterImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - subscriptionId, - localEndpoint); - return client; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java deleted file mode 100644 index 2f43f2f9a553..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java +++ /dev/null @@ -1,1119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All 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.ServiceClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.management.polling.PollerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.security.fluent.AdaptiveApplicationControlsClient; -import com.azure.resourcemanager.security.fluent.AdaptiveNetworkHardeningsClient; -import com.azure.resourcemanager.security.fluent.AdvancedThreatProtectionsClient; -import com.azure.resourcemanager.security.fluent.AlertsClient; -import com.azure.resourcemanager.security.fluent.AlertsSuppressionRulesClient; -import com.azure.resourcemanager.security.fluent.AllowedConnectionsClient; -import com.azure.resourcemanager.security.fluent.ApiCollectionOffboardingsClient; -import com.azure.resourcemanager.security.fluent.ApiCollectionOnboardingsClient; -import com.azure.resourcemanager.security.fluent.ApiCollectionsClient; -import com.azure.resourcemanager.security.fluent.ApplicationOperationsClient; -import com.azure.resourcemanager.security.fluent.ApplicationsClient; -import com.azure.resourcemanager.security.fluent.AssessmentsClient; -import com.azure.resourcemanager.security.fluent.AssessmentsMetadatasClient; -import com.azure.resourcemanager.security.fluent.AutoProvisioningSettingsClient; -import com.azure.resourcemanager.security.fluent.AutomationsClient; -import com.azure.resourcemanager.security.fluent.ComplianceResultsClient; -import com.azure.resourcemanager.security.fluent.CompliancesClient; -import com.azure.resourcemanager.security.fluent.ConnectorsClient; -import com.azure.resourcemanager.security.fluent.CustomAssessmentAutomationsClient; -import com.azure.resourcemanager.security.fluent.CustomEntityStoreAssignmentsClient; -import com.azure.resourcemanager.security.fluent.DeviceSecurityGroupsClient; -import com.azure.resourcemanager.security.fluent.DiscoveredSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.ExternalSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.GovernanceAssignmentsClient; -import com.azure.resourcemanager.security.fluent.GovernanceRulesClient; -import com.azure.resourcemanager.security.fluent.HealthReportOperationsClient; -import com.azure.resourcemanager.security.fluent.HealthReportsClient; -import com.azure.resourcemanager.security.fluent.InformationProtectionPoliciesClient; -import com.azure.resourcemanager.security.fluent.IngestionSettingsClient; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionAnalyticsClient; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsAggregatedAlertsClient; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsAnalyticsRecommendationsClient; -import com.azure.resourcemanager.security.fluent.IotSecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.JitNetworkAccessPoliciesClient; -import com.azure.resourcemanager.security.fluent.LocationsClient; -import com.azure.resourcemanager.security.fluent.MdeOnboardingsClient; -import com.azure.resourcemanager.security.fluent.OperationsClient; -import com.azure.resourcemanager.security.fluent.PricingsClient; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceAssessmentsClient; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceControlsClient; -import com.azure.resourcemanager.security.fluent.RegulatoryComplianceStandardsClient; -import com.azure.resourcemanager.security.fluent.SecureScoreControlDefinitionsClient; -import com.azure.resourcemanager.security.fluent.SecureScoreControlsClient; -import com.azure.resourcemanager.security.fluent.SecureScoresClient; -import com.azure.resourcemanager.security.fluent.SecurityCenter; -import com.azure.resourcemanager.security.fluent.SecurityConnectorApplicationOperationsClient; -import com.azure.resourcemanager.security.fluent.SecurityConnectorApplicationsClient; -import com.azure.resourcemanager.security.fluent.SecurityConnectorsClient; -import com.azure.resourcemanager.security.fluent.SecurityContactsClient; -import com.azure.resourcemanager.security.fluent.SecurityOperatorsClient; -import com.azure.resourcemanager.security.fluent.SecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.SecuritySolutionsReferenceDatasClient; -import com.azure.resourcemanager.security.fluent.ServerVulnerabilityAssessmentsClient; -import com.azure.resourcemanager.security.fluent.SettingsClient; -import com.azure.resourcemanager.security.fluent.SoftwareInventoriesClient; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentBaselineRulesClient; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScanResultsClient; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScansClient; -import com.azure.resourcemanager.security.fluent.SubAssessmentsClient; -import com.azure.resourcemanager.security.fluent.TasksClient; -import com.azure.resourcemanager.security.fluent.TopologiesClient; -import com.azure.resourcemanager.security.fluent.WorkspaceSettingsClient; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the SecurityCenterImpl type. */ -@ServiceClient(builder = SecurityCenterBuilder.class) -public final class SecurityCenterImpl implements SecurityCenter { - /** Azure subscription ID. */ - private final String subscriptionId; - - /** - * Gets Azure subscription ID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** The MdeOnboardingsClient object to access its operations. */ - private final MdeOnboardingsClient mdeOnboardings; - - /** - * Gets the MdeOnboardingsClient object to access its operations. - * - * @return the MdeOnboardingsClient object. - */ - public MdeOnboardingsClient getMdeOnboardings() { - return this.mdeOnboardings; - } - - /** The CustomAssessmentAutomationsClient object to access its operations. */ - private final CustomAssessmentAutomationsClient customAssessmentAutomations; - - /** - * Gets the CustomAssessmentAutomationsClient object to access its operations. - * - * @return the CustomAssessmentAutomationsClient object. - */ - public CustomAssessmentAutomationsClient getCustomAssessmentAutomations() { - return this.customAssessmentAutomations; - } - - /** The CustomEntityStoreAssignmentsClient object to access its operations. */ - private final CustomEntityStoreAssignmentsClient customEntityStoreAssignments; - - /** - * Gets the CustomEntityStoreAssignmentsClient object to access its operations. - * - * @return the CustomEntityStoreAssignmentsClient object. - */ - public CustomEntityStoreAssignmentsClient getCustomEntityStoreAssignments() { - return this.customEntityStoreAssignments; - } - - /** The ComplianceResultsClient object to access its operations. */ - private final ComplianceResultsClient complianceResults; - - /** - * Gets the ComplianceResultsClient object to access its operations. - * - * @return the ComplianceResultsClient object. - */ - public ComplianceResultsClient getComplianceResults() { - return this.complianceResults; - } - - /** The PricingsClient object to access its operations. */ - private final PricingsClient pricings; - - /** - * Gets the PricingsClient object to access its operations. - * - * @return the PricingsClient object. - */ - public PricingsClient getPricings() { - return this.pricings; - } - - /** The AdvancedThreatProtectionsClient object to access its operations. */ - private final AdvancedThreatProtectionsClient advancedThreatProtections; - - /** - * Gets the AdvancedThreatProtectionsClient object to access its operations. - * - * @return the AdvancedThreatProtectionsClient object. - */ - public AdvancedThreatProtectionsClient getAdvancedThreatProtections() { - return this.advancedThreatProtections; - } - - /** The DeviceSecurityGroupsClient object to access its operations. */ - private final DeviceSecurityGroupsClient deviceSecurityGroups; - - /** - * Gets the DeviceSecurityGroupsClient object to access its operations. - * - * @return the DeviceSecurityGroupsClient object. - */ - public DeviceSecurityGroupsClient getDeviceSecurityGroups() { - return this.deviceSecurityGroups; - } - - /** The IotSecuritySolutionsClient object to access its operations. */ - private final IotSecuritySolutionsClient iotSecuritySolutions; - - /** - * Gets the IotSecuritySolutionsClient object to access its operations. - * - * @return the IotSecuritySolutionsClient object. - */ - public IotSecuritySolutionsClient getIotSecuritySolutions() { - return this.iotSecuritySolutions; - } - - /** The IotSecuritySolutionAnalyticsClient object to access its operations. */ - private final IotSecuritySolutionAnalyticsClient iotSecuritySolutionAnalytics; - - /** - * Gets the IotSecuritySolutionAnalyticsClient object to access its operations. - * - * @return the IotSecuritySolutionAnalyticsClient object. - */ - public IotSecuritySolutionAnalyticsClient getIotSecuritySolutionAnalytics() { - return this.iotSecuritySolutionAnalytics; - } - - /** The IotSecuritySolutionsAnalyticsAggregatedAlertsClient object to access its operations. */ - private final IotSecuritySolutionsAnalyticsAggregatedAlertsClient iotSecuritySolutionsAnalyticsAggregatedAlerts; - - /** - * Gets the IotSecuritySolutionsAnalyticsAggregatedAlertsClient object to access its operations. - * - * @return the IotSecuritySolutionsAnalyticsAggregatedAlertsClient object. - */ - public IotSecuritySolutionsAnalyticsAggregatedAlertsClient getIotSecuritySolutionsAnalyticsAggregatedAlerts() { - return this.iotSecuritySolutionsAnalyticsAggregatedAlerts; - } - - /** The IotSecuritySolutionsAnalyticsRecommendationsClient object to access its operations. */ - private final IotSecuritySolutionsAnalyticsRecommendationsClient iotSecuritySolutionsAnalyticsRecommendations; - - /** - * Gets the IotSecuritySolutionsAnalyticsRecommendationsClient object to access its operations. - * - * @return the IotSecuritySolutionsAnalyticsRecommendationsClient object. - */ - public IotSecuritySolutionsAnalyticsRecommendationsClient getIotSecuritySolutionsAnalyticsRecommendations() { - return this.iotSecuritySolutionsAnalyticsRecommendations; - } - - /** The LocationsClient object to access its operations. */ - private final LocationsClient locations; - - /** - * Gets the LocationsClient object to access its operations. - * - * @return the LocationsClient object. - */ - public LocationsClient getLocations() { - return this.locations; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The TasksClient object to access its operations. */ - private final TasksClient tasks; - - /** - * Gets the TasksClient object to access its operations. - * - * @return the TasksClient object. - */ - public TasksClient getTasks() { - return this.tasks; - } - - /** The AutoProvisioningSettingsClient object to access its operations. */ - private final AutoProvisioningSettingsClient autoProvisioningSettings; - - /** - * Gets the AutoProvisioningSettingsClient object to access its operations. - * - * @return the AutoProvisioningSettingsClient object. - */ - public AutoProvisioningSettingsClient getAutoProvisioningSettings() { - return this.autoProvisioningSettings; - } - - /** The CompliancesClient object to access its operations. */ - private final CompliancesClient compliances; - - /** - * Gets the CompliancesClient object to access its operations. - * - * @return the CompliancesClient object. - */ - public CompliancesClient getCompliances() { - return this.compliances; - } - - /** The InformationProtectionPoliciesClient object to access its operations. */ - private final InformationProtectionPoliciesClient informationProtectionPolicies; - - /** - * Gets the InformationProtectionPoliciesClient object to access its operations. - * - * @return the InformationProtectionPoliciesClient object. - */ - public InformationProtectionPoliciesClient getInformationProtectionPolicies() { - return this.informationProtectionPolicies; - } - - /** The SecurityContactsClient object to access its operations. */ - private final SecurityContactsClient securityContacts; - - /** - * Gets the SecurityContactsClient object to access its operations. - * - * @return the SecurityContactsClient object. - */ - public SecurityContactsClient getSecurityContacts() { - return this.securityContacts; - } - - /** The WorkspaceSettingsClient object to access its operations. */ - private final WorkspaceSettingsClient workspaceSettings; - - /** - * Gets the WorkspaceSettingsClient object to access its operations. - * - * @return the WorkspaceSettingsClient object. - */ - public WorkspaceSettingsClient getWorkspaceSettings() { - return this.workspaceSettings; - } - - /** The RegulatoryComplianceStandardsClient object to access its operations. */ - private final RegulatoryComplianceStandardsClient regulatoryComplianceStandards; - - /** - * Gets the RegulatoryComplianceStandardsClient object to access its operations. - * - * @return the RegulatoryComplianceStandardsClient object. - */ - public RegulatoryComplianceStandardsClient getRegulatoryComplianceStandards() { - return this.regulatoryComplianceStandards; - } - - /** The RegulatoryComplianceControlsClient object to access its operations. */ - private final RegulatoryComplianceControlsClient regulatoryComplianceControls; - - /** - * Gets the RegulatoryComplianceControlsClient object to access its operations. - * - * @return the RegulatoryComplianceControlsClient object. - */ - public RegulatoryComplianceControlsClient getRegulatoryComplianceControls() { - return this.regulatoryComplianceControls; - } - - /** The RegulatoryComplianceAssessmentsClient object to access its operations. */ - private final RegulatoryComplianceAssessmentsClient regulatoryComplianceAssessments; - - /** - * Gets the RegulatoryComplianceAssessmentsClient object to access its operations. - * - * @return the RegulatoryComplianceAssessmentsClient object. - */ - public RegulatoryComplianceAssessmentsClient getRegulatoryComplianceAssessments() { - return this.regulatoryComplianceAssessments; - } - - /** The SubAssessmentsClient object to access its operations. */ - private final SubAssessmentsClient subAssessments; - - /** - * Gets the SubAssessmentsClient object to access its operations. - * - * @return the SubAssessmentsClient object. - */ - public SubAssessmentsClient getSubAssessments() { - return this.subAssessments; - } - - /** The AutomationsClient object to access its operations. */ - private final AutomationsClient automations; - - /** - * Gets the AutomationsClient object to access its operations. - * - * @return the AutomationsClient object. - */ - public AutomationsClient getAutomations() { - return this.automations; - } - - /** The AlertsSuppressionRulesClient object to access its operations. */ - private final AlertsSuppressionRulesClient alertsSuppressionRules; - - /** - * Gets the AlertsSuppressionRulesClient object to access its operations. - * - * @return the AlertsSuppressionRulesClient object. - */ - public AlertsSuppressionRulesClient getAlertsSuppressionRules() { - return this.alertsSuppressionRules; - } - - /** The ServerVulnerabilityAssessmentsClient object to access its operations. */ - private final ServerVulnerabilityAssessmentsClient serverVulnerabilityAssessments; - - /** - * Gets the ServerVulnerabilityAssessmentsClient object to access its operations. - * - * @return the ServerVulnerabilityAssessmentsClient object. - */ - public ServerVulnerabilityAssessmentsClient getServerVulnerabilityAssessments() { - return this.serverVulnerabilityAssessments; - } - - /** The AssessmentsMetadatasClient object to access its operations. */ - private final AssessmentsMetadatasClient assessmentsMetadatas; - - /** - * Gets the AssessmentsMetadatasClient object to access its operations. - * - * @return the AssessmentsMetadatasClient object. - */ - public AssessmentsMetadatasClient getAssessmentsMetadatas() { - return this.assessmentsMetadatas; - } - - /** The AssessmentsClient object to access its operations. */ - private final AssessmentsClient assessments; - - /** - * Gets the AssessmentsClient object to access its operations. - * - * @return the AssessmentsClient object. - */ - public AssessmentsClient getAssessments() { - return this.assessments; - } - - /** The AdaptiveApplicationControlsClient object to access its operations. */ - private final AdaptiveApplicationControlsClient adaptiveApplicationControls; - - /** - * Gets the AdaptiveApplicationControlsClient object to access its operations. - * - * @return the AdaptiveApplicationControlsClient object. - */ - public AdaptiveApplicationControlsClient getAdaptiveApplicationControls() { - return this.adaptiveApplicationControls; - } - - /** The AdaptiveNetworkHardeningsClient object to access its operations. */ - private final AdaptiveNetworkHardeningsClient adaptiveNetworkHardenings; - - /** - * Gets the AdaptiveNetworkHardeningsClient object to access its operations. - * - * @return the AdaptiveNetworkHardeningsClient object. - */ - public AdaptiveNetworkHardeningsClient getAdaptiveNetworkHardenings() { - return this.adaptiveNetworkHardenings; - } - - /** The AllowedConnectionsClient object to access its operations. */ - private final AllowedConnectionsClient allowedConnections; - - /** - * Gets the AllowedConnectionsClient object to access its operations. - * - * @return the AllowedConnectionsClient object. - */ - public AllowedConnectionsClient getAllowedConnections() { - return this.allowedConnections; - } - - /** The TopologiesClient object to access its operations. */ - private final TopologiesClient topologies; - - /** - * Gets the TopologiesClient object to access its operations. - * - * @return the TopologiesClient object. - */ - public TopologiesClient getTopologies() { - return this.topologies; - } - - /** The JitNetworkAccessPoliciesClient object to access its operations. */ - private final JitNetworkAccessPoliciesClient jitNetworkAccessPolicies; - - /** - * Gets the JitNetworkAccessPoliciesClient object to access its operations. - * - * @return the JitNetworkAccessPoliciesClient object. - */ - public JitNetworkAccessPoliciesClient getJitNetworkAccessPolicies() { - return this.jitNetworkAccessPolicies; - } - - /** The DiscoveredSecuritySolutionsClient object to access its operations. */ - private final DiscoveredSecuritySolutionsClient discoveredSecuritySolutions; - - /** - * Gets the DiscoveredSecuritySolutionsClient object to access its operations. - * - * @return the DiscoveredSecuritySolutionsClient object. - */ - public DiscoveredSecuritySolutionsClient getDiscoveredSecuritySolutions() { - return this.discoveredSecuritySolutions; - } - - /** The SecuritySolutionsReferenceDatasClient object to access its operations. */ - private final SecuritySolutionsReferenceDatasClient securitySolutionsReferenceDatas; - - /** - * Gets the SecuritySolutionsReferenceDatasClient object to access its operations. - * - * @return the SecuritySolutionsReferenceDatasClient object. - */ - public SecuritySolutionsReferenceDatasClient getSecuritySolutionsReferenceDatas() { - return this.securitySolutionsReferenceDatas; - } - - /** The ExternalSecuritySolutionsClient object to access its operations. */ - private final ExternalSecuritySolutionsClient externalSecuritySolutions; - - /** - * Gets the ExternalSecuritySolutionsClient object to access its operations. - * - * @return the ExternalSecuritySolutionsClient object. - */ - public ExternalSecuritySolutionsClient getExternalSecuritySolutions() { - return this.externalSecuritySolutions; - } - - /** The SecureScoresClient object to access its operations. */ - private final SecureScoresClient secureScores; - - /** - * Gets the SecureScoresClient object to access its operations. - * - * @return the SecureScoresClient object. - */ - public SecureScoresClient getSecureScores() { - return this.secureScores; - } - - /** The SecureScoreControlsClient object to access its operations. */ - private final SecureScoreControlsClient secureScoreControls; - - /** - * Gets the SecureScoreControlsClient object to access its operations. - * - * @return the SecureScoreControlsClient object. - */ - public SecureScoreControlsClient getSecureScoreControls() { - return this.secureScoreControls; - } - - /** The SecureScoreControlDefinitionsClient object to access its operations. */ - private final SecureScoreControlDefinitionsClient secureScoreControlDefinitions; - - /** - * Gets the SecureScoreControlDefinitionsClient object to access its operations. - * - * @return the SecureScoreControlDefinitionsClient object. - */ - public SecureScoreControlDefinitionsClient getSecureScoreControlDefinitions() { - return this.secureScoreControlDefinitions; - } - - /** The SecuritySolutionsClient object to access its operations. */ - private final SecuritySolutionsClient securitySolutions; - - /** - * Gets the SecuritySolutionsClient object to access its operations. - * - * @return the SecuritySolutionsClient object. - */ - public SecuritySolutionsClient getSecuritySolutions() { - return this.securitySolutions; - } - - /** The ConnectorsClient object to access its operations. */ - private final ConnectorsClient connectors; - - /** - * Gets the ConnectorsClient object to access its operations. - * - * @return the ConnectorsClient object. - */ - public ConnectorsClient getConnectors() { - return this.connectors; - } - - /** The AlertsClient object to access its operations. */ - private final AlertsClient alerts; - - /** - * Gets the AlertsClient object to access its operations. - * - * @return the AlertsClient object. - */ - public AlertsClient getAlerts() { - return this.alerts; - } - - /** The SettingsClient object to access its operations. */ - private final SettingsClient settings; - - /** - * Gets the SettingsClient object to access its operations. - * - * @return the SettingsClient object. - */ - public SettingsClient getSettings() { - return this.settings; - } - - /** The IngestionSettingsClient object to access its operations. */ - private final IngestionSettingsClient ingestionSettings; - - /** - * Gets the IngestionSettingsClient object to access its operations. - * - * @return the IngestionSettingsClient object. - */ - public IngestionSettingsClient getIngestionSettings() { - return this.ingestionSettings; - } - - /** The SoftwareInventoriesClient object to access its operations. */ - private final SoftwareInventoriesClient softwareInventories; - - /** - * Gets the SoftwareInventoriesClient object to access its operations. - * - * @return the SoftwareInventoriesClient object. - */ - public SoftwareInventoriesClient getSoftwareInventories() { - return this.softwareInventories; - } - - /** The GovernanceRulesClient object to access its operations. */ - private final GovernanceRulesClient governanceRules; - - /** - * Gets the GovernanceRulesClient object to access its operations. - * - * @return the GovernanceRulesClient object. - */ - public GovernanceRulesClient getGovernanceRules() { - return this.governanceRules; - } - - /** The GovernanceAssignmentsClient object to access its operations. */ - private final GovernanceAssignmentsClient governanceAssignments; - - /** - * Gets the GovernanceAssignmentsClient object to access its operations. - * - * @return the GovernanceAssignmentsClient object. - */ - public GovernanceAssignmentsClient getGovernanceAssignments() { - return this.governanceAssignments; - } - - /** The ApplicationsClient object to access its operations. */ - private final ApplicationsClient applications; - - /** - * Gets the ApplicationsClient object to access its operations. - * - * @return the ApplicationsClient object. - */ - public ApplicationsClient getApplications() { - return this.applications; - } - - /** The ApplicationOperationsClient object to access its operations. */ - private final ApplicationOperationsClient applicationOperations; - - /** - * Gets the ApplicationOperationsClient object to access its operations. - * - * @return the ApplicationOperationsClient object. - */ - public ApplicationOperationsClient getApplicationOperations() { - return this.applicationOperations; - } - - /** The SecurityConnectorApplicationsClient object to access its operations. */ - private final SecurityConnectorApplicationsClient securityConnectorApplications; - - /** - * Gets the SecurityConnectorApplicationsClient object to access its operations. - * - * @return the SecurityConnectorApplicationsClient object. - */ - public SecurityConnectorApplicationsClient getSecurityConnectorApplications() { - return this.securityConnectorApplications; - } - - /** The SecurityConnectorApplicationOperationsClient object to access its operations. */ - private final SecurityConnectorApplicationOperationsClient securityConnectorApplicationOperations; - - /** - * Gets the SecurityConnectorApplicationOperationsClient object to access its operations. - * - * @return the SecurityConnectorApplicationOperationsClient object. - */ - public SecurityConnectorApplicationOperationsClient getSecurityConnectorApplicationOperations() { - return this.securityConnectorApplicationOperations; - } - - /** The ApiCollectionsClient object to access its operations. */ - private final ApiCollectionsClient apiCollections; - - /** - * Gets the ApiCollectionsClient object to access its operations. - * - * @return the ApiCollectionsClient object. - */ - public ApiCollectionsClient getApiCollections() { - return this.apiCollections; - } - - /** The ApiCollectionOnboardingsClient object to access its operations. */ - private final ApiCollectionOnboardingsClient apiCollectionOnboardings; - - /** - * Gets the ApiCollectionOnboardingsClient object to access its operations. - * - * @return the ApiCollectionOnboardingsClient object. - */ - public ApiCollectionOnboardingsClient getApiCollectionOnboardings() { - return this.apiCollectionOnboardings; - } - - /** The ApiCollectionOffboardingsClient object to access its operations. */ - private final ApiCollectionOffboardingsClient apiCollectionOffboardings; - - /** - * Gets the ApiCollectionOffboardingsClient object to access its operations. - * - * @return the ApiCollectionOffboardingsClient object. - */ - public ApiCollectionOffboardingsClient getApiCollectionOffboardings() { - return this.apiCollectionOffboardings; - } - - /** The HealthReportsClient object to access its operations. */ - private final HealthReportsClient healthReports; - - /** - * Gets the HealthReportsClient object to access its operations. - * - * @return the HealthReportsClient object. - */ - public HealthReportsClient getHealthReports() { - return this.healthReports; - } - - /** The HealthReportOperationsClient object to access its operations. */ - private final HealthReportOperationsClient healthReportOperations; - - /** - * Gets the HealthReportOperationsClient object to access its operations. - * - * @return the HealthReportOperationsClient object. - */ - public HealthReportOperationsClient getHealthReportOperations() { - return this.healthReportOperations; - } - - /** The SqlVulnerabilityAssessmentScansClient object to access its operations. */ - private final SqlVulnerabilityAssessmentScansClient sqlVulnerabilityAssessmentScans; - - /** - * Gets the SqlVulnerabilityAssessmentScansClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScansClient object. - */ - public SqlVulnerabilityAssessmentScansClient getSqlVulnerabilityAssessmentScans() { - return this.sqlVulnerabilityAssessmentScans; - } - - /** The SqlVulnerabilityAssessmentScanResultsClient object to access its operations. */ - private final SqlVulnerabilityAssessmentScanResultsClient sqlVulnerabilityAssessmentScanResults; - - /** - * Gets the SqlVulnerabilityAssessmentScanResultsClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentScanResultsClient object. - */ - public SqlVulnerabilityAssessmentScanResultsClient getSqlVulnerabilityAssessmentScanResults() { - return this.sqlVulnerabilityAssessmentScanResults; - } - - /** The SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. */ - private final SqlVulnerabilityAssessmentBaselineRulesClient sqlVulnerabilityAssessmentBaselineRules; - - /** - * Gets the SqlVulnerabilityAssessmentBaselineRulesClient object to access its operations. - * - * @return the SqlVulnerabilityAssessmentBaselineRulesClient object. - */ - public SqlVulnerabilityAssessmentBaselineRulesClient getSqlVulnerabilityAssessmentBaselineRules() { - return this.sqlVulnerabilityAssessmentBaselineRules; - } - - /** The SecurityConnectorsClient object to access its operations. */ - private final SecurityConnectorsClient securityConnectors; - - /** - * Gets the SecurityConnectorsClient object to access its operations. - * - * @return the SecurityConnectorsClient object. - */ - public SecurityConnectorsClient getSecurityConnectors() { - return this.securityConnectors; - } - - /** The SecurityOperatorsClient object to access its operations. */ - private final SecurityOperatorsClient securityOperators; - - /** - * Gets the SecurityOperatorsClient object to access its operations. - * - * @return the SecurityOperatorsClient object. - */ - public SecurityOperatorsClient getSecurityOperators() { - return this.securityOperators; - } - - /** - * Initializes an instance of SecurityCenter client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId Azure subscription ID. - * @param endpoint server parameter. - */ - SecurityCenterImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.mdeOnboardings = new MdeOnboardingsClientImpl(this); - this.customAssessmentAutomations = new CustomAssessmentAutomationsClientImpl(this); - this.customEntityStoreAssignments = new CustomEntityStoreAssignmentsClientImpl(this); - this.complianceResults = new ComplianceResultsClientImpl(this); - this.pricings = new PricingsClientImpl(this); - this.advancedThreatProtections = new AdvancedThreatProtectionsClientImpl(this); - this.deviceSecurityGroups = new DeviceSecurityGroupsClientImpl(this); - this.iotSecuritySolutions = new IotSecuritySolutionsClientImpl(this); - this.iotSecuritySolutionAnalytics = new IotSecuritySolutionAnalyticsClientImpl(this); - this.iotSecuritySolutionsAnalyticsAggregatedAlerts = - new IotSecuritySolutionsAnalyticsAggregatedAlertsClientImpl(this); - this.iotSecuritySolutionsAnalyticsRecommendations = - new IotSecuritySolutionsAnalyticsRecommendationsClientImpl(this); - this.locations = new LocationsClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.tasks = new TasksClientImpl(this); - this.autoProvisioningSettings = new AutoProvisioningSettingsClientImpl(this); - this.compliances = new CompliancesClientImpl(this); - this.informationProtectionPolicies = new InformationProtectionPoliciesClientImpl(this); - this.securityContacts = new SecurityContactsClientImpl(this); - this.workspaceSettings = new WorkspaceSettingsClientImpl(this); - this.regulatoryComplianceStandards = new RegulatoryComplianceStandardsClientImpl(this); - this.regulatoryComplianceControls = new RegulatoryComplianceControlsClientImpl(this); - this.regulatoryComplianceAssessments = new RegulatoryComplianceAssessmentsClientImpl(this); - this.subAssessments = new SubAssessmentsClientImpl(this); - this.automations = new AutomationsClientImpl(this); - this.alertsSuppressionRules = new AlertsSuppressionRulesClientImpl(this); - this.serverVulnerabilityAssessments = new ServerVulnerabilityAssessmentsClientImpl(this); - this.assessmentsMetadatas = new AssessmentsMetadatasClientImpl(this); - this.assessments = new AssessmentsClientImpl(this); - this.adaptiveApplicationControls = new AdaptiveApplicationControlsClientImpl(this); - this.adaptiveNetworkHardenings = new AdaptiveNetworkHardeningsClientImpl(this); - this.allowedConnections = new AllowedConnectionsClientImpl(this); - this.topologies = new TopologiesClientImpl(this); - this.jitNetworkAccessPolicies = new JitNetworkAccessPoliciesClientImpl(this); - this.discoveredSecuritySolutions = new DiscoveredSecuritySolutionsClientImpl(this); - this.securitySolutionsReferenceDatas = new SecuritySolutionsReferenceDatasClientImpl(this); - this.externalSecuritySolutions = new ExternalSecuritySolutionsClientImpl(this); - this.secureScores = new SecureScoresClientImpl(this); - this.secureScoreControls = new SecureScoreControlsClientImpl(this); - this.secureScoreControlDefinitions = new SecureScoreControlDefinitionsClientImpl(this); - this.securitySolutions = new SecuritySolutionsClientImpl(this); - this.connectors = new ConnectorsClientImpl(this); - this.alerts = new AlertsClientImpl(this); - this.settings = new SettingsClientImpl(this); - this.ingestionSettings = new IngestionSettingsClientImpl(this); - this.softwareInventories = new SoftwareInventoriesClientImpl(this); - this.governanceRules = new GovernanceRulesClientImpl(this); - this.governanceAssignments = new GovernanceAssignmentsClientImpl(this); - this.applications = new ApplicationsClientImpl(this); - this.applicationOperations = new ApplicationOperationsClientImpl(this); - this.securityConnectorApplications = new SecurityConnectorApplicationsClientImpl(this); - this.securityConnectorApplicationOperations = new SecurityConnectorApplicationOperationsClientImpl(this); - this.apiCollections = new ApiCollectionsClientImpl(this); - this.apiCollectionOnboardings = new ApiCollectionOnboardingsClientImpl(this); - this.apiCollectionOffboardings = new ApiCollectionOffboardingsClientImpl(this); - this.healthReports = new HealthReportsClientImpl(this); - this.healthReportOperations = new HealthReportOperationsClientImpl(this); - this.sqlVulnerabilityAssessmentScans = new SqlVulnerabilityAssessmentScansClientImpl(this); - this.sqlVulnerabilityAssessmentScanResults = new SqlVulnerabilityAssessmentScanResultsClientImpl(this); - this.sqlVulnerabilityAssessmentBaselineRules = new SqlVulnerabilityAssessmentBaselineRulesClientImpl(this); - this.securityConnectors = new SecurityConnectorsClientImpl(this); - this.securityOperators = new SecurityOperatorsClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - return CoreUtils.mergeContexts(this.getContext(), context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); - } - - /** - * Gets the final result, or an error, based on last async poll response. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - LOGGER.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(s); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityCenterImpl.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsClientImpl.java deleted file mode 100644 index 8cf5297de074..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsClientImpl.java +++ /dev/null @@ -1,633 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecurityConnectorApplicationOperationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * SecurityConnectorApplicationOperationsClient. - */ -public final class SecurityConnectorApplicationOperationsClientImpl - implements SecurityConnectorApplicationOperationsClient { - /** The proxy service used to perform REST calls. */ - private final SecurityConnectorApplicationOperationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityConnectorApplicationOperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityConnectorApplicationOperationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - SecurityConnectorApplicationOperationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityConnectorApplicationOperations to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecuri") - public interface SecurityConnectorApplicationOperationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("applicationId") String applicationId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("applicationId") String applicationId, - @BodyParam("application/json") ApplicationInner application, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @PathParam("applicationId") String applicationId, - Context context); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String securityConnectorName, String applicationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - applicationId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String securityConnectorName, String applicationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - applicationId, - accept, - context); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String securityConnectorName, String applicationId) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, applicationId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String securityConnectorName, String applicationId, Context context) { - return getWithResponseAsync(resourceGroupName, securityConnectorName, applicationId, context).block(); - } - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner get(String resourceGroupName, String securityConnectorName, String applicationId) { - return getWithResponse(resourceGroupName, securityConnectorName, applicationId, Context.NONE).getValue(); - } - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String securityConnectorName, String applicationId, ApplicationInner application) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - applicationId, - application, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String securityConnectorName, - String applicationId, - ApplicationInner application, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - if (application == null) { - return Mono.error(new IllegalArgumentException("Parameter application is required and cannot be null.")); - } else { - application.validate(); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - applicationId, - application, - accept, - context); - } - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String securityConnectorName, String applicationId, ApplicationInner application) { - return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, applicationId, application) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String securityConnectorName, - String applicationId, - ApplicationInner application, - Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, securityConnectorName, applicationId, application, context) - .block(); - } - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ApplicationInner createOrUpdate( - String resourceGroupName, String securityConnectorName, String applicationId, ApplicationInner application) { - return createOrUpdateWithResponse( - resourceGroupName, securityConnectorName, applicationId, application, Context.NONE) - .getValue(); - } - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String securityConnectorName, String applicationId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - applicationId, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String securityConnectorName, String applicationId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (applicationId == null) { - return Mono.error(new IllegalArgumentException("Parameter applicationId is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - applicationId, - context); - } - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String securityConnectorName, String applicationId) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName, applicationId) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse( - String resourceGroupName, String securityConnectorName, String applicationId, Context context) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName, applicationId, context).block(); - } - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String securityConnectorName, String applicationId) { - deleteWithResponse(resourceGroupName, securityConnectorName, applicationId, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsImpl.java deleted file mode 100644 index 006bf422b7c2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationOperationsImpl.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.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityConnectorApplicationOperationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.SecurityConnectorApplicationOperations; - -public final class SecurityConnectorApplicationOperationsImpl implements SecurityConnectorApplicationOperations { - private static final ClientLogger LOGGER = new ClientLogger(SecurityConnectorApplicationOperationsImpl.class); - - private final SecurityConnectorApplicationOperationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityConnectorApplicationOperationsImpl( - SecurityConnectorApplicationOperationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse( - String resourceGroupName, String securityConnectorName, String applicationId, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, securityConnectorName, applicationId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ApplicationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Application get(String resourceGroupName, String securityConnectorName, String applicationId) { - ApplicationInner inner = this.serviceClient().get(resourceGroupName, securityConnectorName, applicationId); - if (inner != null) { - return new ApplicationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse( - String resourceGroupName, - String securityConnectorName, - String applicationId, - ApplicationInner application, - Context context) { - Response inner = - this - .serviceClient() - .createOrUpdateWithResponse( - resourceGroupName, securityConnectorName, applicationId, application, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ApplicationImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Application createOrUpdate( - String resourceGroupName, String securityConnectorName, String applicationId, ApplicationInner application) { - ApplicationInner inner = - this.serviceClient().createOrUpdate(resourceGroupName, securityConnectorName, applicationId, application); - if (inner != null) { - return new ApplicationImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse( - String resourceGroupName, String securityConnectorName, String applicationId, Context context) { - return this - .serviceClient() - .deleteWithResponse(resourceGroupName, securityConnectorName, applicationId, context); - } - - public void delete(String resourceGroupName, String securityConnectorName, String applicationId) { - this.serviceClient().delete(resourceGroupName, securityConnectorName, applicationId); - } - - private SecurityConnectorApplicationOperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsClientImpl.java deleted file mode 100644 index 40cd382330cd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsClientImpl.java +++ /dev/null @@ -1,358 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecurityConnectorApplicationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.ApplicationsList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SecurityConnectorApplicationsClient. */ -public final class SecurityConnectorApplicationsClientImpl implements SecurityConnectorApplicationsClient { - /** The proxy service used to perform REST calls. */ - private final SecurityConnectorApplicationsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityConnectorApplicationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityConnectorApplicationsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - SecurityConnectorApplicationsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityConnectorApplications to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecuri") - public interface SecurityConnectorApplicationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a security connector level scope along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String securityConnectorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a security connector level scope along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, String securityConnectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2022-07-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String securityConnectorName) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, String securityConnectorName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, securityConnectorName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName)); - } - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, String securityConnectorName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, securityConnectorName, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return page of a security applications list along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsImpl.java deleted file mode 100644 index d8ac67980999..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorApplicationsImpl.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.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityConnectorApplicationsClient; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.SecurityConnectorApplications; - -public final class SecurityConnectorApplicationsImpl implements SecurityConnectorApplications { - private static final ClientLogger LOGGER = new ClientLogger(SecurityConnectorApplicationsImpl.class); - - private final SecurityConnectorApplicationsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityConnectorApplicationsImpl( - SecurityConnectorApplicationsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, securityConnectorName); - return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String securityConnectorName, Context context) { - PagedIterable inner = - this.serviceClient().list(resourceGroupName, securityConnectorName, context); - return Utils.mapPage(inner, inner1 -> new ApplicationImpl(inner1, this.manager())); - } - - private SecurityConnectorApplicationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorImpl.java deleted file mode 100644 index 6eaee85d9cac..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorImpl.java +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.CloudOffering; -import com.azure.resourcemanager.security.models.EnvironmentData; -import com.azure.resourcemanager.security.models.SecurityConnector; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class SecurityConnectorImpl - implements SecurityConnector, SecurityConnector.Definition, SecurityConnector.Update { - private SecurityConnectorInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String hierarchyIdentifier() { - return this.innerModel().hierarchyIdentifier(); - } - - public OffsetDateTime hierarchyIdentifierTrialEndDate() { - return this.innerModel().hierarchyIdentifierTrialEndDate(); - } - - public CloudName environmentName() { - return this.innerModel().environmentName(); - } - - public List offerings() { - List inner = this.innerModel().offerings(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public EnvironmentData environmentData() { - return this.innerModel().environmentData(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public SecurityConnectorInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String securityConnectorName; - - public SecurityConnectorImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public SecurityConnector create() { - this.innerObject = - serviceManager - .serviceClient() - .getSecurityConnectors() - .createOrUpdateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public SecurityConnector create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSecurityConnectors() - .createOrUpdateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), context) - .getValue(); - return this; - } - - SecurityConnectorImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new SecurityConnectorInner(); - this.serviceManager = serviceManager; - this.securityConnectorName = name; - } - - public SecurityConnectorImpl update() { - return this; - } - - public SecurityConnector apply() { - this.innerObject = - serviceManager - .serviceClient() - .getSecurityConnectors() - .updateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public SecurityConnector apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSecurityConnectors() - .updateWithResponse(resourceGroupName, securityConnectorName, this.innerModel(), context) - .getValue(); - return this; - } - - SecurityConnectorImpl( - SecurityConnectorInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.securityConnectorName = Utils.getValueFromIdByName(innerObject.id(), "securityConnectors"); - } - - public SecurityConnector refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getSecurityConnectors() - .getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, Context.NONE) - .getValue(); - return this; - } - - public SecurityConnector refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSecurityConnectors() - .getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, context) - .getValue(); - return this; - } - - public SecurityConnectorImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public SecurityConnectorImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public SecurityConnectorImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public SecurityConnectorImpl withHierarchyIdentifier(String hierarchyIdentifier) { - this.innerModel().withHierarchyIdentifier(hierarchyIdentifier); - return this; - } - - public SecurityConnectorImpl withEnvironmentName(CloudName environmentName) { - this.innerModel().withEnvironmentName(environmentName); - return this; - } - - public SecurityConnectorImpl withOfferings(List offerings) { - this.innerModel().withOfferings(offerings); - return this; - } - - public SecurityConnectorImpl withEnvironmentData(EnvironmentData environmentData) { - this.innerModel().withEnvironmentData(environmentData); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsClientImpl.java deleted file mode 100644 index 2092e42d6eb4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsClientImpl.java +++ /dev/null @@ -1,1298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecurityConnectorsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; -import com.azure.resourcemanager.security.models.SecurityConnectorsList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SecurityConnectorsClient. */ -public final class SecurityConnectorsClientImpl implements SecurityConnectorsClient { - /** The proxy service used to perform REST calls. */ - private final SecurityConnectorsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityConnectorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityConnectorsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(SecurityConnectorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityConnectors to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecuri") - public interface SecurityConnectorsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @BodyParam("application/json") SecurityConnectorInner securityConnector, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @BodyParam("application/json") SecurityConnectorInner securityConnector, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("securityConnectorName") String securityConnectorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-03-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2023-03-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2023-03-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - final String apiVersion = "2023-03-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); - } - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String securityConnectorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2023-03-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - String resourceGroupName, String securityConnectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2023-03-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - accept, - context); - } - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync( - String resourceGroupName, String securityConnectorName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, securityConnectorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String securityConnectorName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); - } - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityConnectorInner getByResourceGroup(String resourceGroupName, String securityConnectorName) { - return getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); - } - - /** - * Creates or updates a security connector. If a security connector is already created and a subsequent request is - * issued for the same security connector id, then it will be updated. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (securityConnector == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnector is required and cannot be null.")); - } else { - securityConnector.validate(); - } - final String apiVersion = "2023-03-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - securityConnector, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates or updates a security connector. If a security connector is already created and a subsequent request is - * issued for the same security connector id, then it will be updated. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String securityConnectorName, - SecurityConnectorInner securityConnector, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (securityConnector == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnector is required and cannot be null.")); - } else { - securityConnector.validate(); - } - final String apiVersion = "2023-03-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - securityConnector, - accept, - context); - } - - /** - * Creates or updates a security connector. If a security connector is already created and a subsequent request is - * issued for the same security connector id, then it will be updated. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { - return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates or updates a security connector. If a security connector is already created and a subsequent request is - * issued for the same security connector id, then it will be updated. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, - String securityConnectorName, - SecurityConnectorInner securityConnector, - Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector, context) - .block(); - } - - /** - * Creates or updates a security connector. If a security connector is already created and a subsequent request is - * issued for the same security connector id, then it will be updated. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityConnectorInner createOrUpdate( - String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { - return createOrUpdateWithResponse(resourceGroupName, securityConnectorName, securityConnector, Context.NONE) - .getValue(); - } - - /** - * Updates a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (securityConnector == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnector is required and cannot be null.")); - } else { - securityConnector.validate(); - } - final String apiVersion = "2023-03-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - securityConnector, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Updates a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, - String securityConnectorName, - SecurityConnectorInner securityConnector, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - if (securityConnector == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnector is required and cannot be null.")); - } else { - securityConnector.validate(); - } - final String apiVersion = "2023-03-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - securityConnector, - accept, - context); - } - - /** - * Updates a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { - return updateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, - String securityConnectorName, - SecurityConnectorInner securityConnector, - Context context) { - return updateWithResponseAsync(resourceGroupName, securityConnectorName, securityConnector, context).block(); - } - - /** - * Updates a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param securityConnector The security connector resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityConnectorInner update( - String resourceGroupName, String securityConnectorName, SecurityConnectorInner securityConnector) { - return updateWithResponse(resourceGroupName, securityConnectorName, securityConnector, Context.NONE).getValue(); - } - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String securityConnectorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2023-03-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String resourceGroupName, String securityConnectorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (securityConnectorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityConnectorName is required and cannot be null.")); - } - final String apiVersion = "2023-03-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - securityConnectorName, - accept, - context); - } - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String securityConnectorName) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String securityConnectorName, Context context) { - return deleteWithResponseAsync(resourceGroupName, securityConnectorName, context).block(); - } - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String securityConnectorName) { - deleteWithResponse(resourceGroupName, securityConnectorName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsImpl.java deleted file mode 100644 index 7ca42cfa356d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityConnectorsImpl.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityConnectorsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; -import com.azure.resourcemanager.security.models.SecurityConnector; -import com.azure.resourcemanager.security.models.SecurityConnectors; - -public final class SecurityConnectorsImpl implements SecurityConnectors { - private static final ClientLogger LOGGER = new ClientLogger(SecurityConnectorsImpl.class); - - private final SecurityConnectorsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityConnectorsImpl( - SecurityConnectorsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new SecurityConnectorImpl(inner1, this.manager())); - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String securityConnectorName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecurityConnectorImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityConnector getByResourceGroup(String resourceGroupName, String securityConnectorName) { - SecurityConnectorInner inner = - this.serviceClient().getByResourceGroup(resourceGroupName, securityConnectorName); - if (inner != null) { - return new SecurityConnectorImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String securityConnectorName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, securityConnectorName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String securityConnectorName) { - this.serviceClient().delete(resourceGroupName, securityConnectorName); - } - - public SecurityConnector getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = Utils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = Utils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, securityConnectorName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = Utils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceGroupName, securityConnectorName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String securityConnectorName = Utils.getValueFromIdByName(id, "securityConnectors"); - if (securityConnectorName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'securityConnectors'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, securityConnectorName, context); - } - - private SecurityConnectorsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public SecurityConnectorImpl define(String name) { - return new SecurityConnectorImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactImpl.java deleted file mode 100644 index b2543af8c36e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactImpl.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; -import com.azure.resourcemanager.security.models.SecurityContact; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; - -public final class SecurityContactImpl implements SecurityContact, SecurityContact.Definition { - private SecurityContactInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecurityContactImpl( - SecurityContactInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String emails() { - return this.innerModel().emails(); - } - - public String phone() { - return this.innerModel().phone(); - } - - public SecurityContactPropertiesAlertNotifications alertNotifications() { - return this.innerModel().alertNotifications(); - } - - public SecurityContactPropertiesNotificationsByRole notificationsByRole() { - return this.innerModel().notificationsByRole(); - } - - public SecurityContactInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String securityContactName; - - public SecurityContact create() { - this.innerObject = - serviceManager - .serviceClient() - .getSecurityContacts() - .createWithResponse(securityContactName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public SecurityContact create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSecurityContacts() - .createWithResponse(securityContactName, this.innerModel(), context) - .getValue(); - return this; - } - - SecurityContactImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new SecurityContactInner(); - this.serviceManager = serviceManager; - this.securityContactName = name; - } - - public SecurityContact refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getSecurityContacts() - .getWithResponse(securityContactName, Context.NONE) - .getValue(); - return this; - } - - public SecurityContact refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getSecurityContacts() - .getWithResponse(securityContactName, context) - .getValue(); - return this; - } - - public SecurityContactImpl withEmails(String emails) { - this.innerModel().withEmails(emails); - return this; - } - - public SecurityContactImpl withPhone(String phone) { - this.innerModel().withPhone(phone); - return this; - } - - public SecurityContactImpl withAlertNotifications(SecurityContactPropertiesAlertNotifications alertNotifications) { - this.innerModel().withAlertNotifications(alertNotifications); - return this; - } - - public SecurityContactImpl withNotificationsByRole( - SecurityContactPropertiesNotificationsByRole notificationsByRole) { - this.innerModel().withNotificationsByRole(notificationsByRole); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsClientImpl.java deleted file mode 100644 index 0e358f62e47a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsClientImpl.java +++ /dev/null @@ -1,738 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecurityContactsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; -import com.azure.resourcemanager.security.models.SecurityContactList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SecurityContactsClient. */ -public final class SecurityContactsClientImpl implements SecurityContactsClient { - /** The proxy service used to perform REST calls. */ - private final SecurityContactsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityContactsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityContactsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(SecurityContactsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityContacts to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecuri") - public interface SecurityContactsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("securityContactName") String securityContactName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}") - @ExpectedResponses({200, 201}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("securityContactName") String securityContactName, - @BodyParam("application/json") SecurityContactInner securityContact, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("securityContactName") String securityContactName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * List all security contact configurations for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * List all security contact configurations for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * List all security contact configurations for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * List all security contact configurations for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * List all security contact configurations for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * List all security contact configurations for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String securityContactName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - securityContactName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String securityContactName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - securityContactName, - accept, - context); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String securityContactName) { - return getWithResponseAsync(securityContactName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String securityContactName, Context context) { - return getWithResponseAsync(securityContactName, context).block(); - } - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityContactInner get(String securityContactName) { - return getWithResponse(securityContactName, Context.NONE).getValue(); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String securityContactName, SecurityContactInner securityContact) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - if (securityContact == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContact is required and cannot be null.")); - } else { - securityContact.validate(); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - securityContactName, - securityContact, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud along with - * {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String securityContactName, SecurityContactInner securityContact, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - if (securityContact == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContact is required and cannot be null.")); - } else { - securityContact.validate(); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - securityContactName, - securityContact, - accept, - context); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String securityContactName, SecurityContactInner securityContact) { - return createWithResponseAsync(securityContactName, securityContact) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud along with - * {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String securityContactName, SecurityContactInner securityContact, Context context) { - return createWithResponseAsync(securityContactName, securityContact, context).block(); - } - - /** - * Create security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param securityContact Security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return contact details and configurations for notifications coming from Microsoft Defender for Cloud. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityContactInner create(String securityContactName, SecurityContactInner securityContact) { - return createWithResponse(securityContactName, securityContact, Context.NONE).getValue(); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String securityContactName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - securityContactName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String securityContactName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (securityContactName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityContactName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - securityContactName, - accept, - context); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String securityContactName) { - return deleteWithResponseAsync(securityContactName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String securityContactName, Context context) { - return deleteWithResponseAsync(securityContactName, context).block(); - } - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String securityContactName) { - deleteWithResponse(securityContactName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsImpl.java deleted file mode 100644 index 913f99337779..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityContactsImpl.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityContactsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; -import com.azure.resourcemanager.security.models.SecurityContact; -import com.azure.resourcemanager.security.models.SecurityContacts; - -public final class SecurityContactsImpl implements SecurityContacts { - private static final ClientLogger LOGGER = new ClientLogger(SecurityContactsImpl.class); - - private final SecurityContactsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityContactsImpl( - SecurityContactsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SecurityContactImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SecurityContactImpl(inner1, this.manager())); - } - - public Response getWithResponse(String securityContactName, Context context) { - Response inner = this.serviceClient().getWithResponse(securityContactName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecurityContactImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityContact get(String securityContactName) { - SecurityContactInner inner = this.serviceClient().get(securityContactName); - if (inner != null) { - return new SecurityContactImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String securityContactName, Context context) { - return this.serviceClient().deleteWithResponse(securityContactName, context); - } - - public void delete(String securityContactName) { - this.serviceClient().delete(securityContactName); - } - - public SecurityContact getById(String id) { - String securityContactName = Utils.getValueFromIdByName(id, "securityContacts"); - if (securityContactName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", id))); - } - return this.getWithResponse(securityContactName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String securityContactName = Utils.getValueFromIdByName(id, "securityContacts"); - if (securityContactName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", id))); - } - return this.getWithResponse(securityContactName, context); - } - - public void deleteById(String id) { - String securityContactName = Utils.getValueFromIdByName(id, "securityContacts"); - if (securityContactName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", id))); - } - this.deleteWithResponse(securityContactName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String securityContactName = Utils.getValueFromIdByName(id, "securityContacts"); - if (securityContactName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'securityContacts'.", id))); - } - return this.deleteWithResponse(securityContactName, context); - } - - private SecurityContactsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public SecurityContactImpl define(String name) { - return new SecurityContactImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorImpl.java deleted file mode 100644 index 3564896ce8d3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.models.Identity; -import com.azure.resourcemanager.security.models.SecurityOperator; - -public final class SecurityOperatorImpl implements SecurityOperator { - private SecurityOperatorInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecurityOperatorImpl( - SecurityOperatorInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public Identity identity() { - return this.innerModel().identity(); - } - - public SecurityOperatorInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorListImpl.java deleted file mode 100644 index 7298243843b0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorListImpl.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.SecurityOperatorInner; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorListInner; -import com.azure.resourcemanager.security.models.SecurityOperator; -import com.azure.resourcemanager.security.models.SecurityOperatorList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class SecurityOperatorListImpl implements SecurityOperatorList { - private SecurityOperatorListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecurityOperatorListImpl( - SecurityOperatorListInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new SecurityOperatorImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public SecurityOperatorListInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsClientImpl.java deleted file mode 100644 index cf7c403898ff..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsClientImpl.java +++ /dev/null @@ -1,661 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecurityOperatorsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorListInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SecurityOperatorsClient. */ -public final class SecurityOperatorsClientImpl implements SecurityOperatorsClient { - /** The proxy service used to perform REST calls. */ - private final SecurityOperatorsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecurityOperatorsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecurityOperatorsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(SecurityOperatorsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecurityOperators to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecuri") - public interface SecurityOperatorsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @PathParam("securityOperatorName") String securityOperatorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @PathParam("securityOperatorName") String securityOperatorName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("pricingName") String pricingName, - @PathParam("securityOperatorName") String securityOperatorName, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String pricingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String pricingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), pricingName, accept, context); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String pricingName) { - return listWithResponseAsync(pricingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String pricingName, Context context) { - return listWithResponseAsync(pricingName, context).block(); - } - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityOperatorListInner list(String pricingName) { - return listWithResponse(pricingName, Context.NONE).getValue(); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String pricingName, String securityOperatorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - securityOperatorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String pricingName, String securityOperatorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - securityOperatorName, - accept, - context); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String pricingName, String securityOperatorName) { - return getWithResponseAsync(pricingName, securityOperatorName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String pricingName, String securityOperatorName, Context context) { - return getWithResponseAsync(pricingName, securityOperatorName, context).block(); - } - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityOperatorInner get(String pricingName, String securityOperatorName) { - return getWithResponse(pricingName, securityOperatorName, Context.NONE).getValue(); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String pricingName, String securityOperatorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - securityOperatorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String pricingName, String securityOperatorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - securityOperatorName, - accept, - context); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String pricingName, String securityOperatorName) { - return createOrUpdateWithResponseAsync(pricingName, securityOperatorName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String pricingName, String securityOperatorName, Context context) { - return createOrUpdateWithResponseAsync(pricingName, securityOperatorName, context).block(); - } - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityOperatorInner createOrUpdate(String pricingName, String securityOperatorName) { - return createOrUpdateWithResponse(pricingName, securityOperatorName, Context.NONE).getValue(); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String pricingName, String securityOperatorName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - securityOperatorName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String pricingName, String securityOperatorName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (pricingName == null) { - return Mono.error(new IllegalArgumentException("Parameter pricingName is required and cannot be null.")); - } - if (securityOperatorName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securityOperatorName is required and cannot be null.")); - } - final String apiVersion = "2023-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - pricingName, - securityOperatorName, - accept, - context); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String pricingName, String securityOperatorName) { - return deleteWithResponseAsync(pricingName, securityOperatorName).flatMap(ignored -> Mono.empty()); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String pricingName, String securityOperatorName, Context context) { - return deleteWithResponseAsync(pricingName, securityOperatorName, context).block(); - } - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String pricingName, String securityOperatorName) { - deleteWithResponse(pricingName, securityOperatorName, Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsImpl.java deleted file mode 100644 index 57bc55c28211..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityOperatorsImpl.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SecurityOperatorsClient; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorListInner; -import com.azure.resourcemanager.security.models.SecurityOperator; -import com.azure.resourcemanager.security.models.SecurityOperatorList; -import com.azure.resourcemanager.security.models.SecurityOperators; - -public final class SecurityOperatorsImpl implements SecurityOperators { - private static final ClientLogger LOGGER = new ClientLogger(SecurityOperatorsImpl.class); - - private final SecurityOperatorsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecurityOperatorsImpl( - SecurityOperatorsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listWithResponse(String pricingName, Context context) { - Response inner = this.serviceClient().listWithResponse(pricingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecurityOperatorListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityOperatorList list(String pricingName) { - SecurityOperatorListInner inner = this.serviceClient().list(pricingName); - if (inner != null) { - return new SecurityOperatorListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String pricingName, String securityOperatorName, Context context) { - Response inner = - this.serviceClient().getWithResponse(pricingName, securityOperatorName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecurityOperatorImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityOperator get(String pricingName, String securityOperatorName) { - SecurityOperatorInner inner = this.serviceClient().get(pricingName, securityOperatorName); - if (inner != null) { - return new SecurityOperatorImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse( - String pricingName, String securityOperatorName, Context context) { - Response inner = - this.serviceClient().createOrUpdateWithResponse(pricingName, securityOperatorName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecurityOperatorImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityOperator createOrUpdate(String pricingName, String securityOperatorName) { - SecurityOperatorInner inner = this.serviceClient().createOrUpdate(pricingName, securityOperatorName); - if (inner != null) { - return new SecurityOperatorImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteByResourceGroupWithResponse( - String pricingName, String securityOperatorName, Context context) { - return this.serviceClient().deleteWithResponse(pricingName, securityOperatorName, context); - } - - public void deleteByResourceGroup(String pricingName, String securityOperatorName) { - this.serviceClient().delete(pricingName, securityOperatorName); - } - - private SecurityOperatorsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionImpl.java deleted file mode 100644 index daa171b42ba6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.azure.resourcemanager.security.models.SecuritySolution; - -public final class SecuritySolutionImpl implements SecuritySolution { - private SecuritySolutionInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecuritySolutionImpl( - SecuritySolutionInner 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 location() { - return this.innerModel().location(); - } - - public SecurityFamily securityFamily() { - return this.innerModel().securityFamily(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public String template() { - return this.innerModel().template(); - } - - public String protectionStatus() { - return this.innerModel().protectionStatus(); - } - - public SecuritySolutionInner 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/SecuritySolutionsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsClientImpl.java deleted file mode 100644 index 844b5caf9c4c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsClientImpl.java +++ /dev/null @@ -1,472 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner; -import com.azure.resourcemanager.security.models.SecuritySolutionList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SecuritySolutionsClient. */ -public final class SecuritySolutionsClientImpl implements SecuritySolutionsClient { - /** The proxy service used to perform REST calls. */ - private final SecuritySolutionsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecuritySolutionsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecuritySolutionsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(SecuritySolutionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecuritySolutions to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecuri") - public interface SecuritySolutionsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutions") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("securitySolutionName") String securitySolutionName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list of Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list of Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Security Solution along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ascLocation, String securitySolutionName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (securitySolutionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securitySolutionName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - securitySolutionName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Security Solution along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ascLocation, String securitySolutionName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (securitySolutionName == null) { - return Mono - .error(new IllegalArgumentException("Parameter securitySolutionName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - securitySolutionName, - apiVersion, - accept, - context); - } - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Security Solution on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String ascLocation, String securitySolutionName) { - return getWithResponseAsync(resourceGroupName, ascLocation, securitySolutionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Security Solution along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String ascLocation, String securitySolutionName, Context context) { - return getWithResponseAsync(resourceGroupName, ascLocation, securitySolutionName, context).block(); - } - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Security Solution. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecuritySolutionInner get(String resourceGroupName, String ascLocation, String securitySolutionName) { - return getWithResponse(resourceGroupName, ascLocation, securitySolutionName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsImpl.java deleted file mode 100644 index de0c90a619d3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsImpl.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.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.SecuritySolutionsClient; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner; -import com.azure.resourcemanager.security.models.SecuritySolution; -import com.azure.resourcemanager.security.models.SecuritySolutions; - -public final class SecuritySolutionsImpl implements SecuritySolutions { - private static final ClientLogger LOGGER = new ClientLogger(SecuritySolutionsImpl.class); - - private final SecuritySolutionsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecuritySolutionsImpl( - SecuritySolutionsClient 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 SecuritySolutionImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SecuritySolutionImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String resourceGroupName, String ascLocation, String securitySolutionName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, ascLocation, securitySolutionName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecuritySolutionImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecuritySolution get(String resourceGroupName, String ascLocation, String securitySolutionName) { - SecuritySolutionInner inner = this.serviceClient().get(resourceGroupName, ascLocation, securitySolutionName); - if (inner != null) { - return new SecuritySolutionImpl(inner, this.manager()); - } else { - return null; - } - } - - private SecuritySolutionsClient 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/SecuritySolutionsReferenceDataListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDataListImpl.java deleted file mode 100644 index 0e961ffe1342..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDataListImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataListInner; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceData; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDataList; -import java.util.Collections; -import java.util.List; - -public final class SecuritySolutionsReferenceDataListImpl implements SecuritySolutionsReferenceDataList { - private SecuritySolutionsReferenceDataListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecuritySolutionsReferenceDataListImpl( - SecuritySolutionsReferenceDataListInner innerObject, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public SecuritySolutionsReferenceDataListInner 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/SecuritySolutionsReferenceDatasClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDatasClientImpl.java deleted file mode 100644 index 55a07eae1bac..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDatasClientImpl.java +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SecuritySolutionsReferenceDatasClient; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataListInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SecuritySolutionsReferenceDatasClient. */ -public final class SecuritySolutionsReferenceDatasClientImpl implements SecuritySolutionsReferenceDatasClient { - /** The proxy service used to perform REST calls. */ - private final SecuritySolutionsReferenceDatasService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SecuritySolutionsReferenceDatasClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SecuritySolutionsReferenceDatasClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - SecuritySolutionsReferenceDatasService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSecuritySolutionsReferenceDatas to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSecuri") - public interface SecuritySolutionsReferenceDatasService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutionsReferenceData") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutionsReferenceData") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context); - } - - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); - } - - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecuritySolutionsReferenceDataListInner list() { - return listWithResponse(Context.NONE).getValue(); - } - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionWithResponseAsync( - String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByHomeRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionWithResponseAsync( - String ascLocation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegion( - this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, accept, context); - } - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listByHomeRegionAsync(String ascLocation) { - return listByHomeRegionWithResponseAsync(ascLocation).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listByHomeRegionWithResponse( - String ascLocation, Context context) { - return listByHomeRegionWithResponseAsync(ascLocation, context).block(); - } - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecuritySolutionsReferenceDataListInner listByHomeRegion(String ascLocation) { - return listByHomeRegionWithResponse(ascLocation, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDatasImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDatasImpl.java deleted file mode 100644 index f3c696de64ae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySolutionsReferenceDatasImpl.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.SecuritySolutionsReferenceDatasClient; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataListInner; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDataList; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDatas; - -public final class SecuritySolutionsReferenceDatasImpl implements SecuritySolutionsReferenceDatas { - private static final ClientLogger LOGGER = new ClientLogger(SecuritySolutionsReferenceDatasImpl.class); - - private final SecuritySolutionsReferenceDatasClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SecuritySolutionsReferenceDatasImpl( - SecuritySolutionsReferenceDatasClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecuritySolutionsReferenceDataListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecuritySolutionsReferenceDataList list() { - SecuritySolutionsReferenceDataListInner inner = this.serviceClient().list(); - if (inner != null) { - return new SecuritySolutionsReferenceDataListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listByHomeRegionWithResponse( - String ascLocation, Context context) { - Response inner = - this.serviceClient().listByHomeRegionWithResponse(ascLocation, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecuritySolutionsReferenceDataListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecuritySolutionsReferenceDataList listByHomeRegion(String ascLocation) { - SecuritySolutionsReferenceDataListInner inner = this.serviceClient().listByHomeRegion(ascLocation); - if (inner != null) { - return new SecuritySolutionsReferenceDataListImpl(inner, this.manager()); - } else { - return null; - } - } - - private SecuritySolutionsReferenceDatasClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySubAssessmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySubAssessmentImpl.java deleted file mode 100644 index 3fb497b072b7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecuritySubAssessmentImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner; -import com.azure.resourcemanager.security.models.AdditionalData; -import com.azure.resourcemanager.security.models.ResourceDetails; -import com.azure.resourcemanager.security.models.SecuritySubAssessment; -import com.azure.resourcemanager.security.models.SubAssessmentStatus; -import java.time.OffsetDateTime; - -public final class SecuritySubAssessmentImpl implements SecuritySubAssessment { - private SecuritySubAssessmentInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecuritySubAssessmentImpl( - SecuritySubAssessmentInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String idPropertiesId() { - return this.innerModel().idPropertiesId(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public SubAssessmentStatus status() { - return this.innerModel().status(); - } - - public String remediation() { - return this.innerModel().remediation(); - } - - public String impact() { - return this.innerModel().impact(); - } - - public String category() { - return this.innerModel().category(); - } - - public String description() { - return this.innerModel().description(); - } - - public OffsetDateTime timeGenerated() { - return this.innerModel().timeGenerated(); - } - - public ResourceDetails resourceDetails() { - return this.innerModel().resourceDetails(); - } - - public AdditionalData additionalData() { - return this.innerModel().additionalData(); - } - - public SecuritySubAssessmentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityTaskImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityTaskImpl.java deleted file mode 100644 index 6d71c09739a1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityTaskImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.SecurityTaskInner; -import com.azure.resourcemanager.security.models.SecurityTask; -import com.azure.resourcemanager.security.models.SecurityTaskParameters; -import java.time.OffsetDateTime; - -public final class SecurityTaskImpl implements SecurityTask { - private SecurityTaskInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SecurityTaskImpl(SecurityTaskInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String state() { - return this.innerModel().state(); - } - - public OffsetDateTime creationTimeUtc() { - return this.innerModel().creationTimeUtc(); - } - - public SecurityTaskParameters securityTaskParameters() { - return this.innerModel().securityTaskParameters(); - } - - public OffsetDateTime lastStateChangeTimeUtc() { - return this.innerModel().lastStateChangeTimeUtc(); - } - - public String subState() { - return this.innerModel().subState(); - } - - public SecurityTaskInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentImpl.java deleted file mode 100644 index f12420391d62..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentImpl.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.ServerVulnerabilityAssessmentInner; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessment; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentPropertiesProvisioningState; - -public final class ServerVulnerabilityAssessmentImpl implements ServerVulnerabilityAssessment { - private ServerVulnerabilityAssessmentInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ServerVulnerabilityAssessmentImpl( - ServerVulnerabilityAssessmentInner 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 ServerVulnerabilityAssessmentPropertiesProvisioningState provisioningState() { - return this.innerModel().provisioningState(); - } - - public ServerVulnerabilityAssessmentInner 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/ServerVulnerabilityAssessmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsClientImpl.java deleted file mode 100644 index b84a55fa6e48..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsClientImpl.java +++ /dev/null @@ -1,995 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.security.fluent.ServerVulnerabilityAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsListInner; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ServerVulnerabilityAssessmentsClient. */ -public final class ServerVulnerabilityAssessmentsClientImpl implements ServerVulnerabilityAssessmentsClient { - /** The proxy service used to perform REST calls. */ - private final ServerVulnerabilityAssessmentsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of ServerVulnerabilityAssessmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ServerVulnerabilityAssessmentsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - ServerVulnerabilityAssessmentsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterServerVulnerabilityAssessments to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterServer") - public interface ServerVulnerabilityAssessmentsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByExtendedResource( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @PathParam("serverVulnerabilityAssessment") String serverVulnerabilityAssessment, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}") - @ExpectedResponses({202}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @PathParam("serverVulnerabilityAssessment") String serverVulnerabilityAssessment, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}") - @ExpectedResponses({200, 202, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @PathParam("serverVulnerabilityAssessment") String serverVulnerabilityAssessment, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server vulnerability assessment onboarding statuses on a given resource along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceWithResponseAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByExtendedResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server vulnerability assessment onboarding statuses on a given resource along with {@link - * Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceWithResponseAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByExtendedResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - apiVersion, - accept, - context); - } - - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server vulnerability assessment onboarding statuses on a given resource on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listByExtendedResourceAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return listByExtendedResourceWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server vulnerability assessment onboarding statuses on a given resource along with {@link - * Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listByExtendedResourceWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - return listByExtendedResourceWithResponseAsync( - resourceGroupName, resourceNamespace, resourceType, resourceName, context) - .block(); - } - - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server vulnerability assessment onboarding statuses on a given resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerVulnerabilityAssessmentsListInner listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return listByExtendedResourceWithResponse( - resourceGroupName, resourceNamespace, resourceType, resourceName, Context.NONE) - .getValue(); - } - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server vulnerability assessment onboarding statuses on a given resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String serverVulnerabilityAssessment = "default"; - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - serverVulnerabilityAssessment, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server vulnerability assessment onboarding statuses on a given resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String serverVulnerabilityAssessment = "default"; - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - serverVulnerabilityAssessment, - apiVersion, - accept, - context); - } - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server vulnerability assessment onboarding statuses on a given resource on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return getWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server vulnerability assessment onboarding statuses on a given resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - return getWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context).block(); - } - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server vulnerability assessment onboarding statuses on a given resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerVulnerabilityAssessmentInner get( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return getWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, Context.NONE) - .getValue(); - } - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the server vulnerability assessment details on a resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String serverVulnerabilityAssessment = "default"; - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - serverVulnerabilityAssessment, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the server vulnerability assessment details on a resource along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String serverVulnerabilityAssessment = "default"; - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - serverVulnerabilityAssessment, - apiVersion, - accept, - context); - } - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the server vulnerability assessment details on a resource on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return createOrUpdateWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the server vulnerability assessment details on a resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - return createOrUpdateWithResponseAsync( - resourceGroupName, resourceNamespace, resourceType, resourceName, context) - .block(); - } - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the server vulnerability assessment details on a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ServerVulnerabilityAssessmentInner createOrUpdate( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return createOrUpdateWithResponse( - resourceGroupName, resourceNamespace, resourceType, resourceName, Context.NONE) - .getValue(); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String serverVulnerabilityAssessment = "default"; - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - serverVulnerabilityAssessment, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String serverVulnerabilityAssessment = "default"; - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - serverVulnerabilityAssessment, - apiVersion, - accept, - context); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = - deleteWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return this.beginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName).getSyncPoller(); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - return this - .beginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context) - .getSyncPoller(); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return beginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - return beginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - deleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName).block(); - } - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - deleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context).block(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsImpl.java deleted file mode 100644 index 2538bf7d5ba3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsImpl.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.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.ServerVulnerabilityAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsListInner; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessment; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessments; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsList; - -public final class ServerVulnerabilityAssessmentsImpl implements ServerVulnerabilityAssessments { - private static final ClientLogger LOGGER = new ClientLogger(ServerVulnerabilityAssessmentsImpl.class); - - private final ServerVulnerabilityAssessmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public ServerVulnerabilityAssessmentsImpl( - ServerVulnerabilityAssessmentsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response listByExtendedResourceWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - Response inner = - this - .serviceClient() - .listByExtendedResourceWithResponse( - resourceGroupName, resourceNamespace, resourceType, resourceName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ServerVulnerabilityAssessmentsListImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ServerVulnerabilityAssessmentsList listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - ServerVulnerabilityAssessmentsListInner inner = - this - .serviceClient() - .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName); - if (inner != null) { - return new ServerVulnerabilityAssessmentsListImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response getWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - Response inner = - this - .serviceClient() - .getWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ServerVulnerabilityAssessmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ServerVulnerabilityAssessment get( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - ServerVulnerabilityAssessmentInner inner = - this.serviceClient().get(resourceGroupName, resourceNamespace, resourceType, resourceName); - if (inner != null) { - return new ServerVulnerabilityAssessmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response createOrUpdateWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - Response inner = - this - .serviceClient() - .createOrUpdateWithResponse(resourceGroupName, resourceNamespace, resourceType, resourceName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ServerVulnerabilityAssessmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ServerVulnerabilityAssessment createOrUpdate( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - ServerVulnerabilityAssessmentInner inner = - this.serviceClient().createOrUpdate(resourceGroupName, resourceNamespace, resourceType, resourceName); - if (inner != null) { - return new ServerVulnerabilityAssessmentImpl(inner, this.manager()); - } else { - return null; - } - } - - public void delete(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - this.serviceClient().delete(resourceGroupName, resourceNamespace, resourceType, resourceName); - } - - public void delete( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - this.serviceClient().delete(resourceGroupName, resourceNamespace, resourceType, resourceName, context); - } - - private ServerVulnerabilityAssessmentsClient 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/ServerVulnerabilityAssessmentsListImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsListImpl.java deleted file mode 100644 index cc84ed836c77..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ServerVulnerabilityAssessmentsListImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsListInner; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessment; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -public final class ServerVulnerabilityAssessmentsListImpl implements ServerVulnerabilityAssessmentsList { - private ServerVulnerabilityAssessmentsListInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - ServerVulnerabilityAssessmentsListImpl( - ServerVulnerabilityAssessmentsListInner 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 ServerVulnerabilityAssessmentImpl(inner1, this.manager())) - .collect(Collectors.toList())); - } else { - return Collections.emptyList(); - } - } - - public ServerVulnerabilityAssessmentsListInner 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/SettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingImpl.java deleted file mode 100644 index b1cc67401d2e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingImpl.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.implementation; - -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.azure.resourcemanager.security.models.Setting; - -public final class SettingImpl implements Setting { - private SettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SettingImpl(SettingInner 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 SettingInner 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/SettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java deleted file mode 100644 index 80ec076b1e33..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsClientImpl.java +++ /dev/null @@ -1,574 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SettingsClient; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.azure.resourcemanager.security.models.SettingName; -import com.azure.resourcemanager.security.models.SettingsList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SettingsClient. */ -public final class SettingsClientImpl implements SettingsClient { - /** The proxy service used to perform REST calls. */ - private final SettingsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SettingsClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(SettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSettings to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSettin") - public interface SettingsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings") - @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/settings/{settingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") SettingName settingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("settingName") SettingName settingName, - @BodyParam("application/json") SettingInner setting, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription settings list along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription settings list along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2022-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription settings list as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription settings list as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription settings list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription settings list as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(SettingName settingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2022-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - settingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(SettingName settingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - final String apiVersion = "2022-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), settingName, accept, context); - } - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(SettingName settingName) { - return getWithResponseAsync(settingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(SettingName settingName, Context context) { - return getWithResponseAsync(settingName, context).block(); - } - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SettingInner get(SettingName settingName) { - return getWithResponse(settingName, Context.NONE).getValue(); - } - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(SettingName settingName, SettingInner setting) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (setting == null) { - return Mono.error(new IllegalArgumentException("Parameter setting is required and cannot be null.")); - } else { - setting.validate(); - } - final String apiVersion = "2022-05-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - settingName, - setting, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - SettingName settingName, SettingInner setting, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (settingName == null) { - return Mono.error(new IllegalArgumentException("Parameter settingName is required and cannot be null.")); - } - if (setting == null) { - return Mono.error(new IllegalArgumentException("Parameter setting is required and cannot be null.")); - } else { - setting.validate(); - } - final String apiVersion = "2022-05-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - settingName, - setting, - accept, - context); - } - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(SettingName settingName, SettingInner setting) { - return updateWithResponseAsync(settingName, setting).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(SettingName settingName, SettingInner setting, Context context) { - return updateWithResponseAsync(settingName, setting, context).block(); - } - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SettingInner update(SettingName settingName, SettingInner setting) { - return updateWithResponse(settingName, setting, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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 subscription settings list along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsImpl.java deleted file mode 100644 index 4c370425ade5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SettingsImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.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.SettingsClient; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.azure.resourcemanager.security.models.Setting; -import com.azure.resourcemanager.security.models.SettingName; -import com.azure.resourcemanager.security.models.Settings; - -public final class SettingsImpl implements Settings { - private static final ClientLogger LOGGER = new ClientLogger(SettingsImpl.class); - - private final SettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SettingsImpl(SettingsClient 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 SettingImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SettingImpl(inner1, this.manager())); - } - - public Response getWithResponse(SettingName settingName, Context context) { - Response inner = this.serviceClient().getWithResponse(settingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Setting get(SettingName settingName) { - SettingInner inner = this.serviceClient().get(settingName); - if (inner != null) { - return new SettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateWithResponse(SettingName settingName, SettingInner setting, Context context) { - Response inner = this.serviceClient().updateWithResponse(settingName, setting, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Setting update(SettingName settingName, SettingInner setting) { - SettingInner inner = this.serviceClient().update(settingName, setting); - if (inner != null) { - return new SettingImpl(inner, this.manager()); - } else { - return null; - } - } - - private SettingsClient 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/SoftwareImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareImpl.java deleted file mode 100644 index 53f34853574e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.SoftwareInner; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import com.azure.resourcemanager.security.models.Software; - -public final class SoftwareImpl implements Software { - private SoftwareInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - SoftwareImpl(SoftwareInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String deviceId() { - return this.innerModel().deviceId(); - } - - public String osPlatform() { - return this.innerModel().osPlatform(); - } - - public String vendor() { - return this.innerModel().vendor(); - } - - public String softwareName() { - return this.innerModel().softwareName(); - } - - public String version() { - return this.innerModel().version(); - } - - public EndOfSupportStatus endOfSupportStatus() { - return this.innerModel().endOfSupportStatus(); - } - - public String endOfSupportDate() { - return this.innerModel().endOfSupportDate(); - } - - public Integer numberOfKnownVulnerabilities() { - return this.innerModel().numberOfKnownVulnerabilities(); - } - - public String firstSeenAt() { - return this.innerModel().firstSeenAt(); - } - - public SoftwareInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesClientImpl.java deleted file mode 100644 index 9136222bcbf7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesClientImpl.java +++ /dev/null @@ -1,862 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SoftwareInventoriesClient; -import com.azure.resourcemanager.security.fluent.models.SoftwareInner; -import com.azure.resourcemanager.security.models.SoftwaresList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SoftwareInventoriesClient. */ -public final class SoftwareInventoriesClientImpl implements SoftwareInventoriesClient { - /** The proxy service used to perform REST calls. */ - private final SoftwareInventoriesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SoftwareInventoriesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SoftwareInventoriesClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(SoftwareInventoriesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSoftwareInventories to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSoftwa") - public interface SoftwareInventoriesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByExtendedResource( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("resourceNamespace") String resourceNamespace, - @PathParam("resourceType") String resourceType, - @PathParam("resourceName") String resourceName, - @PathParam("softwareName") String softwareName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByExtendedResourceNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of the virtual machine along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceSinglePageAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2021-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByExtendedResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of the virtual machine along with {@link PagedResponse} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceSinglePageAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - final String apiVersion = "2021-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByExtendedResource( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - apiVersion, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of the virtual machine as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByExtendedResourceAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return new PagedFlux<>( - () -> - listByExtendedResourceSinglePageAsync(resourceGroupName, resourceNamespace, resourceType, resourceName), - nextLink -> listByExtendedResourceNextSinglePageAsync(nextLink)); - } - - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of the virtual machine as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByExtendedResourceAsync( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - return new PagedFlux<>( - () -> - listByExtendedResourceSinglePageAsync( - resourceGroupName, resourceNamespace, resourceType, resourceName, context), - nextLink -> listByExtendedResourceNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of the virtual machine as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - return new PagedIterable<>( - listByExtendedResourceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName)); - } - - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of the virtual machine as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - return new PagedIterable<>( - listByExtendedResourceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, context)); - } - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2021-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); - } - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single software data of the virtual machine along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (softwareName == null) { - return Mono.error(new IllegalArgumentException("Parameter softwareName is required and cannot be null.")); - } - final String apiVersion = "2021-05-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - softwareName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single software data of the virtual machine along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (resourceNamespace == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceNamespace is required and cannot be null.")); - } - if (resourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null.")); - } - if (resourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null.")); - } - if (softwareName == null) { - return Mono.error(new IllegalArgumentException("Parameter softwareName is required and cannot be null.")); - } - final String apiVersion = "2021-05-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - resourceNamespace, - resourceType, - resourceName, - softwareName, - apiVersion, - accept, - context); - } - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single software data of the virtual machine on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName) { - return getWithResponseAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single software data of the virtual machine along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName, - Context context) { - return getWithResponseAsync( - resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName, context) - .block(); - } - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single software data of the virtual machine. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SoftwareInner get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName) { - return getWithResponse( - resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName, Context.NONE) - .getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 represents the software inventory of the virtual machine along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByExtendedResourceNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 represents the software inventory of the virtual machine along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByExtendedResourceNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByExtendedResourceNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 represents the software inventory of the virtual machine along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 represents the software inventory of the virtual machine along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesImpl.java deleted file mode 100644 index fdbee743a320..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SoftwareInventoriesImpl.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SoftwareInventoriesClient; -import com.azure.resourcemanager.security.fluent.models.SoftwareInner; -import com.azure.resourcemanager.security.models.Software; -import com.azure.resourcemanager.security.models.SoftwareInventories; - -public final class SoftwareInventoriesImpl implements SoftwareInventories { - private static final ClientLogger LOGGER = new ClientLogger(SoftwareInventoriesImpl.class); - - private final SoftwareInventoriesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SoftwareInventoriesImpl( - SoftwareInventoriesClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName) { - PagedIterable inner = - this - .serviceClient() - .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName); - return Utils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); - } - - public PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context) { - PagedIterable inner = - this - .serviceClient() - .listByExtendedResource(resourceGroupName, resourceNamespace, resourceType, resourceName, context); - return Utils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new SoftwareImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName, - Context context) { - Response inner = - this - .serviceClient() - .getWithResponse( - resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SoftwareImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Software get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName) { - SoftwareInner inner = - this.serviceClient().get(resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName); - if (inner != null) { - return new SoftwareImpl(inner, this.manager()); - } else { - return null; - } - } - - private SoftwareInventoriesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesClientImpl.java deleted file mode 100644 index 434e0aa1a792..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesClientImpl.java +++ /dev/null @@ -1,768 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentBaselineRulesClient; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.fluent.models.RulesResultsInner; -import com.azure.resourcemanager.security.models.RuleResultsInput; -import com.azure.resourcemanager.security.models.RulesResultsInput; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * SqlVulnerabilityAssessmentBaselineRulesClient. - */ -public final class SqlVulnerabilityAssessmentBaselineRulesClientImpl - implements SqlVulnerabilityAssessmentBaselineRulesClient { - /** The proxy service used to perform REST calls. */ - private final SqlVulnerabilityAssessmentBaselineRulesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SqlVulnerabilityAssessmentBaselineRulesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SqlVulnerabilityAssessmentBaselineRulesClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - SqlVulnerabilityAssessmentBaselineRulesService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSqlVulnerabilityAssessmentBaselineRules to be used by - * the proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSqlVul") - public interface SqlVulnerabilityAssessmentBaselineRulesService { - @Headers({"Content-Type: application/json"}) - @Put("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam("ruleId") String ruleId, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @BodyParam("application/json") RuleResultsInput body, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("ruleId") String ruleId, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam("ruleId") String ruleId, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> add( - @HostParam("$host") String endpoint, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @BodyParam("application/json") RulesResultsInput body, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline results for this rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rule results along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String ruleId, String workspaceId, String resourceId, RuleResultsInput body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - ruleId, - workspaceId, - apiVersion, - resourceId, - body, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline results for this rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rule results along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String ruleId, String workspaceId, String resourceId, RuleResultsInput body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, body, accept, context); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rule results on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String ruleId, String workspaceId, String resourceId) { - final RuleResultsInput body = null; - return createOrUpdateWithResponseAsync(ruleId, workspaceId, resourceId, body) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline results for this rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rule results along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String ruleId, String workspaceId, String resourceId, RuleResultsInput body, Context context) { - return createOrUpdateWithResponseAsync(ruleId, workspaceId, resourceId, body, context).block(); - } - - /** - * Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return rule results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RuleResultsInner createOrUpdate(String ruleId, String workspaceId, String resourceId) { - final RuleResultsInput body = null; - return createOrUpdateWithResponse(ruleId, workspaceId, resourceId, body, Context.NONE).getValue(); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String ruleId, String workspaceId, String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String ruleId, String workspaceId, String resourceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, accept, context); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String ruleId, String workspaceId, String resourceId) { - return getWithResponseAsync(ruleId, workspaceId, resourceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String ruleId, String workspaceId, String resourceId, Context context) { - return getWithResponseAsync(ruleId, workspaceId, resourceId, context).block(); - } - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RuleResultsInner get(String ruleId, String workspaceId, String resourceId) { - return getWithResponse(ruleId, workspaceId, resourceId, Context.NONE).getValue(); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String ruleId, String workspaceId, String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync( - String ruleId, String workspaceId, String resourceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (ruleId == null) { - return Mono.error(new IllegalArgumentException("Parameter ruleId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), ruleId, workspaceId, apiVersion, resourceId, accept, context); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String ruleId, String workspaceId, String resourceId) { - return deleteWithResponseAsync(ruleId, workspaceId, resourceId).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String ruleId, String workspaceId, String resourceId, Context context) { - return deleteWithResponseAsync(ruleId, workspaceId, resourceId, context).block(); - } - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String ruleId, String workspaceId, String resourceId) { - deleteWithResponse(ruleId, workspaceId, resourceId, Context.NONE); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String workspaceId, String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.list(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String workspaceId, String resourceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, accept, context); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String workspaceId, String resourceId) { - return listWithResponseAsync(workspaceId, resourceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String workspaceId, String resourceId, Context context) { - return listWithResponseAsync(workspaceId, resourceId, context).block(); - } - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RulesResultsInner list(String workspaceId, String resourceId) { - return listWithResponse(workspaceId, resourceId, Context.NONE).getValue(); - } - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline rules. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of rules results along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> addWithResponseAsync( - String workspaceId, String resourceId, RulesResultsInput body) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.add(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, body, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline rules. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of rules results along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> addWithResponseAsync( - String workspaceId, String resourceId, RulesResultsInput body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - if (body != null) { - body.validate(); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.add(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, body, accept, context); - } - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of rules results on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono addAsync(String workspaceId, String resourceId) { - final RulesResultsInput body = null; - return addWithResponseAsync(workspaceId, resourceId, body).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline rules. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of rules results along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response addWithResponse( - String workspaceId, String resourceId, RulesResultsInput body, Context context) { - return addWithResponseAsync(workspaceId, resourceId, body, context).block(); - } - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of rules results. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RulesResultsInner add(String workspaceId, String resourceId) { - final RulesResultsInput body = null; - return addWithResponse(workspaceId, resourceId, body, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesImpl.java deleted file mode 100644 index 2f3bbda29751..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentBaselineRulesImpl.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.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentBaselineRulesClient; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.fluent.models.RulesResultsInner; -import com.azure.resourcemanager.security.models.RuleResults; -import com.azure.resourcemanager.security.models.RulesResults; -import com.azure.resourcemanager.security.models.RulesResultsInput; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentBaselineRules; - -public final class SqlVulnerabilityAssessmentBaselineRulesImpl implements SqlVulnerabilityAssessmentBaselineRules { - private static final ClientLogger LOGGER = new ClientLogger(SqlVulnerabilityAssessmentBaselineRulesImpl.class); - - private final SqlVulnerabilityAssessmentBaselineRulesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SqlVulnerabilityAssessmentBaselineRulesImpl( - SqlVulnerabilityAssessmentBaselineRulesClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse( - String ruleId, String workspaceId, String resourceId, Context context) { - Response inner = - this.serviceClient().getWithResponse(ruleId, workspaceId, resourceId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new RuleResultsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RuleResults get(String ruleId, String workspaceId, String resourceId) { - RuleResultsInner inner = this.serviceClient().get(ruleId, workspaceId, resourceId); - if (inner != null) { - return new RuleResultsImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String ruleId, String workspaceId, String resourceId, Context context) { - return this.serviceClient().deleteWithResponse(ruleId, workspaceId, resourceId, context); - } - - public void delete(String ruleId, String workspaceId, String resourceId) { - this.serviceClient().delete(ruleId, workspaceId, resourceId); - } - - public Response listWithResponse(String workspaceId, String resourceId, Context context) { - Response inner = this.serviceClient().listWithResponse(workspaceId, resourceId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new RulesResultsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RulesResults list(String workspaceId, String resourceId) { - RulesResultsInner inner = this.serviceClient().list(workspaceId, resourceId); - if (inner != null) { - return new RulesResultsImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response addWithResponse( - String workspaceId, String resourceId, RulesResultsInput body, Context context) { - Response inner = - this.serviceClient().addWithResponse(workspaceId, resourceId, body, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new RulesResultsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RulesResults add(String workspaceId, String resourceId) { - RulesResultsInner inner = this.serviceClient().add(workspaceId, resourceId); - if (inner != null) { - return new RulesResultsImpl(inner, this.manager()); - } else { - return null; - } - } - - private SqlVulnerabilityAssessmentBaselineRulesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public RuleResultsImpl define(String name) { - return new RuleResultsImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsClientImpl.java deleted file mode 100644 index ba2ec1708d83..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsClientImpl.java +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScanResultsClient; -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.fluent.models.ScanResultsInner; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in - * SqlVulnerabilityAssessmentScanResultsClient. - */ -public final class SqlVulnerabilityAssessmentScanResultsClientImpl - implements SqlVulnerabilityAssessmentScanResultsClient { - /** The proxy service used to perform REST calls. */ - private final SqlVulnerabilityAssessmentScanResultsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SqlVulnerabilityAssessmentScanResultsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SqlVulnerabilityAssessmentScanResultsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - SqlVulnerabilityAssessmentScanResultsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSqlVulnerabilityAssessmentScanResults to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSqlVul") - public interface SqlVulnerabilityAssessmentScanResultsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("scanId") String scanId, - @PathParam("scanResultId") String scanResultId, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("scanId") String scanId, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scanId, String scanResultId, String workspaceId, String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (scanResultId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanResultId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - scanId, - scanResultId, - workspaceId, - apiVersion, - resourceId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scanId, String scanResultId, String workspaceId, String resourceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (scanResultId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanResultId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), scanId, scanResultId, workspaceId, apiVersion, resourceId, accept, context); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scanId, String scanResultId, String workspaceId, String resourceId) { - return getWithResponseAsync(scanId, scanResultId, workspaceId, resourceId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String scanId, String scanResultId, String workspaceId, String resourceId, Context context) { - return getWithResponseAsync(scanId, scanResultId, workspaceId, resourceId, context).block(); - } - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScanResultInner get(String scanId, String scanResultId, String workspaceId, String resourceId) { - return getWithResponse(scanId, scanResultId, workspaceId, resourceId, Context.NONE).getValue(); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan results for a single scan record along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String scanId, String workspaceId, String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), scanId, workspaceId, apiVersion, resourceId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan results for a single scan record along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String scanId, String workspaceId, String resourceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), scanId, workspaceId, apiVersion, resourceId, accept, context); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan results for a single scan record on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String scanId, String workspaceId, String resourceId) { - return listWithResponseAsync(scanId, workspaceId, resourceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan results for a single scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String scanId, String workspaceId, String resourceId, Context context) { - return listWithResponseAsync(scanId, workspaceId, resourceId, context).block(); - } - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan results for a single scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScanResultsInner list(String scanId, String workspaceId, String resourceId) { - return listWithResponse(scanId, workspaceId, resourceId, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsImpl.java deleted file mode 100644 index ede3a2500e80..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScanResultsImpl.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScanResultsClient; -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.fluent.models.ScanResultsInner; -import com.azure.resourcemanager.security.models.ScanResult; -import com.azure.resourcemanager.security.models.ScanResults; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScanResults; - -public final class SqlVulnerabilityAssessmentScanResultsImpl implements SqlVulnerabilityAssessmentScanResults { - private static final ClientLogger LOGGER = new ClientLogger(SqlVulnerabilityAssessmentScanResultsImpl.class); - - private final SqlVulnerabilityAssessmentScanResultsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SqlVulnerabilityAssessmentScanResultsImpl( - SqlVulnerabilityAssessmentScanResultsClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse( - String scanId, String scanResultId, String workspaceId, String resourceId, Context context) { - Response inner = - this.serviceClient().getWithResponse(scanId, scanResultId, workspaceId, resourceId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ScanResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ScanResult get(String scanId, String scanResultId, String workspaceId, String resourceId) { - ScanResultInner inner = this.serviceClient().get(scanId, scanResultId, workspaceId, resourceId); - if (inner != null) { - return new ScanResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse( - String scanId, String workspaceId, String resourceId, Context context) { - Response inner = - this.serviceClient().listWithResponse(scanId, workspaceId, resourceId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ScanResultsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ScanResults list(String scanId, String workspaceId, String resourceId) { - ScanResultsInner inner = this.serviceClient().list(scanId, workspaceId, resourceId); - if (inner != null) { - return new ScanResultsImpl(inner, this.manager()); - } else { - return null; - } - } - - private SqlVulnerabilityAssessmentScanResultsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansClientImpl.java deleted file mode 100644 index 3a315100d9df..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansClientImpl.java +++ /dev/null @@ -1,319 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SqlVulnerabilityAssessmentScansClient; -import com.azure.resourcemanager.security.fluent.models.ScanInner; -import com.azure.resourcemanager.security.fluent.models.ScansInner; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SqlVulnerabilityAssessmentScansClient. */ -public final class SqlVulnerabilityAssessmentScansClientImpl implements SqlVulnerabilityAssessmentScansClient { - /** The proxy service used to perform REST calls. */ - private final SqlVulnerabilityAssessmentScansService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SqlVulnerabilityAssessmentScansClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SqlVulnerabilityAssessmentScansClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy - .create( - SqlVulnerabilityAssessmentScansService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSqlVulnerabilityAssessmentScans to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSqlVul") - public interface SqlVulnerabilityAssessmentScansService { - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("scanId") String scanId, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("workspaceId") String workspaceId, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "resourceId", encoded = true) String resourceId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scanId, String workspaceId, String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get(this.client.getEndpoint(), scanId, workspaceId, apiVersion, resourceId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scanId, String workspaceId, String resourceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scanId == null) { - return Mono.error(new IllegalArgumentException("Parameter scanId is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), scanId, workspaceId, apiVersion, resourceId, accept, context); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scanId, String workspaceId, String resourceId) { - return getWithResponseAsync(scanId, workspaceId, resourceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scanId, String workspaceId, String resourceId, Context context) { - return getWithResponseAsync(scanId, workspaceId, resourceId, context).block(); - } - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScanInner get(String scanId, String workspaceId, String resourceId) { - return getWithResponse(scanId, workspaceId, resourceId, Context.NONE).getValue(); - } - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan records along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String workspaceId, String resourceId) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service.list(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan records along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(String workspaceId, String resourceId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (workspaceId == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceId is required and cannot be null.")); - } - if (resourceId == null) { - return Mono.error(new IllegalArgumentException("Parameter resourceId is required and cannot be null.")); - } - final String apiVersion = "2023-02-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), workspaceId, apiVersion, resourceId, accept, context); - } - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan records on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync(String workspaceId, String resourceId) { - return listWithResponseAsync(workspaceId, resourceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan records along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(String workspaceId, String resourceId, Context context) { - return listWithResponseAsync(workspaceId, resourceId, context).block(); - } - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan records. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ScansInner list(String workspaceId, String resourceId) { - return listWithResponse(workspaceId, resourceId, Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansImpl.java deleted file mode 100644 index 8f16764d6269..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SqlVulnerabilityAssessmentScansImpl.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.SqlVulnerabilityAssessmentScansClient; -import com.azure.resourcemanager.security.fluent.models.ScanInner; -import com.azure.resourcemanager.security.fluent.models.ScansInner; -import com.azure.resourcemanager.security.models.Scan; -import com.azure.resourcemanager.security.models.Scans; -import com.azure.resourcemanager.security.models.SqlVulnerabilityAssessmentScans; - -public final class SqlVulnerabilityAssessmentScansImpl implements SqlVulnerabilityAssessmentScans { - private static final ClientLogger LOGGER = new ClientLogger(SqlVulnerabilityAssessmentScansImpl.class); - - private final SqlVulnerabilityAssessmentScansClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SqlVulnerabilityAssessmentScansImpl( - SqlVulnerabilityAssessmentScansClient innerClient, - com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public Response getWithResponse(String scanId, String workspaceId, String resourceId, Context context) { - Response inner = this.serviceClient().getWithResponse(scanId, workspaceId, resourceId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ScanImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Scan get(String scanId, String workspaceId, String resourceId) { - ScanInner inner = this.serviceClient().get(scanId, workspaceId, resourceId); - if (inner != null) { - return new ScanImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response listWithResponse(String workspaceId, String resourceId, Context context) { - Response inner = this.serviceClient().listWithResponse(workspaceId, resourceId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ScansImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Scans list(String workspaceId, String resourceId) { - ScansInner inner = this.serviceClient().list(workspaceId, resourceId); - if (inner != null) { - return new ScansImpl(inner, this.manager()); - } else { - return null; - } - } - - private SqlVulnerabilityAssessmentScansClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsClientImpl.java deleted file mode 100644 index a93f80e557e9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsClientImpl.java +++ /dev/null @@ -1,713 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.SubAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner; -import com.azure.resourcemanager.security.models.SecuritySubAssessmentList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in SubAssessmentsClient. */ -public final class SubAssessmentsClientImpl implements SubAssessmentsClient { - /** The proxy service used to perform REST calls. */ - private final SubAssessmentsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of SubAssessmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - SubAssessmentsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(SubAssessmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterSubAssessments to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterSubAss") - public interface SubAssessmentsService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/subAssessments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAll( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("assessmentName") String assessmentName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @PathParam("assessmentName") String assessmentName, - @PathParam("subAssessmentName") String subAssessmentName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a subscription scope along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllSinglePageAsync(String scope) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAll(this.client.getEndpoint(), apiVersion, scope, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a subscription scope along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllSinglePageAsync(String scope, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAll(this.client.getEndpoint(), apiVersion, scope, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAllAsync(String scope) { - return new PagedFlux<>(() -> listAllSinglePageAsync(scope), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAllAsync(String scope, Context context) { - return new PagedFlux<>( - () -> listAllSinglePageAsync(scope, context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAll(String scope) { - return new PagedIterable<>(listAllAsync(scope)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAll(String scope, Context context) { - return new PagedIterable<>(listAllAsync(scope, context)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String assessmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.list(this.client.getEndpoint(), apiVersion, scope, assessmentName, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a scope along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String scope, String assessmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, scope, assessmentName, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String assessmentName) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, assessmentName), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String assessmentName, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, assessmentName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String assessmentName) { - return new PagedIterable<>(listAsync(scope, assessmentName)); - } - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String assessmentName, Context context) { - return new PagedIterable<>(listAsync(scope, assessmentName, context)); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security sub-assessment on your scanned resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String assessmentName, String subAssessmentName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (subAssessmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter subAssessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - scope, - assessmentName, - subAssessmentName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security sub-assessment on your scanned resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String scope, String assessmentName, String subAssessmentName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } - if (assessmentName == null) { - return Mono.error(new IllegalArgumentException("Parameter assessmentName is required and cannot be null.")); - } - if (subAssessmentName == null) { - return Mono - .error(new IllegalArgumentException("Parameter subAssessmentName is required and cannot be null.")); - } - final String apiVersion = "2019-01-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get(this.client.getEndpoint(), apiVersion, scope, assessmentName, subAssessmentName, accept, context); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security sub-assessment on your scanned resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope, String assessmentName, String subAssessmentName) { - return getWithResponseAsync(scope, assessmentName, subAssessmentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security sub-assessment on your scanned resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String scope, String assessmentName, String subAssessmentName, Context context) { - return getWithResponseAsync(scope, assessmentName, subAssessmentName, context).block(); - } - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security sub-assessment on your scanned resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecuritySubAssessmentInner get(String scope, String assessmentName, String subAssessmentName) { - return getWithResponse(scope, assessmentName, subAssessmentName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security sub-assessments along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsImpl.java deleted file mode 100644 index ed66f565392b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SubAssessmentsImpl.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.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.SubAssessmentsClient; -import com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner; -import com.azure.resourcemanager.security.models.SecuritySubAssessment; -import com.azure.resourcemanager.security.models.SubAssessments; - -public final class SubAssessmentsImpl implements SubAssessments { - private static final ClientLogger LOGGER = new ClientLogger(SubAssessmentsImpl.class); - - private final SubAssessmentsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public SubAssessmentsImpl( - SubAssessmentsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listAll(String scope) { - PagedIterable inner = this.serviceClient().listAll(scope); - return Utils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); - } - - public PagedIterable listAll(String scope, Context context) { - PagedIterable inner = this.serviceClient().listAll(scope, context); - return Utils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, String assessmentName) { - PagedIterable inner = this.serviceClient().list(scope, assessmentName); - return Utils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String scope, String assessmentName, Context context) { - PagedIterable inner = this.serviceClient().list(scope, assessmentName, context); - return Utils.mapPage(inner, inner1 -> new SecuritySubAssessmentImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String scope, String assessmentName, String subAssessmentName, Context context) { - Response inner = - this.serviceClient().getWithResponse(scope, assessmentName, subAssessmentName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecuritySubAssessmentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecuritySubAssessment get(String scope, String assessmentName, String subAssessmentName) { - SecuritySubAssessmentInner inner = this.serviceClient().get(scope, assessmentName, subAssessmentName); - if (inner != null) { - return new SecuritySubAssessmentImpl(inner, this.manager()); - } else { - return null; - } - } - - private SubAssessmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksClientImpl.java deleted file mode 100644 index 846466c0abe1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksClientImpl.java +++ /dev/null @@ -1,1680 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.TasksClient; -import com.azure.resourcemanager.security.fluent.models.SecurityTaskInner; -import com.azure.resourcemanager.security.models.SecurityTaskList; -import com.azure.resourcemanager.security.models.TaskUpdateActionType; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TasksClient. */ -public final class TasksClientImpl implements TasksClient { - /** The proxy service used to perform REST calls. */ - private final TasksService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of TasksClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TasksClientImpl(SecurityCenterImpl client) { - this.service = RestProxy.create(TasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterTasks to be used by the proxy service to perform REST - * calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterTasks") - public interface TasksService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSubscriptionLevelTask( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("taskName") String taskName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateSubscriptionLevelTaskState( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @PathParam("taskName") String taskName, - @PathParam("taskUpdateActionType") TaskUpdateActionType taskUpdateActionType, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getResourceGroupLevelTask( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("taskName") String taskName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> updateResourceGroupLevelTaskState( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("taskName") String taskName, - @PathParam("taskUpdateActionType") TaskUpdateActionType taskUpdateActionType, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), filter, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByHomeRegion( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync( - String ascLocation, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegion( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, String filter) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation, filter), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation) { - final String filter = null; - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation, filter), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, String filter, Context context) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation, filter, context), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation) { - final String filter = null; - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, filter)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation, String filter, Context context) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, filter, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionLevelTaskWithResponseAsync( - String ascLocation, String taskName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getSubscriptionLevelTask( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - taskName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSubscriptionLevelTaskWithResponseAsync( - String ascLocation, String taskName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getSubscriptionLevelTask( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - taskName, - accept, - context); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getSubscriptionLevelTaskAsync(String ascLocation, String taskName) { - return getSubscriptionLevelTaskWithResponseAsync(ascLocation, taskName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSubscriptionLevelTaskWithResponse( - String ascLocation, String taskName, Context context) { - return getSubscriptionLevelTaskWithResponseAsync(ascLocation, taskName, context).block(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityTaskInner getSubscriptionLevelTask(String ascLocation, String taskName) { - return getSubscriptionLevelTaskWithResponse(ascLocation, taskName, Context.NONE).getValue(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelTaskStateWithResponseAsync( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskUpdateActionType == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateActionType is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateSubscriptionLevelTaskState( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - taskName, - taskUpdateActionType, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateSubscriptionLevelTaskStateWithResponseAsync( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskUpdateActionType == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateActionType is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateSubscriptionLevelTaskState( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - ascLocation, - taskName, - taskUpdateActionType, - accept, - context); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateSubscriptionLevelTaskStateAsync( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType) { - return updateSubscriptionLevelTaskStateWithResponseAsync(ascLocation, taskName, taskUpdateActionType) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSubscriptionLevelTaskStateWithResponse( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType, Context context) { - return updateSubscriptionLevelTaskStateWithResponseAsync(ascLocation, taskName, taskUpdateActionType, context) - .block(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateSubscriptionLevelTaskState( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType) { - updateSubscriptionLevelTaskStateWithResponse(ascLocation, taskName, taskUpdateActionType, Context.NONE); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String ascLocation, String filter) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, String ascLocation, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - filter, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String ascLocation, String filter) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, ascLocation, filter), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, String ascLocation) { - final String filter = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, ascLocation, filter), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, String ascLocation, String filter, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, ascLocation, filter, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation) { - final String filter = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, ascLocation, filter)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, String ascLocation, String filter, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, ascLocation, filter, context)); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getResourceGroupLevelTaskWithResponseAsync( - String resourceGroupName, String ascLocation, String taskName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getResourceGroupLevelTask( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - taskName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getResourceGroupLevelTaskWithResponseAsync( - String resourceGroupName, String ascLocation, String taskName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getResourceGroupLevelTask( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - taskName, - accept, - context); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getResourceGroupLevelTaskAsync( - String resourceGroupName, String ascLocation, String taskName) { - return getResourceGroupLevelTaskWithResponseAsync(resourceGroupName, ascLocation, taskName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getResourceGroupLevelTaskWithResponse( - String resourceGroupName, String ascLocation, String taskName, Context context) { - return getResourceGroupLevelTaskWithResponseAsync(resourceGroupName, ascLocation, taskName, context).block(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SecurityTaskInner getResourceGroupLevelTask(String resourceGroupName, String ascLocation, String taskName) { - return getResourceGroupLevelTaskWithResponse(resourceGroupName, ascLocation, taskName, Context.NONE).getValue(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelTaskStateWithResponseAsync( - String resourceGroupName, String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskUpdateActionType == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateActionType is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .updateResourceGroupLevelTaskState( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - taskName, - taskUpdateActionType, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateResourceGroupLevelTaskStateWithResponseAsync( - String resourceGroupName, - String ascLocation, - String taskName, - TaskUpdateActionType taskUpdateActionType, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (taskName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); - } - if (taskUpdateActionType == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateActionType is required and cannot be null.")); - } - final String apiVersion = "2015-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .updateResourceGroupLevelTaskState( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - taskName, - taskUpdateActionType, - accept, - context); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateResourceGroupLevelTaskStateAsync( - String resourceGroupName, String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType) { - return updateResourceGroupLevelTaskStateWithResponseAsync( - resourceGroupName, ascLocation, taskName, taskUpdateActionType) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateResourceGroupLevelTaskStateWithResponse( - String resourceGroupName, - String ascLocation, - String taskName, - TaskUpdateActionType taskUpdateActionType, - Context context) { - return updateResourceGroupLevelTaskStateWithResponseAsync( - resourceGroupName, ascLocation, taskName, taskUpdateActionType, context) - .block(); - } - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void updateResourceGroupLevelTaskState( - String resourceGroupName, String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType) { - updateResourceGroupLevelTaskStateWithResponse( - resourceGroupName, ascLocation, taskName, taskUpdateActionType, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

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

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

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

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksImpl.java deleted file mode 100644 index ec884a63c55c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TasksImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.TasksClient; -import com.azure.resourcemanager.security.fluent.models.SecurityTaskInner; -import com.azure.resourcemanager.security.models.SecurityTask; -import com.azure.resourcemanager.security.models.TaskUpdateActionType; -import com.azure.resourcemanager.security.models.Tasks; - -public final class TasksImpl implements Tasks { - private static final ClientLogger LOGGER = new ClientLogger(TasksImpl.class); - - private final TasksClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public TasksImpl(TasksClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return Utils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return Utils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation, String filter, Context context) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation, filter, context); - return Utils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public Response getSubscriptionLevelTaskWithResponse( - String ascLocation, String taskName, Context context) { - Response inner = - this.serviceClient().getSubscriptionLevelTaskWithResponse(ascLocation, taskName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecurityTaskImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityTask getSubscriptionLevelTask(String ascLocation, String taskName) { - SecurityTaskInner inner = this.serviceClient().getSubscriptionLevelTask(ascLocation, taskName); - if (inner != null) { - return new SecurityTaskImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateSubscriptionLevelTaskStateWithResponse( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType, Context context) { - return this - .serviceClient() - .updateSubscriptionLevelTaskStateWithResponse(ascLocation, taskName, taskUpdateActionType, context); - } - - public void updateSubscriptionLevelTaskState( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType) { - this.serviceClient().updateSubscriptionLevelTaskState(ascLocation, taskName, taskUpdateActionType); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, ascLocation); - return Utils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup( - String resourceGroupName, String ascLocation, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, ascLocation, filter, context); - return Utils.mapPage(inner, inner1 -> new SecurityTaskImpl(inner1, this.manager())); - } - - public Response getResourceGroupLevelTaskWithResponse( - String resourceGroupName, String ascLocation, String taskName, Context context) { - Response inner = - this - .serviceClient() - .getResourceGroupLevelTaskWithResponse(resourceGroupName, ascLocation, taskName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new SecurityTaskImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public SecurityTask getResourceGroupLevelTask(String resourceGroupName, String ascLocation, String taskName) { - SecurityTaskInner inner = - this.serviceClient().getResourceGroupLevelTask(resourceGroupName, ascLocation, taskName); - if (inner != null) { - return new SecurityTaskImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response updateResourceGroupLevelTaskStateWithResponse( - String resourceGroupName, - String ascLocation, - String taskName, - TaskUpdateActionType taskUpdateActionType, - Context context) { - return this - .serviceClient() - .updateResourceGroupLevelTaskStateWithResponse( - resourceGroupName, ascLocation, taskName, taskUpdateActionType, context); - } - - public void updateResourceGroupLevelTaskState( - String resourceGroupName, String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType) { - this - .serviceClient() - .updateResourceGroupLevelTaskState(resourceGroupName, ascLocation, taskName, taskUpdateActionType); - } - - private TasksClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java deleted file mode 100644 index 28a78eafba17..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesClientImpl.java +++ /dev/null @@ -1,742 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.TopologiesClient; -import com.azure.resourcemanager.security.fluent.models.TopologyResourceInner; -import com.azure.resourcemanager.security.models.TopologyList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TopologiesClient. */ -public final class TopologiesClientImpl implements TopologiesClient { - /** The proxy service used to perform REST calls. */ - private final TopologiesService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of TopologiesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TopologiesClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(TopologiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterTopologies to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterTopolo") - public interface TopologiesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegion( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("ascLocation") String ascLocation, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("ascLocation") String ascLocation, - @PathParam("topologyResourceName") String topologyResourceName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByHomeRegionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Gets a list that allows to build a topology view of a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list that allows to build a topology view of a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list that allows to build a topology view of a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list that allows to build a topology view of a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list that allows to build a topology view of a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets a list that allows to build a topology view of a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync(String ascLocation) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByHomeRegion( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - ascLocation, - apiVersion, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionSinglePageAsync( - String ascLocation, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegion( - this.client.getEndpoint(), this.client.getSubscriptionId(), ascLocation, apiVersion, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByHomeRegionAsync(String ascLocation, Context context) { - return new PagedFlux<>( - () -> listByHomeRegionSinglePageAsync(ascLocation, context), - nextLink -> listByHomeRegionNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation)); - } - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - return new PagedIterable<>(listByHomeRegionAsync(ascLocation, context)); - } - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ascLocation, String topologyResourceName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (topologyResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter topologyResourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - topologyResourceName, - apiVersion, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String resourceGroupName, String ascLocation, String topologyResourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (ascLocation == null) { - return Mono.error(new IllegalArgumentException("Parameter ascLocation is required and cannot be null.")); - } - if (topologyResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter topologyResourceName is required and cannot be null.")); - } - final String apiVersion = "2020-01-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getSubscriptionId(), - resourceGroupName, - ascLocation, - topologyResourceName, - apiVersion, - accept, - context); - } - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, String ascLocation, String topologyResourceName) { - return getWithResponseAsync(resourceGroupName, ascLocation, topologyResourceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, String ascLocation, String topologyResourceName, Context context) { - return getWithResponseAsync(resourceGroupName, ascLocation, topologyResourceName, context).block(); - } - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TopologyResourceInner get(String resourceGroupName, String ascLocation, String topologyResourceName) { - return getWithResponse(resourceGroupName, ascLocation, topologyResourceName, Context.NONE).getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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

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

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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByHomeRegionNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByHomeRegionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.java deleted file mode 100644 index 7aa969963df6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologiesImpl.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.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.TopologiesClient; -import com.azure.resourcemanager.security.fluent.models.TopologyResourceInner; -import com.azure.resourcemanager.security.models.Topologies; -import com.azure.resourcemanager.security.models.TopologyResource; - -public final class TopologiesImpl implements Topologies { - private static final ClientLogger LOGGER = new ClientLogger(TopologiesImpl.class); - - private final TopologiesClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public TopologiesImpl( - TopologiesClient 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 TopologyResourceImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation); - return Utils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); - } - - public PagedIterable listByHomeRegion(String ascLocation, Context context) { - PagedIterable inner = this.serviceClient().listByHomeRegion(ascLocation, context); - return Utils.mapPage(inner, inner1 -> new TopologyResourceImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String resourceGroupName, String ascLocation, String topologyResourceName, Context context) { - Response inner = - this.serviceClient().getWithResponse(resourceGroupName, ascLocation, topologyResourceName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new TopologyResourceImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public TopologyResource get(String resourceGroupName, String ascLocation, String topologyResourceName) { - TopologyResourceInner inner = this.serviceClient().get(resourceGroupName, ascLocation, topologyResourceName); - if (inner != null) { - return new TopologyResourceImpl(inner, this.manager()); - } else { - return null; - } - } - - private TopologiesClient 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/TopologyResourceImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourceImpl.java deleted file mode 100644 index 9a4e23501480..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/TopologyResourceImpl.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.resourcemanager.security.fluent.models.TopologyResourceInner; -import com.azure.resourcemanager.security.models.TopologyResource; -import com.azure.resourcemanager.security.models.TopologySingleResource; -import java.time.OffsetDateTime; -import java.util.Collections; -import java.util.List; - -public final class TopologyResourceImpl implements TopologyResource { - private TopologyResourceInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - TopologyResourceImpl( - TopologyResourceInner 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 location() { - return this.innerModel().location(); - } - - public OffsetDateTime calculatedDateTime() { - return this.innerModel().calculatedDateTime(); - } - - public List topologyResources() { - List inner = this.innerModel().topologyResources(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public TopologyResourceInner 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/Utils.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/Utils.java deleted file mode 100644 index 210bf291fe60..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/Utils.java +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.util.CoreUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import reactor.core.publisher.Flux; - -final class Utils { - static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } - } - return null; - } - - static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingImpl.java deleted file mode 100644 index 2fdd469eb260..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingImpl.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; -import com.azure.resourcemanager.security.models.WorkspaceSetting; - -public final class WorkspaceSettingImpl - implements WorkspaceSetting, WorkspaceSetting.Definition, WorkspaceSetting.Update { - private WorkspaceSettingInner innerObject; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String workspaceId() { - return this.innerModel().workspaceId(); - } - - public String scope() { - return this.innerModel().scope(); - } - - public WorkspaceSettingInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - private String workspaceSettingName; - - public WorkspaceSetting create() { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaceSettings() - .createWithResponse(workspaceSettingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public WorkspaceSetting create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaceSettings() - .createWithResponse(workspaceSettingName, this.innerModel(), context) - .getValue(); - return this; - } - - WorkspaceSettingImpl(String name, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = new WorkspaceSettingInner(); - this.serviceManager = serviceManager; - this.workspaceSettingName = name; - } - - public WorkspaceSettingImpl update() { - return this; - } - - public WorkspaceSetting apply() { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaceSettings() - .updateWithResponse(workspaceSettingName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public WorkspaceSetting apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaceSettings() - .updateWithResponse(workspaceSettingName, this.innerModel(), context) - .getValue(); - return this; - } - - WorkspaceSettingImpl( - WorkspaceSettingInner innerObject, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.workspaceSettingName = Utils.getValueFromIdByName(innerObject.id(), "workspaceSettings"); - } - - public WorkspaceSetting refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaceSettings() - .getWithResponse(workspaceSettingName, Context.NONE) - .getValue(); - return this; - } - - public WorkspaceSetting refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getWorkspaceSettings() - .getWithResponse(workspaceSettingName, context) - .getValue(); - return this; - } - - public WorkspaceSettingImpl withWorkspaceId(String workspaceId) { - this.innerModel().withWorkspaceId(workspaceId); - return this; - } - - public WorkspaceSettingImpl withScope(String scope) { - this.innerModel().withScope(scope); - return this; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsClientImpl.java deleted file mode 100644 index 7c0ea16bebac..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsClientImpl.java +++ /dev/null @@ -1,918 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.security.fluent.WorkspaceSettingsClient; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; -import com.azure.resourcemanager.security.models.WorkspaceSettingList; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in WorkspaceSettingsClient. */ -public final class WorkspaceSettingsClientImpl implements WorkspaceSettingsClient { - /** The proxy service used to perform REST calls. */ - private final WorkspaceSettingsService service; - - /** The service client containing this operation class. */ - private final SecurityCenterImpl client; - - /** - * Initializes an instance of WorkspaceSettingsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - WorkspaceSettingsClientImpl(SecurityCenterImpl client) { - this.service = - RestProxy.create(WorkspaceSettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SecurityCenterWorkspaceSettings to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SecurityCenterWorksp") - public interface WorkspaceSettingsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceSettingName") String workspaceSettingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Put("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceSettingName") String workspaceSettingName, - @BodyParam("application/json") WorkspaceSettingInner workspaceSetting, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Patch("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceSettingName") String workspaceSettingName, - @BodyParam("application/json") WorkspaceSettingInner workspaceSetting, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}") - @ExpectedResponses({204}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("workspaceSettingName") String workspaceSettingName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String workspaceSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - workspaceSettingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String workspaceSettingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - workspaceSettingName, - accept, - context); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String workspaceSettingName) { - return getWithResponseAsync(workspaceSettingName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String workspaceSettingName, Context context) { - return getWithResponseAsync(workspaceSettingName, context).block(); - } - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceSettingInner get(String workspaceSettingName) { - return getWithResponse(workspaceSettingName, Context.NONE).getValue(); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - if (workspaceSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSetting is required and cannot be null.")); - } else { - workspaceSetting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - workspaceSettingName, - workspaceSetting, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createWithResponseAsync( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - if (workspaceSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSetting is required and cannot be null.")); - } else { - workspaceSetting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .create( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - workspaceSettingName, - workspaceSetting, - accept, - context); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting) { - return createWithResponseAsync(workspaceSettingName, workspaceSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createWithResponse( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting, Context context) { - return createWithResponseAsync(workspaceSettingName, workspaceSetting, context).block(); - } - - /** - * creating settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceSettingInner create(String workspaceSettingName, WorkspaceSettingInner workspaceSetting) { - return createWithResponse(workspaceSettingName, workspaceSetting, Context.NONE).getValue(); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - if (workspaceSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSetting is required and cannot be null.")); - } else { - workspaceSetting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - workspaceSettingName, - workspaceSetting, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - if (workspaceSetting == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSetting is required and cannot be null.")); - } else { - workspaceSetting.validate(); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .update( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - workspaceSettingName, - workspaceSetting, - accept, - context); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting) { - return updateWithResponseAsync(workspaceSettingName, workspaceSetting) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String workspaceSettingName, WorkspaceSettingInner workspaceSetting, Context context) { - return updateWithResponseAsync(workspaceSettingName, workspaceSetting, context).block(); - } - - /** - * Settings about where we should store your security data and logs. - * - * @param workspaceSettingName Name of the security setting. - * @param workspaceSetting Security data setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceSettingInner update(String workspaceSettingName, WorkspaceSettingInner workspaceSetting) { - return updateWithResponse(workspaceSettingName, workspaceSetting, Context.NONE).getValue(); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String workspaceSettingName) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - workspaceSettingName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String workspaceSettingName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (workspaceSettingName == null) { - return Mono - .error(new IllegalArgumentException("Parameter workspaceSettingName is required and cannot be null.")); - } - final String apiVersion = "2017-08-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .delete( - this.client.getEndpoint(), - apiVersion, - this.client.getSubscriptionId(), - workspaceSettingName, - accept, - context); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String workspaceSettingName) { - return deleteWithResponseAsync(workspaceSettingName).flatMap(ignored -> Mono.empty()); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String workspaceSettingName, Context context) { - return deleteWithResponseAsync(workspaceSettingName, context).block(); - } - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String workspaceSettingName) { - deleteWithResponse(workspaceSettingName, Context.NONE); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 workspace settings response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

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 workspace settings response along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsImpl.java deleted file mode 100644 index 5917842ee7d1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/WorkspaceSettingsImpl.java +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.WorkspaceSettingsClient; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; -import com.azure.resourcemanager.security.models.WorkspaceSetting; -import com.azure.resourcemanager.security.models.WorkspaceSettings; - -public final class WorkspaceSettingsImpl implements WorkspaceSettings { - private static final ClientLogger LOGGER = new ClientLogger(WorkspaceSettingsImpl.class); - - private final WorkspaceSettingsClient innerClient; - - private final com.azure.resourcemanager.security.SecurityManager serviceManager; - - public WorkspaceSettingsImpl( - WorkspaceSettingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new WorkspaceSettingImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new WorkspaceSettingImpl(inner1, this.manager())); - } - - public Response getWithResponse(String workspaceSettingName, Context context) { - Response inner = this.serviceClient().getWithResponse(workspaceSettingName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new WorkspaceSettingImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public WorkspaceSetting get(String workspaceSettingName) { - WorkspaceSettingInner inner = this.serviceClient().get(workspaceSettingName); - if (inner != null) { - return new WorkspaceSettingImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response deleteWithResponse(String workspaceSettingName, Context context) { - return this.serviceClient().deleteWithResponse(workspaceSettingName, context); - } - - public void delete(String workspaceSettingName) { - this.serviceClient().delete(workspaceSettingName); - } - - public WorkspaceSetting getById(String id) { - String workspaceSettingName = Utils.getValueFromIdByName(id, "workspaceSettings"); - if (workspaceSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'workspaceSettings'.", id))); - } - return this.getWithResponse(workspaceSettingName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String workspaceSettingName = Utils.getValueFromIdByName(id, "workspaceSettings"); - if (workspaceSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'workspaceSettings'.", id))); - } - return this.getWithResponse(workspaceSettingName, context); - } - - public void deleteById(String id) { - String workspaceSettingName = Utils.getValueFromIdByName(id, "workspaceSettings"); - if (workspaceSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'workspaceSettings'.", id))); - } - this.deleteWithResponse(workspaceSettingName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String workspaceSettingName = Utils.getValueFromIdByName(id, "workspaceSettings"); - if (workspaceSettingName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format( - "The resource ID '%s' is not valid. Missing path segment 'workspaceSettings'.", id))); - } - return this.deleteWithResponse(workspaceSettingName, context); - } - - private WorkspaceSettingsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.security.SecurityManager manager() { - return this.serviceManager; - } - - public WorkspaceSettingImpl define(String name) { - return new WorkspaceSettingImpl(name, this.manager()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/package-info.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/package-info.java deleted file mode 100644 index 5a853f731e88..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the implementations for SecurityCenter. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ -package com.azure.resourcemanager.security.implementation; 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 deleted file mode 100644 index 72e27397e81a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityState.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The connectivity state of the external AAD solution. */ -public final class AadConnectivityState extends ExpandableStringEnum { - /** Static value Discovered for AadConnectivityState. */ - public static final AadConnectivityState DISCOVERED = fromString("Discovered"); - - /** Static value NotLicensed for AadConnectivityState. */ - public static final AadConnectivityState NOT_LICENSED = fromString("NotLicensed"); - - /** Static value Connected for AadConnectivityState. */ - public static final AadConnectivityState CONNECTED = fromString("Connected"); - - /** - * Creates a new instance of AadConnectivityState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AadConnectivityState() { - } - - /** - * Creates or finds a AadConnectivityState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AadConnectivityState. - */ - @JsonCreator - public static AadConnectivityState fromString(String name) { - return fromString(name, AadConnectivityState.class); - } - - /** - * Gets known AadConnectivityState values. - * - * @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 deleted file mode 100644 index 6cea9268f7e2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadConnectivityStateAutoGenerated.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes an Azure resource with kind. */ -@Fluent -public class AadConnectivityStateAutoGenerated { - /* - * The connectivity state of the external AAD solution - */ - @JsonProperty(value = "connectivityState") - private AadConnectivityState connectivityState; - - /** Creates an instance of AadConnectivityStateAutoGenerated class. */ - public AadConnectivityStateAutoGenerated() { - } - - /** - * 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/AadExternalSecuritySolution.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadExternalSecuritySolution.java deleted file mode 100644 index 400b5421f072..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadExternalSecuritySolution.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Represents an AAD identity protection solution which sends logs to an OMS workspace. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("AAD") -@Fluent -public final class AadExternalSecuritySolution extends ExternalSecuritySolutionInner { - /* - * The external security solution properties for AAD solutions - */ - @JsonProperty(value = "properties") - private AadSolutionProperties properties; - - /** Creates an instance of AadExternalSecuritySolution class. */ - public AadExternalSecuritySolution() { - } - - /** - * Get the properties property: The external security solution properties for AAD solutions. - * - * @return the properties value. - */ - public AadSolutionProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The external security solution properties for AAD solutions. - * - * @param properties the properties value to set. - * @return the AadExternalSecuritySolution object itself. - */ - public AadExternalSecuritySolution withProperties(AadSolutionProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (properties() != null) { - properties().validate(); - } - } -} 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 deleted file mode 100644 index 66c9643e1e5e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AadSolutionProperties.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The external security solution properties for AAD solutions. */ -@Fluent -public final class AadSolutionProperties extends ExternalSecuritySolutionProperties { - /* - * The connectivity state of the external AAD solution - */ - @JsonProperty(value = "connectivityState") - private AadConnectivityState connectivityState; - - /** Creates an instance of AadSolutionProperties class. */ - public AadSolutionProperties() { - } - - /** - * 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 AadSolutionProperties object itself. - */ - public AadSolutionProperties withConnectivityState(AadConnectivityState connectivityState) { - this.connectivityState = connectivityState; - return this; - } - - /** {@inheritDoc} */ - @Override - public AadSolutionProperties withDeviceVendor(String deviceVendor) { - super.withDeviceVendor(deviceVendor); - return this; - } - - /** {@inheritDoc} */ - @Override - public AadSolutionProperties withDeviceType(String deviceType) { - super.withDeviceType(deviceType); - return this; - } - - /** {@inheritDoc} */ - @Override - public AadSolutionProperties withWorkspace(ConnectedWorkspace workspace) { - super.withWorkspace(workspace); - 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/ActionType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionType.java deleted file mode 100644 index 9f8d0c26c795..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActionType.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The type of the action that will be triggered by the Automation. */ -public final class ActionType extends ExpandableStringEnum { - /** Static value LogicApp for ActionType. */ - public static final ActionType LOGIC_APP = fromString("LogicApp"); - - /** Static value EventHub for ActionType. */ - public static final ActionType EVENT_HUB = fromString("EventHub"); - - /** Static value Workspace for ActionType. */ - public static final ActionType WORKSPACE = fromString("Workspace"); - - /** - * Creates a new instance of ActionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ActionType() { - } - - /** - * Creates or finds a ActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ActionType. - */ - @JsonCreator - public static ActionType fromString(String name) { - return fromString(name, ActionType.class); - } - - /** - * Gets known ActionType values. - * - * @return known ActionType values. - */ - public static Collection values() { - return values(ActionType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActiveConnectionsNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActiveConnectionsNotInAllowedRange.java deleted file mode 100644 index b8f0145eb288..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ActiveConnectionsNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of active connections is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("ActiveConnectionsNotInAllowedRange") -@Fluent -public final class ActiveConnectionsNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of ActiveConnectionsNotInAllowedRange class. */ - public ActiveConnectionsNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public ActiveConnectionsNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public ActiveConnectionsNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public ActiveConnectionsNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public ActiveConnectionsNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/AdaptiveApplicationControlGroup.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroup.java deleted file mode 100644 index cb789472d089..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroup.java +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupInner; -import java.util.List; - -/** An immutable client-side representation of AdaptiveApplicationControlGroup. */ -public interface AdaptiveApplicationControlGroup { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - - /** - * Gets the enforcementMode property: The application control policy enforcement/protection mode of the machine - * group. - * - * @return the enforcementMode value. - */ - EnforcementMode enforcementMode(); - - /** - * Gets the protectionMode property: The protection mode of the collection/file types. Exe/Msi/Script are used for - * Windows, Executable is used for Linux. - * - * @return the protectionMode value. - */ - ProtectionMode protectionMode(); - - /** - * Gets the configurationStatus property: The configuration status of the machines group or machine or rule. - * - * @return the configurationStatus value. - */ - ConfigurationStatus configurationStatus(); - - /** - * Gets the recommendationStatus property: The initial recommendation status of the machine group or machine. - * - * @return the recommendationStatus value. - */ - RecommendationStatus recommendationStatus(); - - /** - * Gets the issues property: The issues property. - * - * @return the issues value. - */ - List issues(); - - /** - * Gets the sourceSystem property: The source type of the machine group. - * - * @return the sourceSystem value. - */ - SourceSystem sourceSystem(); - - /** - * Gets the vmRecommendations property: The vmRecommendations property. - * - * @return the vmRecommendations value. - */ - List vmRecommendations(); - - /** - * Gets the pathRecommendations property: The pathRecommendations property. - * - * @return the pathRecommendations value. - */ - List pathRecommendations(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupInner object. - * - * @return the inner object. - */ - AdaptiveApplicationControlGroupInner innerModel(); - - /** The entirety of the AdaptiveApplicationControlGroup definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The AdaptiveApplicationControlGroup definition stages. */ - interface DefinitionStages { - /** The first stage of the AdaptiveApplicationControlGroup definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies ascLocation. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @return the next definition stage. - */ - WithCreate withExistingLocation(String ascLocation); - } - /** - * The stage of the AdaptiveApplicationControlGroup definition which contains all the minimum required - * properties for the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithEnforcementMode, - DefinitionStages.WithProtectionMode, - DefinitionStages.WithVmRecommendations, - DefinitionStages.WithPathRecommendations { - /** - * Executes the create request. - * - * @return the created resource. - */ - AdaptiveApplicationControlGroup create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AdaptiveApplicationControlGroup create(Context context); - } - /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify enforcementMode. */ - interface WithEnforcementMode { - /** - * Specifies the enforcementMode property: The application control policy enforcement/protection mode of the - * machine group. - * - * @param enforcementMode The application control policy enforcement/protection mode of the machine group. - * @return the next definition stage. - */ - WithCreate withEnforcementMode(EnforcementMode enforcementMode); - } - /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify protectionMode. */ - interface WithProtectionMode { - /** - * Specifies the protectionMode property: The protection mode of the collection/file types. Exe/Msi/Script - * are used for Windows, Executable is used for Linux.. - * - * @param protectionMode The protection mode of the collection/file types. Exe/Msi/Script are used for - * Windows, Executable is used for Linux. - * @return the next definition stage. - */ - WithCreate withProtectionMode(ProtectionMode protectionMode); - } - /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify vmRecommendations. */ - interface WithVmRecommendations { - /** - * Specifies the vmRecommendations property: The vmRecommendations property.. - * - * @param vmRecommendations The vmRecommendations property. - * @return the next definition stage. - */ - WithCreate withVmRecommendations(List vmRecommendations); - } - /** The stage of the AdaptiveApplicationControlGroup definition allowing to specify pathRecommendations. */ - interface WithPathRecommendations { - /** - * Specifies the pathRecommendations property: The pathRecommendations property.. - * - * @param pathRecommendations The pathRecommendations property. - * @return the next definition stage. - */ - WithCreate withPathRecommendations(List pathRecommendations); - } - } - /** - * Begins update for the AdaptiveApplicationControlGroup resource. - * - * @return the stage of resource update. - */ - AdaptiveApplicationControlGroup.Update update(); - - /** The template for AdaptiveApplicationControlGroup update. */ - interface Update - extends UpdateStages.WithEnforcementMode, - UpdateStages.WithProtectionMode, - UpdateStages.WithVmRecommendations, - UpdateStages.WithPathRecommendations { - /** - * Executes the update request. - * - * @return the updated resource. - */ - AdaptiveApplicationControlGroup apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - AdaptiveApplicationControlGroup apply(Context context); - } - /** The AdaptiveApplicationControlGroup update stages. */ - interface UpdateStages { - /** The stage of the AdaptiveApplicationControlGroup update allowing to specify enforcementMode. */ - interface WithEnforcementMode { - /** - * Specifies the enforcementMode property: The application control policy enforcement/protection mode of the - * machine group. - * - * @param enforcementMode The application control policy enforcement/protection mode of the machine group. - * @return the next definition stage. - */ - Update withEnforcementMode(EnforcementMode enforcementMode); - } - /** The stage of the AdaptiveApplicationControlGroup update allowing to specify protectionMode. */ - interface WithProtectionMode { - /** - * Specifies the protectionMode property: The protection mode of the collection/file types. Exe/Msi/Script - * are used for Windows, Executable is used for Linux.. - * - * @param protectionMode The protection mode of the collection/file types. Exe/Msi/Script are used for - * Windows, Executable is used for Linux. - * @return the next definition stage. - */ - Update withProtectionMode(ProtectionMode protectionMode); - } - /** The stage of the AdaptiveApplicationControlGroup update allowing to specify vmRecommendations. */ - interface WithVmRecommendations { - /** - * Specifies the vmRecommendations property: The vmRecommendations property.. - * - * @param vmRecommendations The vmRecommendations property. - * @return the next definition stage. - */ - Update withVmRecommendations(List vmRecommendations); - } - /** The stage of the AdaptiveApplicationControlGroup update allowing to specify pathRecommendations. */ - interface WithPathRecommendations { - /** - * Specifies the pathRecommendations property: The pathRecommendations property.. - * - * @param pathRecommendations The pathRecommendations property. - * @return the next definition stage. - */ - Update withPathRecommendations(List pathRecommendations); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AdaptiveApplicationControlGroup refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AdaptiveApplicationControlGroup refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroups.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroups.java deleted file mode 100644 index a394948e9205..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlGroups.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.AdaptiveApplicationControlGroupsInner; -import java.util.List; - -/** An immutable client-side representation of AdaptiveApplicationControlGroups. */ -public interface AdaptiveApplicationControlGroups { - /** - * Gets the value property: The value property. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupsInner object. - * - * @return the inner object. - */ - AdaptiveApplicationControlGroupsInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssue.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssue.java deleted file mode 100644 index a4c59fbd56e6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssue.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** An alert that machines within a group can have. */ -public final class AdaptiveApplicationControlIssue extends ExpandableStringEnum { - /** Static value ViolationsAudited for AdaptiveApplicationControlIssue. */ - public static final AdaptiveApplicationControlIssue VIOLATIONS_AUDITED = fromString("ViolationsAudited"); - - /** Static value ViolationsBlocked for AdaptiveApplicationControlIssue. */ - public static final AdaptiveApplicationControlIssue VIOLATIONS_BLOCKED = fromString("ViolationsBlocked"); - - /** Static value MsiAndScriptViolationsAudited for AdaptiveApplicationControlIssue. */ - public static final AdaptiveApplicationControlIssue MSI_AND_SCRIPT_VIOLATIONS_AUDITED = - fromString("MsiAndScriptViolationsAudited"); - - /** Static value MsiAndScriptViolationsBlocked for AdaptiveApplicationControlIssue. */ - public static final AdaptiveApplicationControlIssue MSI_AND_SCRIPT_VIOLATIONS_BLOCKED = - fromString("MsiAndScriptViolationsBlocked"); - - /** Static value ExecutableViolationsAudited for AdaptiveApplicationControlIssue. */ - public static final AdaptiveApplicationControlIssue EXECUTABLE_VIOLATIONS_AUDITED = - fromString("ExecutableViolationsAudited"); - - /** Static value RulesViolatedManually for AdaptiveApplicationControlIssue. */ - public static final AdaptiveApplicationControlIssue RULES_VIOLATED_MANUALLY = fromString("RulesViolatedManually"); - - /** - * Creates a new instance of AdaptiveApplicationControlIssue value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdaptiveApplicationControlIssue() { - } - - /** - * Creates or finds a AdaptiveApplicationControlIssue from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdaptiveApplicationControlIssue. - */ - @JsonCreator - public static AdaptiveApplicationControlIssue fromString(String name) { - return fromString(name, AdaptiveApplicationControlIssue.class); - } - - /** - * Gets known AdaptiveApplicationControlIssue values. - * - * @return known AdaptiveApplicationControlIssue values. - */ - public static Collection values() { - return values(AdaptiveApplicationControlIssue.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssueSummary.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssueSummary.java deleted file mode 100644 index 57abcac239b7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControlIssueSummary.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents a summary of the alerts of the machine group. */ -@Fluent -public final class AdaptiveApplicationControlIssueSummary { - /* - * An alert that machines within a group can have - */ - @JsonProperty(value = "issue") - private AdaptiveApplicationControlIssue issue; - - /* - * The number of machines in the group that have this alert - */ - @JsonProperty(value = "numberOfVms") - private Float numberOfVms; - - /** Creates an instance of AdaptiveApplicationControlIssueSummary class. */ - public AdaptiveApplicationControlIssueSummary() { - } - - /** - * Get the issue property: An alert that machines within a group can have. - * - * @return the issue value. - */ - public AdaptiveApplicationControlIssue issue() { - return this.issue; - } - - /** - * Set the issue property: An alert that machines within a group can have. - * - * @param issue the issue value to set. - * @return the AdaptiveApplicationControlIssueSummary object itself. - */ - public AdaptiveApplicationControlIssueSummary withIssue(AdaptiveApplicationControlIssue issue) { - this.issue = issue; - return this; - } - - /** - * Get the numberOfVms property: The number of machines in the group that have this alert. - * - * @return the numberOfVms value. - */ - public Float numberOfVms() { - return this.numberOfVms; - } - - /** - * Set the numberOfVms property: The number of machines in the group that have this alert. - * - * @param numberOfVms the numberOfVms value to set. - * @return the AdaptiveApplicationControlIssueSummary object itself. - */ - public AdaptiveApplicationControlIssueSummary withNumberOfVms(Float numberOfVms) { - this.numberOfVms = numberOfVms; - 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/AdaptiveApplicationControls.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControls.java deleted file mode 100644 index e2584d847eb7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveApplicationControls.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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 AdaptiveApplicationControls. */ -public interface AdaptiveApplicationControls { - /** - * Gets a list of application control machine groups for the subscription. - * - * @param includePathRecommendations Include the policy rules. - * @param summary Return output in a summarized form. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 application control machine groups for the subscription along with {@link Response}. - */ - Response listWithResponse( - Boolean includePathRecommendations, Boolean summary, Context context); - - /** - * Gets a list of application control machine groups for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of application control machine groups for the subscription. - */ - AdaptiveApplicationControlGroups list(); - - /** - * Gets an application control VM/server group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application control VM/server group along with {@link Response}. - */ - Response getWithResponse(String ascLocation, String groupName, Context context); - - /** - * Gets an application control VM/server group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application control VM/server group. - */ - AdaptiveApplicationControlGroup get(String ascLocation, String groupName); - - /** - * Delete an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByResourceGroupWithResponse(String ascLocation, String groupName, Context context); - - /** - * Delete an application control machine group. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param groupName Name of an application control machine group. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String ascLocation, String groupName); - - /** - * Gets an application control VM/server group. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application control VM/server group along with {@link Response}. - */ - AdaptiveApplicationControlGroup getById(String id); - - /** - * Gets an application control VM/server group. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an application control VM/server group along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete an application control machine group. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete an application control machine group. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new AdaptiveApplicationControlGroup resource. - * - * @param name resource name. - * @return the first stage of the new AdaptiveApplicationControlGroup definition. - */ - AdaptiveApplicationControlGroup.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardening.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardening.java deleted file mode 100644 index 8cd1c579fa38..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardening.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.models; - -import com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of AdaptiveNetworkHardening. */ -public interface AdaptiveNetworkHardening { - /** - * 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 rules property: The security rules which are recommended to be effective on the VM. - * - * @return the rules value. - */ - List rules(); - - /** - * Gets the rulesCalculationTime property: The UTC time on which the rules were calculated. - * - * @return the rulesCalculationTime value. - */ - OffsetDateTime rulesCalculationTime(); - - /** - * Gets the effectiveNetworkSecurityGroups property: The Network Security Groups effective on the network interfaces - * of the protected resource. - * - * @return the effectiveNetworkSecurityGroups value. - */ - List effectiveNetworkSecurityGroups(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningInner object. - * - * @return the inner object. - */ - AdaptiveNetworkHardeningInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardeningEnforceRequest.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardeningEnforceRequest.java deleted file mode 100644 index 0c6dfdd280f7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardeningEnforceRequest.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.JsonProperty; -import java.util.List; - -/** The AdaptiveNetworkHardeningEnforceRequest model. */ -@Fluent -public final class AdaptiveNetworkHardeningEnforceRequest { - /* - * The rules to enforce - */ - @JsonProperty(value = "rules", required = true) - private List rules; - - /* - * The Azure resource IDs of the effective network security groups that will be updated with the created security - * rules from the Adaptive Network Hardening rules - */ - @JsonProperty(value = "networkSecurityGroups", required = true) - private List networkSecurityGroups; - - /** Creates an instance of AdaptiveNetworkHardeningEnforceRequest class. */ - public AdaptiveNetworkHardeningEnforceRequest() { - } - - /** - * Get the rules property: The rules to enforce. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: The rules to enforce. - * - * @param rules the rules value to set. - * @return the AdaptiveNetworkHardeningEnforceRequest object itself. - */ - public AdaptiveNetworkHardeningEnforceRequest withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Get the networkSecurityGroups property: The Azure resource IDs of the effective network security groups that will - * be updated with the created security rules from the Adaptive Network Hardening rules. - * - * @return the networkSecurityGroups value. - */ - public List networkSecurityGroups() { - return this.networkSecurityGroups; - } - - /** - * Set the networkSecurityGroups property: The Azure resource IDs of the effective network security groups that will - * be updated with the created security rules from the Adaptive Network Hardening rules. - * - * @param networkSecurityGroups the networkSecurityGroups value to set. - * @return the AdaptiveNetworkHardeningEnforceRequest object itself. - */ - public AdaptiveNetworkHardeningEnforceRequest withNetworkSecurityGroups(List networkSecurityGroups) { - this.networkSecurityGroups = networkSecurityGroups; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rules() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property rules in model AdaptiveNetworkHardeningEnforceRequest")); - } else { - rules().forEach(e -> e.validate()); - } - if (networkSecurityGroups() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property networkSecurityGroups in model" - + " AdaptiveNetworkHardeningEnforceRequest")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AdaptiveNetworkHardeningEnforceRequest.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardenings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardenings.java deleted file mode 100644 index 735512030947..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardenings.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.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of AdaptiveNetworkHardenings. */ -public interface AdaptiveNetworkHardenings { - /** - * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedIterable}. - */ - PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); - - /** - * Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Adaptive Network Hardenings resources in scope of an extended resource as paginated response - * with {@link PagedIterable}. - */ - PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); - - /** - * Gets a single Adaptive Network Hardening resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single Adaptive Network Hardening resource along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - Context context); - - /** - * Gets a single Adaptive Network Hardening resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single Adaptive Network Hardening resource. - */ - AdaptiveNetworkHardening get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName); - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body); - - /** - * Enforces the given rules on the NSG(s) listed in the request. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param adaptiveNetworkHardeningResourceName The name of the Adaptive Network Hardening resource. - * @param body The body parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 enforce( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String adaptiveNetworkHardeningResourceName, - AdaptiveNetworkHardeningEnforceRequest body, - Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardeningsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardeningsList.java deleted file mode 100644 index f4c80bcc0897..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdaptiveNetworkHardeningsList.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Response for ListAdaptiveNetworkHardenings API service call. */ -@Fluent -public final class AdaptiveNetworkHardeningsList { - /* - * A list of Adaptive Network Hardenings resources - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URL to get the next set of results - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** Creates an instance of AdaptiveNetworkHardeningsList class. */ - public AdaptiveNetworkHardeningsList() { - } - - /** - * Get the value property: A list of Adaptive Network Hardenings resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: A list of Adaptive Network Hardenings resources. - * - * @param value the value value to set. - * @return the AdaptiveNetworkHardeningsList object itself. - */ - public AdaptiveNetworkHardeningsList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to get the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the AdaptiveNetworkHardeningsList object itself. - */ - public AdaptiveNetworkHardeningsList 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/AdditionalData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalData.java deleted file mode 100644 index ded9fba6be53..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalData.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.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Details of the sub-assessment. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "assessedResourceType", - defaultImpl = AdditionalData.class) -@JsonTypeName("AdditionalData") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "SqlServerVulnerability", value = SqlServerVulnerabilityProperties.class), - @JsonSubTypes.Type(name = "ContainerRegistryVulnerability", value = ContainerRegistryVulnerabilityProperties.class), - @JsonSubTypes.Type(name = "ServerVulnerabilityAssessment", value = ServerVulnerabilityProperties.class) -}) -@Immutable -public class AdditionalData { - /** Creates an instance of AdditionalData class. */ - public 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/AdditionalWorkspaceDataType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceDataType.java deleted file mode 100644 index a449a76a1c09..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceDataType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Data types sent to workspace. */ -public final class AdditionalWorkspaceDataType extends ExpandableStringEnum { - /** Static value Alerts for AdditionalWorkspaceDataType. */ - public static final AdditionalWorkspaceDataType ALERTS = fromString("Alerts"); - - /** Static value RawEvents for AdditionalWorkspaceDataType. */ - public static final AdditionalWorkspaceDataType RAW_EVENTS = fromString("RawEvents"); - - /** - * Creates a new instance of AdditionalWorkspaceDataType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdditionalWorkspaceDataType() { - } - - /** - * Creates or finds a AdditionalWorkspaceDataType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdditionalWorkspaceDataType. - */ - @JsonCreator - public static AdditionalWorkspaceDataType fromString(String name) { - return fromString(name, AdditionalWorkspaceDataType.class); - } - - /** - * Gets known AdditionalWorkspaceDataType values. - * - * @return known AdditionalWorkspaceDataType values. - */ - public static Collection values() { - return values(AdditionalWorkspaceDataType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceType.java deleted file mode 100644 index e893e00c1bbc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspaceType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Workspace type. */ -public final class AdditionalWorkspaceType extends ExpandableStringEnum { - /** Static value Sentinel for AdditionalWorkspaceType. */ - public static final AdditionalWorkspaceType SENTINEL = fromString("Sentinel"); - - /** - * Creates a new instance of AdditionalWorkspaceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AdditionalWorkspaceType() { - } - - /** - * Creates or finds a AdditionalWorkspaceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AdditionalWorkspaceType. - */ - @JsonCreator - public static AdditionalWorkspaceType fromString(String name) { - return fromString(name, AdditionalWorkspaceType.class); - } - - /** - * Gets known AdditionalWorkspaceType values. - * - * @return known AdditionalWorkspaceType values. - */ - public static Collection values() { - return values(AdditionalWorkspaceType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspacesProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspacesProperties.java deleted file mode 100644 index 7cd4c486ec2d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdditionalWorkspacesProperties.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the additional workspaces. */ -@Fluent -public final class AdditionalWorkspacesProperties { - /* - * Workspace resource id - */ - @JsonProperty(value = "workspace") - private String workspace; - - /* - * Workspace type. - */ - @JsonProperty(value = "type") - private AdditionalWorkspaceType type; - - /* - * List of data types sent to workspace - */ - @JsonProperty(value = "dataTypes") - private List dataTypes; - - /** Creates an instance of AdditionalWorkspacesProperties class. */ - public AdditionalWorkspacesProperties() { - } - - /** - * Get the workspace property: Workspace resource id. - * - * @return the workspace value. - */ - public String workspace() { - return this.workspace; - } - - /** - * Set the workspace property: Workspace resource id. - * - * @param workspace the workspace value to set. - * @return the AdditionalWorkspacesProperties object itself. - */ - public AdditionalWorkspacesProperties withWorkspace(String workspace) { - this.workspace = workspace; - return this; - } - - /** - * Get the type property: Workspace type. - * - * @return the type value. - */ - public AdditionalWorkspaceType type() { - return this.type; - } - - /** - * Set the type property: Workspace type. - * - * @param type the type value to set. - * @return the AdditionalWorkspacesProperties object itself. - */ - public AdditionalWorkspacesProperties withType(AdditionalWorkspaceType type) { - this.type = type; - return this; - } - - /** - * Get the dataTypes property: List of data types sent to workspace. - * - * @return the dataTypes value. - */ - public List dataTypes() { - return this.dataTypes; - } - - /** - * Set the dataTypes property: List of data types sent to workspace. - * - * @param dataTypes the dataTypes value to set. - * @return the AdditionalWorkspacesProperties object itself. - */ - public AdditionalWorkspacesProperties withDataTypes(List dataTypes) { - this.dataTypes = dataTypes; - 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/AdvancedThreatProtectionSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtectionSetting.java deleted file mode 100644 index d7a8bd563ad0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtectionSetting.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionSettingInner; - -/** An immutable client-side representation of AdvancedThreatProtectionSetting. */ -public interface AdvancedThreatProtectionSetting { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the isEnabled property: Indicates whether Advanced Threat Protection is enabled. - * - * @return the isEnabled value. - */ - Boolean isEnabled(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionSettingInner object. - * - * @return the inner object. - */ - AdvancedThreatProtectionSettingInner innerModel(); - - /** The entirety of the AdvancedThreatProtectionSetting definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - /** The AdvancedThreatProtectionSetting definition stages. */ - interface DefinitionStages { - /** The first stage of the AdvancedThreatProtectionSetting definition. */ - interface Blank extends WithScope { - } - /** The stage of the AdvancedThreatProtectionSetting definition allowing to specify parent resource. */ - interface WithScope { - /** - * Specifies resourceId. - * - * @param resourceId The identifier of the resource. - * @return the next definition stage. - */ - WithCreate withExistingResourceId(String resourceId); - } - /** - * The stage of the AdvancedThreatProtectionSetting definition which contains all the minimum required - * properties for the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithIsEnabled { - /** - * Executes the create request. - * - * @return the created resource. - */ - AdvancedThreatProtectionSetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AdvancedThreatProtectionSetting create(Context context); - } - /** The stage of the AdvancedThreatProtectionSetting definition allowing to specify isEnabled. */ - interface WithIsEnabled { - /** - * Specifies the isEnabled property: Indicates whether Advanced Threat Protection is enabled.. - * - * @param isEnabled Indicates whether Advanced Threat Protection is enabled. - * @return the next definition stage. - */ - WithCreate withIsEnabled(Boolean isEnabled); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AdvancedThreatProtectionSetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AdvancedThreatProtectionSetting refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtections.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtections.java deleted file mode 100644 index e513a77e747a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AdvancedThreatProtections.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of AdvancedThreatProtections. */ -public interface AdvancedThreatProtections { - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection settings for the specified resource along with {@link Response}. - */ - Response getWithResponse(String resourceId, Context context); - - /** - * Gets the Advanced Threat Protection settings for the specified 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 the Advanced Threat Protection settings for the specified resource. - */ - AdvancedThreatProtectionSetting get(String resourceId); - - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection settings for the specified resource along with {@link Response}. - */ - AdvancedThreatProtectionSetting getById(String id); - - /** - * Gets the Advanced Threat Protection settings for the specified resource. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the Advanced Threat Protection settings for the specified resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new AdvancedThreatProtectionSetting resource. - * - * @return the first stage of the new AdvancedThreatProtectionSetting definition. - */ - AdvancedThreatProtectionSetting.DefinitionStages.Blank define(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alert.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alert.java deleted file mode 100644 index a0dd46410ce7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alert.java +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All 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.AlertInner; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of Alert. */ -public interface Alert { - /** - * 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 version property: Schema version. - * - * @return the version value. - */ - String version(); - - /** - * Gets the alertType property: Unique identifier for the detection logic (all alert instances from the same - * detection logic will have the same alertType). - * - * @return the alertType value. - */ - String alertType(); - - /** - * Gets the systemAlertId property: Unique identifier for the alert. - * - * @return the systemAlertId value. - */ - String systemAlertId(); - - /** - * Gets the productComponentName property: The name of Azure Security Center pricing tier which powering this alert. - * Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing. - * - * @return the productComponentName value. - */ - String productComponentName(); - - /** - * Gets the alertDisplayName property: The display name of the alert. - * - * @return the alertDisplayName value. - */ - String alertDisplayName(); - - /** - * Gets the description property: Description of the suspicious activity that was detected. - * - * @return the description value. - */ - String description(); - - /** - * Gets the severity property: The risk level of the threat that was detected. Learn more: - * https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. - * - * @return the severity value. - */ - AlertSeverity severity(); - - /** - * Gets the intent property: The kill chain related intent behind the alert. For list of supported values, and - * explanations of Azure Security Center's supported kill chain intents. - * - * @return the intent value. - */ - Intent intent(); - - /** - * Gets the startTimeUtc property: The UTC time of the first event or activity included in the alert in ISO8601 - * format. - * - * @return the startTimeUtc value. - */ - OffsetDateTime startTimeUtc(); - - /** - * Gets the endTimeUtc property: The UTC time of the last event or activity included in the alert in ISO8601 format. - * - * @return the endTimeUtc value. - */ - OffsetDateTime endTimeUtc(); - - /** - * Gets the resourceIdentifiers property: The resource identifiers that can be used to direct the alert to the right - * product exposure group (tenant, workspace, subscription etc.). There can be multiple identifiers of different - * type per alert. - * - * @return the resourceIdentifiers value. - */ - List resourceIdentifiers(); - - /** - * Gets the remediationSteps property: Manual action items to take to remediate the alert. - * - * @return the remediationSteps value. - */ - List remediationSteps(); - - /** - * Gets the vendorName property: The name of the vendor that raises the alert. - * - * @return the vendorName value. - */ - String vendorName(); - - /** - * Gets the status property: The life cycle status of the alert. - * - * @return the status value. - */ - AlertStatus status(); - - /** - * Gets the extendedLinks property: Links related to the alert. - * - * @return the extendedLinks value. - */ - List> extendedLinks(); - - /** - * Gets the alertUri property: A direct link to the alert page in Azure Portal. - * - * @return the alertUri value. - */ - String alertUri(); - - /** - * Gets the timeGeneratedUtc property: The UTC time the alert was generated in ISO8601 format. - * - * @return the timeGeneratedUtc value. - */ - OffsetDateTime timeGeneratedUtc(); - - /** - * Gets the productName property: The name of the product which published this alert (Microsoft Sentinel, Microsoft - * Defender for Identity, Microsoft Defender for Endpoint, Microsoft Defender for Office, Microsoft Defender for - * Cloud Apps, and so on). - * - * @return the productName value. - */ - String productName(); - - /** - * Gets the processingEndTimeUtc property: The UTC processing end time of the alert in ISO8601 format. - * - * @return the processingEndTimeUtc value. - */ - OffsetDateTime processingEndTimeUtc(); - - /** - * Gets the entities property: A list of entities related to the alert. - * - * @return the entities value. - */ - List entities(); - - /** - * Gets the isIncident property: This field determines whether the alert is an incident (a compound grouping of - * several alerts) or a single alert. - * - * @return the isIncident value. - */ - Boolean isIncident(); - - /** - * Gets the correlationKey property: Key for corelating related alerts. Alerts with the same correlation key - * considered to be related. - * - * @return the correlationKey value. - */ - String correlationKey(); - - /** - * Gets the extendedProperties property: Custom properties for the alert. - * - * @return the extendedProperties value. - */ - Map extendedProperties(); - - /** - * Gets the compromisedEntity property: The display name of the resource most related to this alert. - * - * @return the compromisedEntity value. - */ - String compromisedEntity(); - - /** - * Gets the techniques property: kill chain related techniques behind the alert. - * - * @return the techniques value. - */ - List techniques(); - - /** - * Gets the subTechniques property: Kill chain related sub-techniques behind the alert. - * - * @return the subTechniques value. - */ - List subTechniques(); - - /** - * Gets the supportingEvidence property: Changing set of properties depending on the supportingEvidence type. - * - * @return the supportingEvidence value. - */ - AlertPropertiesSupportingEvidence supportingEvidence(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AlertInner object. - * - * @return the inner object. - */ - AlertInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertEntity.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertEntity.java deleted file mode 100644 index b835d2cab6fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertEntity.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** Changing set of properties depending on the entity type. */ -@Fluent -public final class AlertEntity { - /* - * Type of entity - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Changing set of properties depending on the entity type. - */ - @JsonIgnore private Map additionalProperties; - - /** Creates an instance of AlertEntity class. */ - public AlertEntity() { - } - - /** - * Get the type property: Type of entity. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the additionalProperties property: Changing set of properties depending on the entity type. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Changing set of properties depending on the entity type. - * - * @param additionalProperties the additionalProperties value to set. - * @return the AlertEntity object itself. - */ - public AlertEntity withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertList.java deleted file mode 100644 index 3e5b19511e57..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertList.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.AlertInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of security alerts. */ -@Fluent -public final class AlertList { - /* - * describes security alert properties. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of AlertList class. */ - public AlertList() { - } - - /** - * Get the value property: describes security alert properties. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: describes security alert properties. - * - * @param value the value value to set. - * @return the AlertList object itself. - */ - public AlertList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertPropertiesSupportingEvidence.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertPropertiesSupportingEvidence.java deleted file mode 100644 index b0e6a2f61c50..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertPropertiesSupportingEvidence.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** Changing set of properties depending on the supportingEvidence type. */ -@Fluent -public final class AlertPropertiesSupportingEvidence { - /* - * Type of the supportingEvidence - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * Changing set of properties depending on the supportingEvidence type. - */ - @JsonIgnore private Map additionalProperties; - - /** Creates an instance of AlertPropertiesSupportingEvidence class. */ - public AlertPropertiesSupportingEvidence() { - } - - /** - * Get the type property: Type of the supportingEvidence. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the additionalProperties property: Changing set of properties depending on the supportingEvidence type. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Changing set of properties depending on the supportingEvidence type. - * - * @param additionalProperties the additionalProperties value to set. - * @return the AlertPropertiesSupportingEvidence object itself. - */ - public AlertPropertiesSupportingEvidence withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSeverity.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSeverity.java deleted file mode 100644 index 52eb272a6f13..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSeverity.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * The risk level of the threat that was detected. Learn more: - * https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. - */ -public final class AlertSeverity extends ExpandableStringEnum { - /** Static value Informational for AlertSeverity. */ - public static final AlertSeverity INFORMATIONAL = fromString("Informational"); - - /** Static value Low for AlertSeverity. */ - public static final AlertSeverity LOW = fromString("Low"); - - /** Static value Medium for AlertSeverity. */ - public static final AlertSeverity MEDIUM = fromString("Medium"); - - /** Static value High for AlertSeverity. */ - public static final AlertSeverity HIGH = fromString("High"); - - /** - * Creates a new instance of AlertSeverity value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AlertSeverity() { - } - - /** - * Creates or finds a AlertSeverity from its string representation. - * - * @param name a name to look for. - * @return the corresponding AlertSeverity. - */ - @JsonCreator - public static AlertSeverity fromString(String name) { - return fromString(name, AlertSeverity.class); - } - - /** - * Gets known AlertSeverity values. - * - * @return known AlertSeverity values. - */ - public static Collection values() { - return values(AlertSeverity.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorBundlesRequestProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorBundlesRequestProperties.java deleted file mode 100644 index 63f1f1f6633b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorBundlesRequestProperties.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Simulate alerts according to this bundles. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("Bundles") -@Fluent -public final class AlertSimulatorBundlesRequestProperties extends AlertSimulatorRequestProperties { - /* - * Bundles list. - */ - @JsonProperty(value = "bundles") - private List bundles; - - /** Creates an instance of AlertSimulatorBundlesRequestProperties class. */ - public AlertSimulatorBundlesRequestProperties() { - } - - /** - * Get the bundles property: Bundles list. - * - * @return the bundles value. - */ - public List bundles() { - return this.bundles; - } - - /** - * Set the bundles property: Bundles list. - * - * @param bundles the bundles value to set. - * @return the AlertSimulatorBundlesRequestProperties object itself. - */ - public AlertSimulatorBundlesRequestProperties withBundles(List bundles) { - this.bundles = bundles; - 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/AlertSimulatorRequestBody.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorRequestBody.java deleted file mode 100644 index 0e6c98294c16..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorRequestBody.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Alert Simulator request body. */ -@Fluent -public final class AlertSimulatorRequestBody { - /* - * Alert Simulator request body data. - */ - @JsonProperty(value = "properties") - private AlertSimulatorRequestProperties properties; - - /** Creates an instance of AlertSimulatorRequestBody class. */ - public AlertSimulatorRequestBody() { - } - - /** - * Get the properties property: Alert Simulator request body data. - * - * @return the properties value. - */ - public AlertSimulatorRequestProperties properties() { - return this.properties; - } - - /** - * Set the properties property: Alert Simulator request body data. - * - * @param properties the properties value to set. - * @return the AlertSimulatorRequestBody object itself. - */ - public AlertSimulatorRequestBody withProperties(AlertSimulatorRequestProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorRequestProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorRequestProperties.java deleted file mode 100644 index f4bc7b5b76c8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSimulatorRequestProperties.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.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.HashMap; -import java.util.Map; - -/** Describes properties of an alert simulation request. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = AlertSimulatorRequestProperties.class) -@JsonTypeName("AlertSimulatorRequestProperties") -@JsonSubTypes({@JsonSubTypes.Type(name = "Bundles", value = AlertSimulatorBundlesRequestProperties.class)}) -@Fluent -public class AlertSimulatorRequestProperties { - /* - * Describes properties of an alert simulation request - */ - @JsonIgnore private Map additionalProperties; - - /** Creates an instance of AlertSimulatorRequestProperties class. */ - public AlertSimulatorRequestProperties() { - } - - /** - * Get the additionalProperties property: Describes properties of an alert simulation request. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Describes properties of an alert simulation request. - * - * @param additionalProperties the additionalProperties value to set. - * @return the AlertSimulatorRequestProperties object itself. - */ - public AlertSimulatorRequestProperties withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertStatus.java deleted file mode 100644 index 4a5d9c3eebbc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertStatus.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The life cycle status of the alert. */ -public final class AlertStatus extends ExpandableStringEnum { - /** Static value Active for AlertStatus. */ - public static final AlertStatus ACTIVE = fromString("Active"); - - /** Static value InProgress for AlertStatus. */ - public static final AlertStatus IN_PROGRESS = fromString("InProgress"); - - /** Static value Resolved for AlertStatus. */ - public static final AlertStatus RESOLVED = fromString("Resolved"); - - /** Static value Dismissed for AlertStatus. */ - public static final AlertStatus DISMISSED = fromString("Dismissed"); - - /** - * Creates a new instance of AlertStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AlertStatus() { - } - - /** - * Creates or finds a AlertStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding AlertStatus. - */ - @JsonCreator - public static AlertStatus fromString(String name) { - return fromString(name, AlertStatus.class); - } - - /** - * Gets known AlertStatus values. - * - * @return known AlertStatus values. - */ - public static Collection values() { - return values(AlertStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.java deleted file mode 100644 index 029123d93568..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertSyncSettings.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.AlertSyncSettingProperties; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Represents an alert sync setting. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("AlertSyncSettings") -@Fluent -public final class AlertSyncSettings extends SettingInner { - /* - * Alert sync setting data - */ - @JsonProperty(value = "properties") - private AlertSyncSettingProperties innerProperties; - - /** Creates an instance of AlertSyncSettings class. */ - public AlertSyncSettings() { - } - - /** - * Get the innerProperties property: Alert sync setting data. - * - * @return the innerProperties value. - */ - private AlertSyncSettingProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the enabled property: Is the alert sync setting enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.innerProperties() == null ? null : this.innerProperties().enabled(); - } - - /** - * Set the enabled property: Is the alert sync setting enabled. - * - * @param enabled the enabled value to set. - * @return the AlertSyncSettings object itself. - */ - public AlertSyncSettings withEnabled(Boolean enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new AlertSyncSettingProperties(); - } - this.innerProperties().withEnabled(enabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java deleted file mode 100644 index 6b849c8c6c06..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Alerts.java +++ /dev/null @@ -1,428 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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 Alerts. */ -public interface Alerts { - /** - * List all the alerts that are associated with the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List all the alerts that are associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * List all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List all the alerts that are associated with the resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable listSubscriptionLevelByRegion(String ascLocation); - - /** - * List all the alerts that are associated with the subscription that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable listSubscriptionLevelByRegion(String ascLocation, Context context); - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName); - - /** - * List all the alerts that are associated with the resource group that are stored in a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security alerts as paginated response with {@link PagedIterable}. - */ - PagedIterable listResourceGroupLevelByRegion(String ascLocation, String resourceGroupName, Context context); - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated with a subscription along with {@link Response}. - */ - Response getSubscriptionLevelWithResponse(String ascLocation, String alertName, Context context); - - /** - * Get an alert that is associated with a subscription. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated with a subscription. - */ - Alert getSubscriptionLevel(String ascLocation, String alertName); - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated a resource group or a resource in a resource group along with {@link - * Response}. - */ - Response getResourceGroupLevelWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context); - - /** - * Get an alert that is associated a resource group or a resource in a resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an alert that is associated a resource group or a resource in a resource group. - */ - Alert getResourceGroupLevel(String resourceGroupName, String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response updateSubscriptionLevelStateToDismissWithResponse( - String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void updateSubscriptionLevelStateToDismiss(String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response updateSubscriptionLevelStateToResolveWithResponse( - String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void updateSubscriptionLevelStateToResolve(String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response updateSubscriptionLevelStateToActivateWithResponse( - String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void updateSubscriptionLevelStateToActivate(String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response updateSubscriptionLevelStateToInProgressWithResponse( - String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void updateSubscriptionLevelStateToInProgress(String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response updateResourceGroupLevelStateToResolveWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void updateResourceGroupLevelStateToResolve(String resourceGroupName, String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response updateResourceGroupLevelStateToDismissWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void updateResourceGroupLevelStateToDismiss(String resourceGroupName, String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response updateResourceGroupLevelStateToActivateWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void updateResourceGroupLevelStateToActivate(String resourceGroupName, String ascLocation, String alertName); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response updateResourceGroupLevelStateToInProgressWithResponse( - String resourceGroupName, String ascLocation, String alertName, Context context); - - /** - * Update the alert's state. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertName Name of the alert object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void updateResourceGroupLevelStateToInProgress(String resourceGroupName, String ascLocation, String alertName); - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody); - - /** - * Simulate security alerts. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param alertSimulatorRequestBody Alert Simulator Request Properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 simulate(String ascLocation, AlertSimulatorRequestBody alertSimulatorRequestBody, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRule.java deleted file mode 100644 index 4e7c2860f5f7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRule.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of AlertsSuppressionRule. */ -public interface AlertsSuppressionRule { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the alertType property: Type of the alert to automatically suppress. For all alert types, use '*'. - * - * @return the alertType value. - */ - String alertType(); - - /** - * Gets the lastModifiedUtc property: The last time this rule was modified. - * - * @return the lastModifiedUtc value. - */ - OffsetDateTime lastModifiedUtc(); - - /** - * Gets the expirationDateUtc property: Expiration date of the rule, if value is not provided or provided as null - * this field will default to the maximum allowed expiration date. - * - * @return the expirationDateUtc value. - */ - OffsetDateTime expirationDateUtc(); - - /** - * Gets the reason property: The reason for dismissing the alert. - * - * @return the reason value. - */ - String reason(); - - /** - * Gets the state property: Possible states of the rule. - * - * @return the state value. - */ - RuleState state(); - - /** - * Gets the comment property: Any comment regarding the rule. - * - * @return the comment value. - */ - String comment(); - - /** - * Gets the suppressionAlertsScope property: The suppression conditions. - * - * @return the suppressionAlertsScope value. - */ - SuppressionAlertsScope suppressionAlertsScope(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner object. - * - * @return the inner object. - */ - AlertsSuppressionRuleInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRules.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRules.java deleted file mode 100644 index 201e06daeff1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRules.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; - -/** Resource collection API of AlertsSuppressionRules. */ -public interface AlertsSuppressionRules { - /** - * List of all the dismiss rules for the given subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List of all the dismiss rules for the given subscription. - * - * @param alertType Type of the alert to get rules for. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return suppression rules list for subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String alertType, Context context); - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription along with {@link - * Response}. - */ - Response getWithResponse(String alertsSuppressionRuleName, Context context); - - /** - * Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - */ - AlertsSuppressionRule get(String alertsSuppressionRuleName); - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule along with {@link Response}. - */ - Response updateWithResponse( - String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule, Context context); - - /** - * Update existing rule or create new rule if it doesn't exist. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param alertsSuppressionRule Suppression rule object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the suppression rule. - */ - AlertsSuppressionRule update(String alertsSuppressionRuleName, AlertsSuppressionRuleInner alertsSuppressionRule); - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String alertsSuppressionRuleName, Context context); - - /** - * Delete dismiss alert rule for this subscription. - * - * @param alertsSuppressionRuleName The unique name of the suppression alert rule. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String alertsSuppressionRuleName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRulesList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRulesList.java deleted file mode 100644 index 7d0e5106fcd2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AlertsSuppressionRulesList.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Suppression rules list for subscription. */ -@Fluent -public final class AlertsSuppressionRulesList { - /* - * The value property. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of AlertsSuppressionRulesList class. */ - public AlertsSuppressionRulesList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the AlertsSuppressionRulesList object itself. - */ - public AlertsSuppressionRulesList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model AlertsSuppressionRulesList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AlertsSuppressionRulesList.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnections.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnections.java deleted file mode 100644 index 7dc20e8e9240..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnections.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.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of AllowedConnections. */ -public interface AllowedConnections { - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(); - - /** - * Gets the list of all possible traffic between resources for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets the list of all possible traffic between resources for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location as paginated - * response with {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location, based on connection - * type along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String ascLocation, ConnectionType connectionType, Context context); - - /** - * Gets the list of all possible traffic between resources for the subscription and location, based on connection - * type. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param connectionType The type of allowed connections (Internal, External). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the list of all possible traffic between resources for the subscription and location, based on connection - * type. - */ - AllowedConnectionsResource get(String resourceGroupName, String ascLocation, ConnectionType connectionType); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsList.java deleted file mode 100644 index aa29c6120ec3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsList.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.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of all possible traffic between Azure resources. */ -@Immutable -public final class AllowedConnectionsList { - /* - * The value property. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of AllowedConnectionsList class. */ - public AllowedConnectionsList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsResource.java deleted file mode 100644 index f7544bb61cef..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowedConnectionsResource.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.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of AllowedConnectionsResource. */ -public interface AllowedConnectionsResource { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - - /** - * Gets the calculatedDateTime property: The UTC time on which the allowed connections resource was calculated. - * - * @return the calculatedDateTime value. - */ - OffsetDateTime calculatedDateTime(); - - /** - * Gets the connectableResources property: List of connectable resources. - * - * @return the connectableResources value. - */ - List connectableResources(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner object. - * - * @return the inner object. - */ - AllowedConnectionsResourceInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowlistCustomAlertRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowlistCustomAlertRule.java deleted file mode 100644 index 31e157bbd2e8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AllowlistCustomAlertRule.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** A custom alert rule that checks if a value (depends on the custom alert type) is allowed. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "ruleType", - defaultImpl = AllowlistCustomAlertRule.class) -@JsonTypeName("AllowlistCustomAlertRule") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "ConnectionToIpNotAllowed", value = ConnectionToIpNotAllowed.class), - @JsonSubTypes.Type(name = "ConnectionFromIpNotAllowed", value = ConnectionFromIpNotAllowed.class), - @JsonSubTypes.Type(name = "LocalUserNotAllowed", value = LocalUserNotAllowed.class), - @JsonSubTypes.Type(name = "ProcessNotAllowed", value = ProcessNotAllowed.class) -}) -@Fluent -public class AllowlistCustomAlertRule extends ListCustomAlertRule { - /* - * The values to allow. The format of the values depends on the rule type. - */ - @JsonProperty(value = "allowlistValues", required = true) - private List allowlistValues; - - /** Creates an instance of AllowlistCustomAlertRule class. */ - public AllowlistCustomAlertRule() { - } - - /** - * Get the allowlistValues property: The values to allow. The format of the values depends on the rule type. - * - * @return the allowlistValues value. - */ - public List allowlistValues() { - return this.allowlistValues; - } - - /** - * Set the allowlistValues property: The values to allow. The format of the values depends on the rule type. - * - * @param allowlistValues the allowlistValues value to set. - * @return the AllowlistCustomAlertRule object itself. - */ - public AllowlistCustomAlertRule withAllowlistValues(List allowlistValues) { - this.allowlistValues = allowlistValues; - return this; - } - - /** {@inheritDoc} */ - @Override - public AllowlistCustomAlertRule withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (allowlistValues() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property allowlistValues in model AllowlistCustomAlertRule")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AllowlistCustomAlertRule.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpC2DMessagesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpC2DMessagesNotInAllowedRange.java deleted file mode 100644 index 14079d7a02f2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpC2DMessagesNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of cloud to device messages (AMQP protocol) is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("AmqpC2DMessagesNotInAllowedRange") -@Fluent -public final class AmqpC2DMessagesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of AmqpC2DMessagesNotInAllowedRange class. */ - public AmqpC2DMessagesNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public AmqpC2DMessagesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public AmqpC2DMessagesNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public AmqpC2DMessagesNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public AmqpC2DMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/AmqpC2DRejectedMessagesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpC2DRejectedMessagesNotInAllowedRange.java deleted file mode 100644 index 833c457e1fcc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpC2DRejectedMessagesNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of rejected cloud to device messages (AMQP protocol) is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("AmqpC2DRejectedMessagesNotInAllowedRange") -@Fluent -public final class AmqpC2DRejectedMessagesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of AmqpC2DRejectedMessagesNotInAllowedRange class. */ - public AmqpC2DRejectedMessagesNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public AmqpC2DRejectedMessagesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public AmqpC2DRejectedMessagesNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public AmqpC2DRejectedMessagesNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public AmqpC2DRejectedMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/AmqpD2CMessagesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpD2CMessagesNotInAllowedRange.java deleted file mode 100644 index d7cb03368abc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AmqpD2CMessagesNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of device to cloud messages (AMQP protocol) is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("AmqpD2CMessagesNotInAllowedRange") -@Fluent -public final class AmqpD2CMessagesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of AmqpD2CMessagesNotInAllowedRange class. */ - public AmqpD2CMessagesNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public AmqpD2CMessagesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public AmqpD2CMessagesNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public AmqpD2CMessagesNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public AmqpD2CMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/ApiCollectionOffboardings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOffboardings.java deleted file mode 100644 index 8fbc3ffe617e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionOffboardings.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of ApiCollectionOffboardings. */ -public interface ApiCollectionOffboardings { - /** - * Offboard an Azure API Management API from Defender for APIs - * - *

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

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

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

Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations - * within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an API collection as represented by Defender for APIs. - */ - ApiCollectionResponse create(String resourceGroupName, String serviceName, String apiCollectionId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionResponse.java deleted file mode 100644 index 31a6750de1f3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionResponse.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.ApiCollectionResponseInner; -import java.util.Map; - -/** An immutable client-side representation of ApiCollectionResponse. */ -public interface ApiCollectionResponse { - /** - * 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: The display name of the Azure API Management API. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the additionalData property: Additional data regarding the API collection. - * - * @return the additionalData value. - */ - Map additionalData(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner object. - * - * @return the inner object. - */ - ApiCollectionResponseInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionResponseList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionResponseList.java deleted file mode 100644 index 2666ef531123..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollectionResponseList.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.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Page of a list of API collections as represented by Defender for APIs. */ -@Immutable -public final class ApiCollectionResponseList { - /* - * API collections in this page. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of ApiCollectionResponseList class. */ - public ApiCollectionResponseList() { - } - - /** - * Get the value property: API collections in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollections.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollections.java deleted file mode 100644 index d21a442595cb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApiCollections.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of ApiCollections. */ -public interface ApiCollections { - /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String serviceName); - - /** - * Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs - * - *

Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API - * Management API is onboarded to Defender for APIs, the system will monitor the operations within the Azure API - * Management API for intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Azure API Management APIs that have been onboarded to Defender for APIs as paginated response - * with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String serviceName, Context context); - - /** - * Gets an Azure API Management API if it has been onboarded to Defender for APIs - * - *

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

Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API - * is onboarded to Defender for APIs, the system will monitor the operations within the Azure API Management API for - * intrusive behaviors and provide alerts for attacks that have been detected. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param serviceName The name of the API Management service. - * @param apiCollectionId A string representing the apiCollections resource within the Microsoft.Security provider - * namespace. This string matches the Azure API Management API name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an Azure API Management API if it has been onboarded to Defender for APIs. - */ - ApiCollectionResponse get(String resourceGroupName, String serviceName, String apiCollectionId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Application.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Application.java deleted file mode 100644 index 9a2925359582..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Application.java +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import java.util.List; - -/** An immutable client-side representation of Application. */ -public interface Application { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the displayName property: display name of the application. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the description property: description of the application. - * - * @return the description value. - */ - String description(); - - /** - * Gets the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - ApplicationSourceResourceType sourceResourceType(); - - /** - * Gets the conditionSets property: The application conditionSets - see examples. - * - * @return the conditionSets value. - */ - List conditionSets(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ApplicationInner object. - * - * @return the inner object. - */ - ApplicationInner innerModel(); - - /** The entirety of the Application definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - /** The Application definition stages. */ - interface DefinitionStages { - /** The first stage of the Application definition. */ - interface Blank extends WithCreate { - } - /** - * The stage of the Application definition which contains all the minimum required properties for the resource - * to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithDisplayName, - DefinitionStages.WithDescription, - DefinitionStages.WithSourceResourceType, - DefinitionStages.WithConditionSets { - /** - * Executes the create request. - * - * @return the created resource. - */ - Application create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Application create(Context context); - } - /** The stage of the Application definition allowing to specify displayName. */ - interface WithDisplayName { - /** - * Specifies the displayName property: display name of the application. - * - * @param displayName display name of the application. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - /** The stage of the Application definition allowing to specify description. */ - interface WithDescription { - /** - * Specifies the description property: description of the application. - * - * @param description description of the application. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - /** The stage of the Application definition allowing to specify sourceResourceType. */ - interface WithSourceResourceType { - /** - * Specifies the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @param sourceResourceType The application source, what it affects, e.g. Assessments. - * @return the next definition stage. - */ - WithCreate withSourceResourceType(ApplicationSourceResourceType sourceResourceType); - } - /** The stage of the Application definition allowing to specify conditionSets. */ - interface WithConditionSets { - /** - * Specifies the conditionSets property: The application conditionSets - see examples. - * - * @param conditionSets The application conditionSets - see examples. - * @return the next definition stage. - */ - WithCreate withConditionSets(List conditionSets); - } - } - /** - * Begins update for the Application resource. - * - * @return the stage of resource update. - */ - Application.Update update(); - - /** The template for Application update. */ - interface Update - extends UpdateStages.WithDisplayName, - UpdateStages.WithDescription, - UpdateStages.WithSourceResourceType, - UpdateStages.WithConditionSets { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Application apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Application apply(Context context); - } - /** The Application update stages. */ - interface UpdateStages { - /** The stage of the Application update allowing to specify displayName. */ - interface WithDisplayName { - /** - * Specifies the displayName property: display name of the application. - * - * @param displayName display name of the application. - * @return the next definition stage. - */ - Update withDisplayName(String displayName); - } - /** The stage of the Application update allowing to specify description. */ - interface WithDescription { - /** - * Specifies the description property: description of the application. - * - * @param description description of the application. - * @return the next definition stage. - */ - Update withDescription(String description); - } - /** The stage of the Application update allowing to specify sourceResourceType. */ - interface WithSourceResourceType { - /** - * Specifies the sourceResourceType property: The application source, what it affects, e.g. Assessments. - * - * @param sourceResourceType The application source, what it affects, e.g. Assessments. - * @return the next definition stage. - */ - Update withSourceResourceType(ApplicationSourceResourceType sourceResourceType); - } - /** The stage of the Application update allowing to specify conditionSets. */ - interface WithConditionSets { - /** - * Specifies the conditionSets property: The application conditionSets - see examples. - * - * @param conditionSets The application conditionSets - see examples. - * @return the next definition stage. - */ - Update withConditionSets(List conditionSets); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Application refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Application refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationOperations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationOperations.java deleted file mode 100644 index 233b962c3115..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationOperations.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of ApplicationOperations. */ -public interface ApplicationOperations { - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - Response getWithResponse(String applicationId, Context context); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId. - */ - Application get(String applicationId); - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String applicationId, Context context); - - /** - * Delete an Application over a given scope. - * - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String applicationId); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - Application getById(String id); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete an Application over a given scope. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete an Application over a given scope. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Application resource. - * - * @param name resource name. - * @return the first stage of the new Application definition. - */ - Application.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationSourceResourceType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationSourceResourceType.java deleted file mode 100644 index 9d2dd77b7267..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationSourceResourceType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The application source, what it affects, e.g. Assessments. */ -public final class ApplicationSourceResourceType extends ExpandableStringEnum { - /** Static value Assessments for ApplicationSourceResourceType. */ - public static final ApplicationSourceResourceType ASSESSMENTS = fromString("Assessments"); - - /** - * Creates a new instance of ApplicationSourceResourceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ApplicationSourceResourceType() { - } - - /** - * Creates or finds a ApplicationSourceResourceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplicationSourceResourceType. - */ - @JsonCreator - public static ApplicationSourceResourceType fromString(String name) { - return fromString(name, ApplicationSourceResourceType.class); - } - - /** - * Gets known ApplicationSourceResourceType values. - * - * @return known ApplicationSourceResourceType values. - */ - public static Collection values() { - return values(ApplicationSourceResourceType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Applications.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Applications.java deleted file mode 100644 index 64f396cfe67c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Applications.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of Applications. */ -public interface Applications { - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(); - - /** - * Get a list of all relevant applications over a subscription level scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a subscription level scope as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationsList.java deleted file mode 100644 index deccd03c7231..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ApplicationsList.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.resourcemanager.security.fluent.models.ApplicationInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Page of a security applications list. */ -@Immutable -public final class ApplicationsList { - /* - * Collection of applications in this page - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of ApplicationsList class. */ - public ApplicationsList() { - } - - /** - * Get the value property: Collection of applications in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocation.java deleted file mode 100644 index f052a42ed916..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocation.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.AscLocationInner; - -/** An immutable client-side representation of AscLocation. */ -public interface AscLocation { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: An empty set of properties. - * - * @return the properties value. - */ - Object properties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AscLocationInner object. - * - * @return the inner object. - */ - AscLocationInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocationList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocationList.java deleted file mode 100644 index c8d7e6191558..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AscLocationList.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.resourcemanager.security.fluent.models.AscLocationInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of locations where ASC saves your data. */ -@Immutable -public final class AscLocationList { - /* - * The value property. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of AscLocationList class. */ - public AscLocationList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessedResourceType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessedResourceType.java deleted file mode 100644 index ac3b775039ef..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessedResourceType.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Sub-assessment resource type. */ -public final class AssessedResourceType extends ExpandableStringEnum { - /** Static value SqlServerVulnerability for AssessedResourceType. */ - public static final AssessedResourceType SQL_SERVER_VULNERABILITY = fromString("SqlServerVulnerability"); - - /** Static value ContainerRegistryVulnerability for AssessedResourceType. */ - public static final AssessedResourceType CONTAINER_REGISTRY_VULNERABILITY = - fromString("ContainerRegistryVulnerability"); - - /** Static value ServerVulnerability for AssessedResourceType. */ - public static final AssessedResourceType SERVER_VULNERABILITY = fromString("ServerVulnerability"); - - /** - * Creates a new instance of AssessedResourceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AssessedResourceType() { - } - - /** - * Creates or finds a AssessedResourceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AssessedResourceType. - */ - @JsonCreator - public static AssessedResourceType fromString(String name) { - return fromString(name, AssessedResourceType.class); - } - - /** - * Gets known AssessedResourceType values. - * - * @return known AssessedResourceType values. - */ - public static Collection values() { - return values(AssessedResourceType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentLinks.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentLinks.java deleted file mode 100644 index 7c6620d027bd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentLinks.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.fasterxml.jackson.annotation.JsonProperty; - -/** Links relevant to the assessment. */ -@Immutable -public final class AssessmentLinks { - /* - * Link to assessment in Azure Portal - */ - @JsonProperty(value = "azurePortalUri", access = JsonProperty.Access.WRITE_ONLY) - private String azurePortalUri; - - /** Creates an instance of AssessmentLinks class. */ - public AssessmentLinks() { - } - - /** - * Get the azurePortalUri property: Link to assessment in Azure Portal. - * - * @return the azurePortalUri value. - */ - public String azurePortalUri() { - return this.azurePortalUri; - } - - /** - * 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/AssessmentStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatus.java deleted file mode 100644 index 3acea6c5664a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatus.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The result of the assessment. */ -@Fluent -public class AssessmentStatus { - /* - * Programmatic code for the status of the assessment - */ - @JsonProperty(value = "code", required = true) - private AssessmentStatusCode code; - - /* - * Programmatic code for the cause of the assessment status - */ - @JsonProperty(value = "cause") - private String cause; - - /* - * Human readable description of the assessment status - */ - @JsonProperty(value = "description") - private String description; - - /** Creates an instance of AssessmentStatus class. */ - public AssessmentStatus() { - } - - /** - * Get the code property: Programmatic code for the status of the assessment. - * - * @return the code value. - */ - public AssessmentStatusCode code() { - return this.code; - } - - /** - * Set the code property: Programmatic code for the status of the assessment. - * - * @param code the code value to set. - * @return the AssessmentStatus object itself. - */ - public AssessmentStatus withCode(AssessmentStatusCode code) { - this.code = code; - return this; - } - - /** - * Get the cause property: Programmatic code for the cause of the assessment status. - * - * @return the cause value. - */ - public String cause() { - return this.cause; - } - - /** - * Set the cause property: Programmatic code for the cause of the assessment status. - * - * @param cause the cause value to set. - * @return the AssessmentStatus object itself. - */ - public AssessmentStatus withCause(String cause) { - this.cause = cause; - return this; - } - - /** - * Get the description property: Human readable description of the assessment status. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Human readable description of the assessment status. - * - * @param description the description value to set. - * @return the AssessmentStatus object itself. - */ - public AssessmentStatus withDescription(String description) { - this.description = description; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (code() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property code in model AssessmentStatus")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AssessmentStatus.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusCode.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusCode.java deleted file mode 100644 index bb42fd8a6653..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusCode.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Programmatic code for the status of the assessment. */ -public final class AssessmentStatusCode extends ExpandableStringEnum { - /** Static value Healthy for AssessmentStatusCode. */ - public static final AssessmentStatusCode HEALTHY = fromString("Healthy"); - - /** Static value Unhealthy for AssessmentStatusCode. */ - public static final AssessmentStatusCode UNHEALTHY = fromString("Unhealthy"); - - /** Static value NotApplicable for AssessmentStatusCode. */ - public static final AssessmentStatusCode NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Creates a new instance of AssessmentStatusCode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AssessmentStatusCode() { - } - - /** - * Creates or finds a AssessmentStatusCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding AssessmentStatusCode. - */ - @JsonCreator - public static AssessmentStatusCode fromString(String name) { - return fromString(name, AssessmentStatusCode.class); - } - - /** - * Gets known AssessmentStatusCode values. - * - * @return known AssessmentStatusCode values. - */ - public static Collection values() { - return values(AssessmentStatusCode.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 deleted file mode 100644 index 44837f46729b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentStatusResponse.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The result of the assessment. */ -@Fluent -public final class AssessmentStatusResponse extends AssessmentStatus { - /* - * 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; - - /** Creates an instance of AssessmentStatusResponse class. */ - public AssessmentStatusResponse() { - } - - /** - * 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/AssessmentType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentType.java deleted file mode 100644 index 18580a1dd30e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure - * Policy definition. - */ -public final class AssessmentType extends ExpandableStringEnum { - /** Static value BuiltIn for AssessmentType. */ - public static final AssessmentType BUILT_IN = fromString("BuiltIn"); - - /** Static value CustomPolicy for AssessmentType. */ - public static final AssessmentType CUSTOM_POLICY = fromString("CustomPolicy"); - - /** Static value CustomerManaged for AssessmentType. */ - public static final AssessmentType CUSTOMER_MANAGED = fromString("CustomerManaged"); - - /** Static value VerifiedPartner for AssessmentType. */ - public static final AssessmentType VERIFIED_PARTNER = fromString("VerifiedPartner"); - - /** - * Creates a new instance of AssessmentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AssessmentType() { - } - - /** - * Creates or finds a AssessmentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AssessmentType. - */ - @JsonCreator - public static AssessmentType fromString(String name) { - return fromString(name, AssessmentType.class); - } - - /** - * Gets known AssessmentType values. - * - * @return known AssessmentType values. - */ - public static Collection values() { - return values(AssessmentType.class); - } -} 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 deleted file mode 100644 index d986d2a6d254..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Assessments.java +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Assessments. */ -public interface Assessments { - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(String scope); - - /** - * Get security assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(String scope, Context context); - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security assessment on your scanned resource along with {@link Response}. - */ - Response getWithResponse( - String resourceId, String assessmentName, ExpandEnum expand, Context context); - - /** - * Get a security assessment on your scanned resource. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security assessment on your scanned resource. - */ - SecurityAssessmentResponse get(String resourceId, String assessmentName); - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByResourceGroupWithResponse(String resourceId, String assessmentName, Context context); - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param resourceId The identifier of the resource. - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceId, String assessmentName); - - /** - * Get a security assessment on your scanned resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security assessment on your scanned resource along with {@link Response}. - */ - SecurityAssessmentResponse getById(String id); - - /** - * Get a security assessment on your scanned resource. - * - * @param id the resource ID. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security assessment on your scanned resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, ExpandEnum expand, Context context); - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a security assessment on your resource. An assessment metadata that describes this assessment must be - * predefined with the same name before inserting the assessment result. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new SecurityAssessmentResponse resource. - * - * @param name resource name. - * @return the first stage of the new SecurityAssessmentResponse definition. - */ - 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 deleted file mode 100644 index e5145325396c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AssessmentsMetadatas.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of AssessmentsMetadatas. */ -public interface AssessmentsMetadatas { - /** - * Get metadata information on all assessment 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 metadata information on all assessment types as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Get metadata information on all assessment 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 metadata information on all assessment types as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type along with {@link Response}. - */ - Response getWithResponse(String assessmentMetadataName, Context context); - - /** - * Get metadata information on an assessment type. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type. - */ - SecurityAssessmentMetadataResponse get(String assessmentMetadataName); - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with {@link - * PagedIterable}. - */ - PagedIterable listBySubscription(); - - /** - * Get metadata information on all assessment types in a specific 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 metadata information on all assessment types in a specific subscription as paginated response with {@link - * PagedIterable}. - */ - PagedIterable listBySubscription(Context context); - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription along with {@link Response}. - */ - Response getInSubscriptionWithResponse( - String assessmentMetadataName, Context context); - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription. - */ - SecurityAssessmentMetadataResponse getInSubscription(String assessmentMetadataName); - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteInSubscriptionWithResponse(String assessmentMetadataName, Context context); - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param assessmentMetadataName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteInSubscription(String assessmentMetadataName); - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription along with {@link Response}. - */ - SecurityAssessmentMetadataResponse getInSubscriptionById(String id); - - /** - * Get metadata information on an assessment type in a specific subscription. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return metadata information on an assessment type in a specific subscription along with {@link Response}. - */ - Response getInSubscriptionByIdWithResponse(String id, Context context); - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteInSubscriptionById(String id); - - /** - * Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the - * assessments of that type in that subscription. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteInSubscriptionByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new SecurityAssessmentMetadataResponse resource. - * - * @param name resource name. - * @return the first stage of the new SecurityAssessmentMetadataResponse definition. - */ - SecurityAssessmentMetadataResponse.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AtaExternalSecuritySolution.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AtaExternalSecuritySolution.java deleted file mode 100644 index 218d2ba95a85..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AtaExternalSecuritySolution.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Represents an ATA security solution which sends logs to an OMS workspace. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("ATA") -@Fluent -public final class AtaExternalSecuritySolution extends ExternalSecuritySolutionInner { - /* - * The external security solution properties for ATA solutions - */ - @JsonProperty(value = "properties") - private AtaSolutionProperties properties; - - /** Creates an instance of AtaExternalSecuritySolution class. */ - public AtaExternalSecuritySolution() { - } - - /** - * Get the properties property: The external security solution properties for ATA solutions. - * - * @return the properties value. - */ - public AtaSolutionProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The external security solution properties for ATA solutions. - * - * @param properties the properties value to set. - * @return the AtaExternalSecuritySolution object itself. - */ - public AtaExternalSecuritySolution withProperties(AtaSolutionProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AtaSolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AtaSolutionProperties.java deleted file mode 100644 index 5167966f1d5d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AtaSolutionProperties.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The external security solution properties for ATA solutions. */ -@Fluent -public final class AtaSolutionProperties extends ExternalSecuritySolutionProperties { - /* - * The lastEventReceived property. - */ - @JsonProperty(value = "lastEventReceived") - private String lastEventReceived; - - /** Creates an instance of AtaSolutionProperties class. */ - public AtaSolutionProperties() { - } - - /** - * Get the lastEventReceived property: The lastEventReceived property. - * - * @return the lastEventReceived value. - */ - public String lastEventReceived() { - return this.lastEventReceived; - } - - /** - * Set the lastEventReceived property: The lastEventReceived property. - * - * @param lastEventReceived the lastEventReceived value to set. - * @return the AtaSolutionProperties object itself. - */ - public AtaSolutionProperties withLastEventReceived(String lastEventReceived) { - this.lastEventReceived = lastEventReceived; - return this; - } - - /** {@inheritDoc} */ - @Override - public AtaSolutionProperties withDeviceVendor(String deviceVendor) { - super.withDeviceVendor(deviceVendor); - return this; - } - - /** {@inheritDoc} */ - @Override - public AtaSolutionProperties withDeviceType(String deviceType) { - super.withDeviceType(deviceType); - return this; - } - - /** {@inheritDoc} */ - @Override - public AtaSolutionProperties withWorkspace(ConnectedWorkspace workspace) { - super.withWorkspace(workspace); - 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/AuthenticationDetailsProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationDetailsProperties.java deleted file mode 100644 index 71b7f498e5e9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationDetailsProperties.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.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Settings for cloud authentication management. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "authenticationType", - defaultImpl = AuthenticationDetailsProperties.class) -@JsonTypeName("AuthenticationDetailsProperties") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "awsCreds", value = AwsCredsAuthenticationDetailsProperties.class), - @JsonSubTypes.Type(name = "awsAssumeRole", value = AwAssumeRoleAuthenticationDetailsProperties.class), - @JsonSubTypes.Type(name = "gcpCredentials", value = GcpCredentialsDetailsProperties.class) -}) -@Immutable -public class AuthenticationDetailsProperties { - /* - * State of the multi-cloud connector - */ - @JsonProperty(value = "authenticationProvisioningState", access = JsonProperty.Access.WRITE_ONLY) - private AuthenticationProvisioningState authenticationProvisioningState; - - /* - * The permissions detected in the cloud account. - */ - @JsonProperty(value = "grantedPermissions", access = JsonProperty.Access.WRITE_ONLY) - private List grantedPermissions; - - /** Creates an instance of AuthenticationDetailsProperties class. */ - public AuthenticationDetailsProperties() { - } - - /** - * Get the authenticationProvisioningState property: State of the multi-cloud connector. - * - * @return the authenticationProvisioningState value. - */ - public AuthenticationProvisioningState authenticationProvisioningState() { - return this.authenticationProvisioningState; - } - - /** - * Get the grantedPermissions property: The permissions detected in the cloud account. - * - * @return the grantedPermissions value. - */ - public List grantedPermissions() { - return this.grantedPermissions; - } - - /** - * 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/AuthenticationProvisioningState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationProvisioningState.java deleted file mode 100644 index e81b2a271af0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationProvisioningState.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** State of the multi-cloud connector. */ -public final class AuthenticationProvisioningState extends ExpandableStringEnum { - /** Static value Valid for AuthenticationProvisioningState. */ - public static final AuthenticationProvisioningState VALID = fromString("Valid"); - - /** Static value Invalid for AuthenticationProvisioningState. */ - public static final AuthenticationProvisioningState INVALID = fromString("Invalid"); - - /** Static value Expired for AuthenticationProvisioningState. */ - public static final AuthenticationProvisioningState EXPIRED = fromString("Expired"); - - /** Static value IncorrectPolicy for AuthenticationProvisioningState. */ - public static final AuthenticationProvisioningState INCORRECT_POLICY = fromString("IncorrectPolicy"); - - /** - * Creates a new instance of AuthenticationProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AuthenticationProvisioningState() { - } - - /** - * Creates or finds a AuthenticationProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding AuthenticationProvisioningState. - */ - @JsonCreator - public static AuthenticationProvisioningState fromString(String name) { - return fromString(name, AuthenticationProvisioningState.class); - } - - /** - * Gets known AuthenticationProvisioningState values. - * - * @return known AuthenticationProvisioningState values. - */ - public static Collection values() { - return values(AuthenticationProvisioningState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationType.java deleted file mode 100644 index 39089c8a4a99..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AuthenticationType.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use - * account organization credentials. - */ -public final class AuthenticationType extends ExpandableStringEnum { - /** Static value awsCreds for AuthenticationType. */ - public static final AuthenticationType AWS_CREDS = fromString("awsCreds"); - - /** Static value awsAssumeRole for AuthenticationType. */ - public static final AuthenticationType AWS_ASSUME_ROLE = fromString("awsAssumeRole"); - - /** Static value gcpCredentials for AuthenticationType. */ - public static final AuthenticationType GCP_CREDENTIALS = fromString("gcpCredentials"); - - /** - * Creates a new instance of AuthenticationType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AuthenticationType() { - } - - /** - * Creates or finds a AuthenticationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AuthenticationType. - */ - @JsonCreator - public static AuthenticationType fromString(String name) { - return fromString(name, AuthenticationType.class); - } - - /** - * Gets known AuthenticationType values. - * - * @return known AuthenticationType values. - */ - public static Collection values() { - return values(AuthenticationType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvision.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvision.java deleted file mode 100644 index 0b365391e9a0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvision.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Describes what kind of security agent provisioning action to take. */ -public final class AutoProvision extends ExpandableStringEnum { - /** Static value On for AutoProvision. */ - public static final AutoProvision ON = fromString("On"); - - /** Static value Off for AutoProvision. */ - public static final AutoProvision OFF = fromString("Off"); - - /** - * Creates a new instance of AutoProvision value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public AutoProvision() { - } - - /** - * Creates or finds a AutoProvision from its string representation. - * - * @param name a name to look for. - * @return the corresponding AutoProvision. - */ - @JsonCreator - public static AutoProvision fromString(String name) { - return fromString(name, AutoProvision.class); - } - - /** - * Gets known AutoProvision values. - * - * @return known AutoProvision values. - */ - public static Collection values() { - return values(AutoProvision.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSetting.java deleted file mode 100644 index df4279031dd7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSetting.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.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; - -/** An immutable client-side representation of AutoProvisioningSetting. */ -public interface AutoProvisioningSetting { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @return the autoProvision value. - */ - AutoProvision autoProvision(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner object. - * - * @return the inner object. - */ - AutoProvisioningSettingInner innerModel(); - - /** The entirety of the AutoProvisioningSetting definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - /** The AutoProvisioningSetting definition stages. */ - interface DefinitionStages { - /** The first stage of the AutoProvisioningSetting definition. */ - interface Blank extends WithCreate { - } - /** - * The stage of the AutoProvisioningSetting definition which contains all the minimum required properties for - * the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithAutoProvision { - /** - * Executes the create request. - * - * @return the created resource. - */ - AutoProvisioningSetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - AutoProvisioningSetting create(Context context); - } - /** The stage of the AutoProvisioningSetting definition allowing to specify autoProvision. */ - interface WithAutoProvision { - /** - * Specifies the autoProvision property: Describes what kind of security agent provisioning action to take. - * - * @param autoProvision Describes what kind of security agent provisioning action to take. - * @return the next definition stage. - */ - WithCreate withAutoProvision(AutoProvision autoProvision); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - AutoProvisioningSetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - AutoProvisioningSetting refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettingList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettingList.java deleted file mode 100644 index de263eefa9dd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettingList.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of all the auto provisioning settings response. */ -@Fluent -public final class AutoProvisioningSettingList { - /* - * List of all the auto provisioning settings - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of AutoProvisioningSettingList class. */ - public AutoProvisioningSettingList() { - } - - /** - * Get the value property: List of all the auto provisioning settings. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of all the auto provisioning settings. - * - * @param value the value value to set. - * @return the AutoProvisioningSettingList object itself. - */ - public AutoProvisioningSettingList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettings.java deleted file mode 100644 index 2b050e6bc336..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutoProvisioningSettings.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of AutoProvisioningSettings. */ -public interface AutoProvisioningSettings { - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Exposes the auto provisioning settings of the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all the auto provisioning settings response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response}. - */ - Response getWithResponse(String settingName, Context context); - - /** - * Details of a specific setting. - * - * @param settingName Auto provisioning setting key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting. - */ - AutoProvisioningSetting get(String settingName); - - /** - * Details of a specific setting. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response}. - */ - AutoProvisioningSetting getById(String id); - - /** - * Details of a specific setting. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return auto provisioning setting along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new AutoProvisioningSetting resource. - * - * @param name resource name. - * @return the first stage of the new AutoProvisioningSetting definition. - */ - AutoProvisioningSetting.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automation.java deleted file mode 100644 index b584f1a114a3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automation.java +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of Automation. */ -public interface Automation { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the description property: The security automation description. - * - * @return the description value. - */ - String description(); - - /** - * Gets the isEnabled property: Indicates whether the security automation is enabled. - * - * @return the isEnabled value. - */ - Boolean isEnabled(); - - /** - * Gets the scopes property: A collection of scopes on which the security automations logic is applied. Supported - * scopes are the subscription itself or a resource group under that subscription. The automation will only apply on - * defined scopes. - * - * @return the scopes value. - */ - List scopes(); - - /** - * Gets the sources property: A collection of the source event types which evaluate the security automation set of - * rules. - * - * @return the sources value. - */ - List sources(); - - /** - * Gets the actions property: A collection of the actions which are triggered if all the configured rules - * evaluations, within at least one rule set, are true. - * - * @return the actions value. - */ - List actions(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AutomationInner object. - * - * @return the inner object. - */ - AutomationInner innerModel(); - - /** The entirety of the Automation definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { - } - /** The Automation definition stages. */ - interface DefinitionStages { - /** The first stage of the Automation definition. */ - interface Blank extends WithLocation { - } - /** The stage of the Automation definition allowing to specify location. */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(String location); - } - /** The stage of the Automation definition allowing to specify parent resource. */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - /** - * The stage of the Automation definition which contains all the minimum required properties for the resource to - * be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithDescription, - DefinitionStages.WithIsEnabled, - DefinitionStages.WithScopes, - DefinitionStages.WithSources, - DefinitionStages.WithActions { - /** - * Executes the create request. - * - * @return the created resource. - */ - Automation create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Automation create(Context context); - } - /** The stage of the Automation definition allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - /** The stage of the Automation definition allowing to specify description. */ - interface WithDescription { - /** - * Specifies the description property: The security automation description.. - * - * @param description The security automation description. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - /** The stage of the Automation definition allowing to specify isEnabled. */ - interface WithIsEnabled { - /** - * Specifies the isEnabled property: Indicates whether the security automation is enabled.. - * - * @param isEnabled Indicates whether the security automation is enabled. - * @return the next definition stage. - */ - WithCreate withIsEnabled(Boolean isEnabled); - } - /** The stage of the Automation definition allowing to specify scopes. */ - interface WithScopes { - /** - * Specifies the scopes property: A collection of scopes on which the security automations logic is applied. - * Supported scopes are the subscription itself or a resource group under that subscription. The automation - * will only apply on defined scopes.. - * - * @param scopes A collection of scopes on which the security automations logic is applied. Supported scopes - * are the subscription itself or a resource group under that subscription. The automation will only - * apply on defined scopes. - * @return the next definition stage. - */ - WithCreate withScopes(List scopes); - } - /** The stage of the Automation definition allowing to specify sources. */ - interface WithSources { - /** - * Specifies the sources property: A collection of the source event types which evaluate the security - * automation set of rules.. - * - * @param sources A collection of the source event types which evaluate the security automation set of - * rules. - * @return the next definition stage. - */ - WithCreate withSources(List sources); - } - /** The stage of the Automation definition allowing to specify actions. */ - interface WithActions { - /** - * Specifies the actions property: A collection of the actions which are triggered if all the configured - * rules evaluations, within at least one rule set, are true.. - * - * @param actions A collection of the actions which are triggered if all the configured rules evaluations, - * within at least one rule set, are true. - * @return the next definition stage. - */ - WithCreate withActions(List actions); - } - } - /** - * Begins update for the Automation resource. - * - * @return the stage of resource update. - */ - Automation.Update update(); - - /** The template for Automation update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithDescription, - UpdateStages.WithIsEnabled, - UpdateStages.WithScopes, - UpdateStages.WithSources, - UpdateStages.WithActions { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Automation apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Automation apply(Context context); - } - /** The Automation update stages. */ - interface UpdateStages { - /** The stage of the Automation update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - /** The stage of the Automation update allowing to specify description. */ - interface WithDescription { - /** - * Specifies the description property: The security automation description.. - * - * @param description The security automation description. - * @return the next definition stage. - */ - Update withDescription(String description); - } - /** The stage of the Automation update allowing to specify isEnabled. */ - interface WithIsEnabled { - /** - * Specifies the isEnabled property: Indicates whether the security automation is enabled.. - * - * @param isEnabled Indicates whether the security automation is enabled. - * @return the next definition stage. - */ - Update withIsEnabled(Boolean isEnabled); - } - /** The stage of the Automation update allowing to specify scopes. */ - interface WithScopes { - /** - * Specifies the scopes property: A collection of scopes on which the security automations logic is applied. - * Supported scopes are the subscription itself or a resource group under that subscription. The automation - * will only apply on defined scopes.. - * - * @param scopes A collection of scopes on which the security automations logic is applied. Supported scopes - * are the subscription itself or a resource group under that subscription. The automation will only - * apply on defined scopes. - * @return the next definition stage. - */ - Update withScopes(List scopes); - } - /** The stage of the Automation update allowing to specify sources. */ - interface WithSources { - /** - * Specifies the sources property: A collection of the source event types which evaluate the security - * automation set of rules.. - * - * @param sources A collection of the source event types which evaluate the security automation set of - * rules. - * @return the next definition stage. - */ - Update withSources(List sources); - } - /** The stage of the Automation update allowing to specify actions. */ - interface WithActions { - /** - * Specifies the actions property: A collection of the actions which are triggered if all the configured - * rules evaluations, within at least one rule set, are true.. - * - * @param actions A collection of the actions which are triggered if all the configured rules evaluations, - * within at least one rule set, are true. - * @return the next definition stage. - */ - Update withActions(List actions); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Automation refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Automation refresh(Context context); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param automation The security automation resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation model state property bag along with {@link Response}. - */ - Response validateWithResponse(AutomationInner automation, Context context); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param automation The security automation resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation model state property bag. - */ - AutomationValidationStatus validate(AutomationInner automation); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationAction.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationAction.java deleted file mode 100644 index 5aab572dca45..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationAction.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.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The action that should be triggered. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "actionType", - defaultImpl = AutomationAction.class) -@JsonTypeName("AutomationAction") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "LogicApp", value = AutomationActionLogicApp.class), - @JsonSubTypes.Type(name = "EventHub", value = AutomationActionEventHub.class), - @JsonSubTypes.Type(name = "Workspace", value = AutomationActionWorkspace.class) -}) -@Immutable -public class AutomationAction { - /** Creates an instance of AutomationAction class. */ - public AutomationAction() { - } - - /** - * 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/AutomationActionEventHub.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionEventHub.java deleted file mode 100644 index 8d4a940480da..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionEventHub.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * The target Event Hub to which event data will be exported. To learn more about Microsoft Defender for Cloud - * continuous export capabilities, visit https://aka.ms/ASCExportLearnMore. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType") -@JsonTypeName("EventHub") -@Fluent -public final class AutomationActionEventHub extends AutomationAction { - /* - * The target Event Hub Azure Resource ID. - */ - @JsonProperty(value = "eventHubResourceId") - private String eventHubResourceId; - - /* - * The target Event Hub SAS policy name. - */ - @JsonProperty(value = "sasPolicyName", access = JsonProperty.Access.WRITE_ONLY) - private String sasPolicyName; - - /* - * The target Event Hub connection string (it will not be included in any response). - */ - @JsonProperty(value = "connectionString") - private String connectionString; - - /** Creates an instance of AutomationActionEventHub class. */ - public AutomationActionEventHub() { - } - - /** - * Get the eventHubResourceId property: The target Event Hub Azure Resource ID. - * - * @return the eventHubResourceId value. - */ - public String eventHubResourceId() { - return this.eventHubResourceId; - } - - /** - * Set the eventHubResourceId property: The target Event Hub Azure Resource ID. - * - * @param eventHubResourceId the eventHubResourceId value to set. - * @return the AutomationActionEventHub object itself. - */ - public AutomationActionEventHub withEventHubResourceId(String eventHubResourceId) { - this.eventHubResourceId = eventHubResourceId; - return this; - } - - /** - * Get the sasPolicyName property: The target Event Hub SAS policy name. - * - * @return the sasPolicyName value. - */ - public String sasPolicyName() { - return this.sasPolicyName; - } - - /** - * Get the connectionString property: The target Event Hub connection string (it will not be included in any - * response). - * - * @return the connectionString value. - */ - public String connectionString() { - return this.connectionString; - } - - /** - * Set the connectionString property: The target Event Hub connection string (it will not be included in any - * response). - * - * @param connectionString the connectionString value to set. - * @return the AutomationActionEventHub object itself. - */ - public AutomationActionEventHub withConnectionString(String connectionString) { - this.connectionString = connectionString; - return this; - } - - /** - * 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/AutomationActionLogicApp.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionLogicApp.java deleted file mode 100644 index 38fe7c5d0598..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionLogicApp.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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * The logic app action that should be triggered. To learn more about Microsoft Defender for Cloud's Workflow Automation - * capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType") -@JsonTypeName("LogicApp") -@Fluent -public final class AutomationActionLogicApp extends AutomationAction { - /* - * The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have - * permissions to trigger the Logic App - */ - @JsonProperty(value = "logicAppResourceId") - private String logicAppResourceId; - - /* - * The Logic App trigger URI endpoint (it will not be included in any response). - */ - @JsonProperty(value = "uri") - private String uri; - - /** Creates an instance of AutomationActionLogicApp class. */ - public AutomationActionLogicApp() { - } - - /** - * Get the logicAppResourceId property: The triggered Logic App Azure Resource ID. This can also reside on other - * subscriptions, given that you have permissions to trigger the Logic App. - * - * @return the logicAppResourceId value. - */ - public String logicAppResourceId() { - return this.logicAppResourceId; - } - - /** - * Set the logicAppResourceId property: The triggered Logic App Azure Resource ID. This can also reside on other - * subscriptions, given that you have permissions to trigger the Logic App. - * - * @param logicAppResourceId the logicAppResourceId value to set. - * @return the AutomationActionLogicApp object itself. - */ - public AutomationActionLogicApp withLogicAppResourceId(String logicAppResourceId) { - this.logicAppResourceId = logicAppResourceId; - return this; - } - - /** - * Get the uri property: The Logic App trigger URI endpoint (it will not be included in any response). - * - * @return the uri value. - */ - public String uri() { - return this.uri; - } - - /** - * Set the uri property: The Logic App trigger URI endpoint (it will not be included in any response). - * - * @param uri the uri value to set. - * @return the AutomationActionLogicApp object itself. - */ - public AutomationActionLogicApp withUri(String uri) { - this.uri = uri; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionWorkspace.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionWorkspace.java deleted file mode 100644 index 9fd967924bdf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationActionWorkspace.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * The Log Analytics Workspace to which event data will be exported. Security alerts data will reside in the - * 'SecurityAlert' table and the assessments data will reside in the 'SecurityRecommendation' table (under the - * 'Security'/'SecurityCenterFree' solutions). Note that in order to view the data in the workspace, the Security Center - * Log Analytics free/standard solution needs to be enabled on that workspace. To learn more about Microsoft Defender - * for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "actionType") -@JsonTypeName("Workspace") -@Fluent -public final class AutomationActionWorkspace extends AutomationAction { - /* - * The fully qualified Log Analytics Workspace Azure Resource ID. - */ - @JsonProperty(value = "workspaceResourceId") - private String workspaceResourceId; - - /** Creates an instance of AutomationActionWorkspace class. */ - public AutomationActionWorkspace() { - } - - /** - * Get the workspaceResourceId property: The fully qualified Log Analytics Workspace Azure Resource ID. - * - * @return the workspaceResourceId value. - */ - public String workspaceResourceId() { - return this.workspaceResourceId; - } - - /** - * Set the workspaceResourceId property: The fully qualified Log Analytics Workspace Azure Resource ID. - * - * @param workspaceResourceId the workspaceResourceId value to set. - * @return the AutomationActionWorkspace object itself. - */ - public AutomationActionWorkspace withWorkspaceResourceId(String workspaceResourceId) { - this.workspaceResourceId = workspaceResourceId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationList.java deleted file mode 100644 index 4bc9fc3e432c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationList.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of security automations response. */ -@Fluent -public final class AutomationList { - /* - * The list of security automations under the given scope. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of AutomationList class. */ - public AutomationList() { - } - - /** - * Get the value property: The list of security automations under the given scope. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of security automations under the given scope. - * - * @param value the value value to set. - * @return the AutomationList object itself. - */ - public AutomationList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model AutomationList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AutomationList.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationRuleSet.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationRuleSet.java deleted file mode 100644 index eb1a7a25fcd6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationRuleSet.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * A rule set which evaluates all its rules upon an event interception. Only when all the included rules in the rule set - * will be evaluated as 'true', will the event trigger the defined actions. - */ -@Fluent -public final class AutomationRuleSet { - /* - * The rules property. - */ - @JsonProperty(value = "rules") - private List rules; - - /** Creates an instance of AutomationRuleSet class. */ - public AutomationRuleSet() { - } - - /** - * Get the rules property: The rules property. - * - * @return the rules value. - */ - public List rules() { - return this.rules; - } - - /** - * Set the rules property: The rules property. - * - * @param rules the rules value to set. - * @return the AutomationRuleSet object itself. - */ - public AutomationRuleSet withRules(List rules) { - this.rules = rules; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (rules() != null) { - rules().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationScope.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationScope.java deleted file mode 100644 index b6797a2853f0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationScope.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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A single automation scope. */ -@Fluent -public final class AutomationScope { - /* - * The resources scope description. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The resources scope path. Can be the subscription on which the automation is defined on or a resource group - * under that subscription (fully qualified Azure resource IDs). - */ - @JsonProperty(value = "scopePath") - private String scopePath; - - /** Creates an instance of AutomationScope class. */ - public AutomationScope() { - } - - /** - * Get the description property: The resources scope description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The resources scope description. - * - * @param description the description value to set. - * @return the AutomationScope object itself. - */ - public AutomationScope withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the scopePath property: The resources scope path. Can be the subscription on which the automation is defined - * on or a resource group under that subscription (fully qualified Azure resource IDs). - * - * @return the scopePath value. - */ - public String scopePath() { - return this.scopePath; - } - - /** - * Set the scopePath property: The resources scope path. Can be the subscription on which the automation is defined - * on or a resource group under that subscription (fully qualified Azure resource IDs). - * - * @param scopePath the scopePath value to set. - * @return the AutomationScope object itself. - */ - public AutomationScope withScopePath(String scopePath) { - this.scopePath = scopePath; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationSource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationSource.java deleted file mode 100644 index 7488319504ca..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationSource.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * The source event types which evaluate the security automation set of rules. For example - security alerts and - * security assessments. To learn more about the supported security events data models schemas - please visit - * https://aka.ms/ASCAutomationSchemas. - */ -@Fluent -public final class AutomationSource { - /* - * A valid event source type. - */ - @JsonProperty(value = "eventSource") - private EventSource eventSource; - - /* - * A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule - * sets (logical 'or'). - */ - @JsonProperty(value = "ruleSets") - private List ruleSets; - - /** Creates an instance of AutomationSource class. */ - public AutomationSource() { - } - - /** - * Get the eventSource property: A valid event source type. - * - * @return the eventSource value. - */ - public EventSource eventSource() { - return this.eventSource; - } - - /** - * Set the eventSource property: A valid event source type. - * - * @param eventSource the eventSource value to set. - * @return the AutomationSource object itself. - */ - public AutomationSource withEventSource(EventSource eventSource) { - this.eventSource = eventSource; - return this; - } - - /** - * Get the ruleSets property: A set of rules which evaluate upon event interception. A logical disjunction is - * applied between defined rule sets (logical 'or'). - * - * @return the ruleSets value. - */ - public List ruleSets() { - return this.ruleSets; - } - - /** - * Set the ruleSets property: A set of rules which evaluate upon event interception. A logical disjunction is - * applied between defined rule sets (logical 'or'). - * - * @param ruleSets the ruleSets value to set. - * @return the AutomationSource object itself. - */ - public AutomationSource withRuleSets(List ruleSets) { - this.ruleSets = ruleSets; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (ruleSets() != null) { - ruleSets().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationTriggeringRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationTriggeringRule.java deleted file mode 100644 index 662e8158cfe2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationTriggeringRule.java +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * A rule which is evaluated upon event interception. The rule is configured by comparing a specific value from the - * event model to an expected value. This comparison is done by using one of the supported operators set. - */ -@Fluent -public final class AutomationTriggeringRule { - /* - * The JPath of the entity model property that should be checked. - */ - @JsonProperty(value = "propertyJPath") - private String propertyJPath; - - /* - * The data type of the compared operands (string, integer, floating point number or a boolean [true/false]] - */ - @JsonProperty(value = "propertyType") - private PropertyType propertyType; - - /* - * The expected value. - */ - @JsonProperty(value = "expectedValue") - private String expectedValue; - - /* - * A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType. - */ - @JsonProperty(value = "operator") - private Operator operator; - - /** Creates an instance of AutomationTriggeringRule class. */ - public AutomationTriggeringRule() { - } - - /** - * Get the propertyJPath property: The JPath of the entity model property that should be checked. - * - * @return the propertyJPath value. - */ - public String propertyJPath() { - return this.propertyJPath; - } - - /** - * Set the propertyJPath property: The JPath of the entity model property that should be checked. - * - * @param propertyJPath the propertyJPath value to set. - * @return the AutomationTriggeringRule object itself. - */ - public AutomationTriggeringRule withPropertyJPath(String propertyJPath) { - this.propertyJPath = propertyJPath; - return this; - } - - /** - * Get the propertyType property: The data type of the compared operands (string, integer, floating point number or - * a boolean [true/false]]. - * - * @return the propertyType value. - */ - public PropertyType propertyType() { - return this.propertyType; - } - - /** - * Set the propertyType property: The data type of the compared operands (string, integer, floating point number or - * a boolean [true/false]]. - * - * @param propertyType the propertyType value to set. - * @return the AutomationTriggeringRule object itself. - */ - public AutomationTriggeringRule withPropertyType(PropertyType propertyType) { - this.propertyType = propertyType; - return this; - } - - /** - * Get the expectedValue property: The expected value. - * - * @return the expectedValue value. - */ - public String expectedValue() { - return this.expectedValue; - } - - /** - * Set the expectedValue property: The expected value. - * - * @param expectedValue the expectedValue value to set. - * @return the AutomationTriggeringRule object itself. - */ - public AutomationTriggeringRule withExpectedValue(String expectedValue) { - this.expectedValue = expectedValue; - return this; - } - - /** - * Get the operator property: A valid comparer operator to use. A case-insensitive comparison will be applied for - * String PropertyType. - * - * @return the operator value. - */ - public Operator operator() { - return this.operator; - } - - /** - * Set the operator property: A valid comparer operator to use. A case-insensitive comparison will be applied for - * String PropertyType. - * - * @param operator the operator value to set. - * @return the AutomationTriggeringRule object itself. - */ - public AutomationTriggeringRule withOperator(Operator operator) { - this.operator = operator; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationValidationStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationValidationStatus.java deleted file mode 100644 index 61079decd3e6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AutomationValidationStatus.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.resourcemanager.security.fluent.models.AutomationValidationStatusInner; - -/** An immutable client-side representation of AutomationValidationStatus. */ -public interface AutomationValidationStatus { - /** - * Gets the isValid property: Indicates whether the model is valid or not. - * - * @return the isValid value. - */ - Boolean isValid(); - - /** - * Gets the message property: The validation message. - * - * @return the message value. - */ - String message(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner object. - * - * @return the inner object. - */ - AutomationValidationStatusInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automations.java deleted file mode 100644 index 73b46db3ba19..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Automations.java +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; - -/** Resource collection API of Automations. */ -public interface Automations { - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security automations for the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response - * to get the next page of security automations for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security automations response as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource along with {@link Response}. - */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String automationName, Context context); - - /** - * Retrieves information about the model of a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource. - */ - Automation getByResourceGroup(String resourceGroupName, String automationName); - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByResourceGroupWithResponse(String resourceGroupName, String automationName, Context context); - - /** - * Deletes a security automation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String automationName); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation model state property bag along with {@link Response}. - */ - Response validateWithResponse( - String resourceGroupName, String automationName, AutomationInner automation, Context context); - - /** - * Validates the security automation model before create or update. Any validation errors are returned to the - * client. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param automationName The security automation name. - * @param automation The security automation resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation model state property bag. - */ - AutomationValidationStatus validate(String resourceGroupName, String automationName, AutomationInner automation); - - /** - * Retrieves information about the model of a security automation. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource along with {@link Response}. - */ - Automation getById(String id); - - /** - * Retrieves information about the model of a security automation. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security automation resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a security automation. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes a security automation. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Automation resource. - * - * @param name resource name. - * @return the first stage of the new Automation definition. - */ - Automation.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwAssumeRoleAuthenticationDetailsProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwAssumeRoleAuthenticationDetailsProperties.java deleted file mode 100644 index 636cbdb29fbb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwAssumeRoleAuthenticationDetailsProperties.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * AWS cloud account connector based assume role, the role enables delegating access to your AWS resources. The role is - * composed of role Amazon Resource Name (ARN) and external ID. For more details, refer to <a - * href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html">Creating a Role to Delegate - * Permissions to an IAM User (write only)</a>. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authenticationType") -@JsonTypeName("awsAssumeRole") -@Fluent -public final class AwAssumeRoleAuthenticationDetailsProperties extends AuthenticationDetailsProperties { - /* - * The ID of the cloud account - */ - @JsonProperty(value = "accountId", access = JsonProperty.Access.WRITE_ONLY) - private String accountId; - - /* - * Assumed role ID is an identifier that you can use to create temporary security credentials. - */ - @JsonProperty(value = "awsAssumeRoleArn", required = true) - private String awsAssumeRoleArn; - - /* - * A unique identifier that is required when you assume a role in another account. - */ - @JsonProperty(value = "awsExternalId", required = true) - private String awsExternalId; - - /** Creates an instance of AwAssumeRoleAuthenticationDetailsProperties class. */ - public AwAssumeRoleAuthenticationDetailsProperties() { - } - - /** - * Get the accountId property: The ID of the cloud account. - * - * @return the accountId value. - */ - public String accountId() { - return this.accountId; - } - - /** - * Get the awsAssumeRoleArn property: Assumed role ID is an identifier that you can use to create temporary security - * credentials. - * - * @return the awsAssumeRoleArn value. - */ - public String awsAssumeRoleArn() { - return this.awsAssumeRoleArn; - } - - /** - * Set the awsAssumeRoleArn property: Assumed role ID is an identifier that you can use to create temporary security - * credentials. - * - * @param awsAssumeRoleArn the awsAssumeRoleArn value to set. - * @return the AwAssumeRoleAuthenticationDetailsProperties object itself. - */ - public AwAssumeRoleAuthenticationDetailsProperties withAwsAssumeRoleArn(String awsAssumeRoleArn) { - this.awsAssumeRoleArn = awsAssumeRoleArn; - return this; - } - - /** - * Get the awsExternalId property: A unique identifier that is required when you assume a role in another account. - * - * @return the awsExternalId value. - */ - public String awsExternalId() { - return this.awsExternalId; - } - - /** - * Set the awsExternalId property: A unique identifier that is required when you assume a role in another account. - * - * @param awsExternalId the awsExternalId value to set. - * @return the AwAssumeRoleAuthenticationDetailsProperties object itself. - */ - public AwAssumeRoleAuthenticationDetailsProperties withAwsExternalId(String awsExternalId) { - this.awsExternalId = awsExternalId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (awsAssumeRoleArn() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property awsAssumeRoleArn in model" - + " AwAssumeRoleAuthenticationDetailsProperties")); - } - if (awsExternalId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property awsExternalId in model" - + " AwAssumeRoleAuthenticationDetailsProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AwAssumeRoleAuthenticationDetailsProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsCredsAuthenticationDetailsProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsCredsAuthenticationDetailsProperties.java deleted file mode 100644 index 5cff776d8f7a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsCredsAuthenticationDetailsProperties.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * AWS cloud account connector based credentials, the credentials is composed of access key ID and secret key, for more - * details, refer to <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html">Creating an - * IAM User in Your AWS Account (write only)</a>. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authenticationType") -@JsonTypeName("awsCreds") -@Fluent -public final class AwsCredsAuthenticationDetailsProperties extends AuthenticationDetailsProperties { - /* - * The ID of the cloud account - */ - @JsonProperty(value = "accountId", access = JsonProperty.Access.WRITE_ONLY) - private String accountId; - - /* - * Public key element of the AWS credential object (write only) - */ - @JsonProperty(value = "awsAccessKeyId", required = true) - private String awsAccessKeyId; - - /* - * Secret key element of the AWS credential object (write only) - */ - @JsonProperty(value = "awsSecretAccessKey", required = true) - private String awsSecretAccessKey; - - /** Creates an instance of AwsCredsAuthenticationDetailsProperties class. */ - public AwsCredsAuthenticationDetailsProperties() { - } - - /** - * Get the accountId property: The ID of the cloud account. - * - * @return the accountId value. - */ - public String accountId() { - return this.accountId; - } - - /** - * Get the awsAccessKeyId property: Public key element of the AWS credential object (write only). - * - * @return the awsAccessKeyId value. - */ - public String awsAccessKeyId() { - return this.awsAccessKeyId; - } - - /** - * Set the awsAccessKeyId property: Public key element of the AWS credential object (write only). - * - * @param awsAccessKeyId the awsAccessKeyId value to set. - * @return the AwsCredsAuthenticationDetailsProperties object itself. - */ - public AwsCredsAuthenticationDetailsProperties withAwsAccessKeyId(String awsAccessKeyId) { - this.awsAccessKeyId = awsAccessKeyId; - return this; - } - - /** - * Get the awsSecretAccessKey property: Secret key element of the AWS credential object (write only). - * - * @return the awsSecretAccessKey value. - */ - public String awsSecretAccessKey() { - return this.awsSecretAccessKey; - } - - /** - * Set the awsSecretAccessKey property: Secret key element of the AWS credential object (write only). - * - * @param awsSecretAccessKey the awsSecretAccessKey value to set. - * @return the AwsCredsAuthenticationDetailsProperties object itself. - */ - public AwsCredsAuthenticationDetailsProperties withAwsSecretAccessKey(String awsSecretAccessKey) { - this.awsSecretAccessKey = awsSecretAccessKey; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (awsAccessKeyId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property awsAccessKeyId in model AwsCredsAuthenticationDetailsProperties")); - } - if (awsSecretAccessKey() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property awsSecretAccessKey in model" - + " AwsCredsAuthenticationDetailsProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(AwsCredsAuthenticationDetailsProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsEnvironmentData.java deleted file mode 100644 index bfcd9c358cfd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsEnvironmentData.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** The AWS connector environment data. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "environmentType") -@JsonTypeName("AwsAccount") -@Fluent -public final class AwsEnvironmentData extends EnvironmentData { - /* - * The AWS account's organizational data - */ - @JsonProperty(value = "organizationalData") - private AwsOrganizationalData organizationalData; - - /* - * list of regions to scan - */ - @JsonProperty(value = "regions") - private List regions; - - /* - * The AWS account name - */ - @JsonProperty(value = "accountName", access = JsonProperty.Access.WRITE_ONLY) - private String accountName; - - /** Creates an instance of AwsEnvironmentData class. */ - public AwsEnvironmentData() { - } - - /** - * Get the organizationalData property: The AWS account's organizational data. - * - * @return the organizationalData value. - */ - public AwsOrganizationalData organizationalData() { - return this.organizationalData; - } - - /** - * Set the organizationalData property: The AWS account's organizational data. - * - * @param organizationalData the organizationalData value to set. - * @return the AwsEnvironmentData object itself. - */ - public AwsEnvironmentData withOrganizationalData(AwsOrganizationalData organizationalData) { - this.organizationalData = organizationalData; - return this; - } - - /** - * Get the regions property: list of regions to scan. - * - * @return the regions value. - */ - public List regions() { - return this.regions; - } - - /** - * Set the regions property: list of regions to scan. - * - * @param regions the regions value to set. - * @return the AwsEnvironmentData object itself. - */ - public AwsEnvironmentData withRegions(List regions) { - this.regions = regions; - return this; - } - - /** - * Get the accountName property: The AWS account name. - * - * @return the accountName value. - */ - public String accountName() { - return this.accountName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (organizationalData() != null) { - organizationalData().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalData.java deleted file mode 100644 index 01da3de98d1f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalData.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.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The AWS organization data. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "organizationMembershipType", - defaultImpl = AwsOrganizationalData.class) -@JsonTypeName("AwsOrganizationalData") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Organization", value = AwsOrganizationalDataMaster.class), - @JsonSubTypes.Type(name = "Member", value = AwsOrganizationalDataMember.class) -}) -@Immutable -public class AwsOrganizationalData { - /** Creates an instance of AwsOrganizationalData class. */ - public AwsOrganizationalData() { - } - - /** - * 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/AwsOrganizationalDataMaster.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMaster.java deleted file mode 100644 index b7b8ffb22a08..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMaster.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** The AWS organization data for the master account. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "organizationMembershipType") -@JsonTypeName("Organization") -@Fluent -public final class AwsOrganizationalDataMaster extends AwsOrganizationalData { - /* - * If the multi cloud account is of membership type organization, this will be the name of the onboarding stackset - */ - @JsonProperty(value = "stacksetName") - private String stacksetName; - - /* - * If the multi cloud account is of membership type organization, list of accounts excluded from offering - */ - @JsonProperty(value = "excludedAccountIds") - private List excludedAccountIds; - - /** Creates an instance of AwsOrganizationalDataMaster class. */ - public AwsOrganizationalDataMaster() { - } - - /** - * Get the stacksetName property: If the multi cloud account is of membership type organization, this will be the - * name of the onboarding stackset. - * - * @return the stacksetName value. - */ - public String stacksetName() { - return this.stacksetName; - } - - /** - * Set the stacksetName property: If the multi cloud account is of membership type organization, this will be the - * name of the onboarding stackset. - * - * @param stacksetName the stacksetName value to set. - * @return the AwsOrganizationalDataMaster object itself. - */ - public AwsOrganizationalDataMaster withStacksetName(String stacksetName) { - this.stacksetName = stacksetName; - return this; - } - - /** - * Get the excludedAccountIds property: If the multi cloud account is of membership type organization, list of - * accounts excluded from offering. - * - * @return the excludedAccountIds value. - */ - public List excludedAccountIds() { - return this.excludedAccountIds; - } - - /** - * Set the excludedAccountIds property: If the multi cloud account is of membership type organization, list of - * accounts excluded from offering. - * - * @param excludedAccountIds the excludedAccountIds value to set. - * @return the AwsOrganizationalDataMaster object itself. - */ - public AwsOrganizationalDataMaster withExcludedAccountIds(List excludedAccountIds) { - this.excludedAccountIds = excludedAccountIds; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMember.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMember.java deleted file mode 100644 index 6951419d2b76..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AwsOrganizationalDataMember.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The AWS organization data for the member account. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "organizationMembershipType") -@JsonTypeName("Member") -@Fluent -public final class AwsOrganizationalDataMember extends AwsOrganizationalData { - /* - * If the multi cloud account is not of membership type organization, this will be the ID of the account's parent - */ - @JsonProperty(value = "parentHierarchyId") - private String parentHierarchyId; - - /** Creates an instance of AwsOrganizationalDataMember class. */ - public AwsOrganizationalDataMember() { - } - - /** - * Get the parentHierarchyId property: If the multi cloud account is not of membership type organization, this will - * be the ID of the account's parent. - * - * @return the parentHierarchyId value. - */ - public String parentHierarchyId() { - return this.parentHierarchyId; - } - - /** - * Set the parentHierarchyId property: If the multi cloud account is not of membership type organization, this will - * be the ID of the account's parent. - * - * @param parentHierarchyId the parentHierarchyId value to set. - * @return the AwsOrganizationalDataMember object itself. - */ - public AwsOrganizationalDataMember withParentHierarchyId(String parentHierarchyId) { - this.parentHierarchyId = parentHierarchyId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsScopeEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsScopeEnvironmentData.java deleted file mode 100644 index 1f9e0d85d846..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureDevOpsScopeEnvironmentData.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The AzureDevOps scope connector's environment data. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "environmentType") -@JsonTypeName("AzureDevOpsScope") -@Immutable -public final class AzureDevOpsScopeEnvironmentData extends EnvironmentData { - /** Creates an instance of AzureDevOpsScopeEnvironmentData class. */ - public AzureDevOpsScopeEnvironmentData() { - } - - /** - * 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/AzureResourceDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceDetails.java deleted file mode 100644 index 93ae42309e0e..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.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 { - /* - * Azure resource Id of the assessed resource - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /** Creates an instance of AzureResourceDetails class. */ - public AzureResourceDetails() { - } - - /** - * 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/AzureResourceIdentifier.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceIdentifier.java deleted file mode 100644 index 71269931e070..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceIdentifier.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.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Azure resource identifier. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("AzureResource") -@Immutable -public final class AzureResourceIdentifier extends ResourceIdentifier { - /* - * ARM resource identifier for the cloud resource being alerted on - */ - @JsonProperty(value = "azureResourceId", access = JsonProperty.Access.WRITE_ONLY) - private String azureResourceId; - - /** Creates an instance of AzureResourceIdentifier class. */ - public AzureResourceIdentifier() { - } - - /** - * Get the azureResourceId property: ARM resource identifier for the cloud resource being alerted on. - * - * @return the azureResourceId value. - */ - public String azureResourceId() { - return this.azureResourceId; - } - - /** - * 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/AzureResourceLink.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceLink.java deleted file mode 100644 index fb5c7218394a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureResourceLink.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.fasterxml.jackson.annotation.JsonProperty; - -/** Describes an Azure resource with kind. */ -@Immutable -public final class AzureResourceLink { - /* - * Azure resource Id - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /** Creates an instance of AzureResourceLink class. */ - public AzureResourceLink() { - } - - /** - * Get the id property: Azure resource Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * 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/AzureTrackedResourceLocation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureTrackedResourceLocation.java deleted file mode 100644 index c48378441c4c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/AzureTrackedResourceLocation.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes an Azure resource with location. */ -@Fluent -public class AzureTrackedResourceLocation { - /* - * Location where the resource is stored - */ - @JsonProperty(value = "location") - private String location; - - /** Creates an instance of AzureTrackedResourceLocation class. */ - public AzureTrackedResourceLocation() { - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Location where the resource is stored. - * - * @param location the location value to set. - * @return the AzureTrackedResourceLocation object itself. - */ - public AzureTrackedResourceLocation withLocation(String location) { - this.location = location; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Baseline.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Baseline.java deleted file mode 100644 index 99852d05bed6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Baseline.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Baseline details. */ -@Fluent -public final class Baseline { - /* - * Expected results. - */ - @JsonProperty(value = "expectedResults") - private List> expectedResults; - - /* - * Baseline update time (UTC). - */ - @JsonProperty(value = "updatedTime") - private OffsetDateTime updatedTime; - - /** Creates an instance of Baseline class. */ - public Baseline() { - } - - /** - * Get the expectedResults property: Expected results. - * - * @return the expectedResults value. - */ - public List> expectedResults() { - return this.expectedResults; - } - - /** - * Set the expectedResults property: Expected results. - * - * @param expectedResults the expectedResults value to set. - * @return the Baseline object itself. - */ - public Baseline withExpectedResults(List> expectedResults) { - this.expectedResults = expectedResults; - return this; - } - - /** - * Get the updatedTime property: Baseline update time (UTC). - * - * @return the updatedTime value. - */ - public OffsetDateTime updatedTime() { - return this.updatedTime; - } - - /** - * Set the updatedTime property: Baseline update time (UTC). - * - * @param updatedTime the updatedTime value to set. - * @return the Baseline object itself. - */ - public Baseline withUpdatedTime(OffsetDateTime updatedTime) { - this.updatedTime = updatedTime; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BaselineAdjustedResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BaselineAdjustedResult.java deleted file mode 100644 index dfd5b9663173..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BaselineAdjustedResult.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The rule result adjusted with baseline. */ -@Fluent -public final class BaselineAdjustedResult { - /* - * Baseline details. - */ - @JsonProperty(value = "baseline") - private Baseline baseline; - - /* - * The rule result status. - */ - @JsonProperty(value = "status") - private RuleStatus status; - - /* - * Results the are not in baseline. - */ - @JsonProperty(value = "resultsNotInBaseline") - private List> resultsNotInBaseline; - - /* - * Results the are in baseline. - */ - @JsonProperty(value = "resultsOnlyInBaseline") - private List> resultsOnlyInBaseline; - - /** Creates an instance of BaselineAdjustedResult class. */ - public BaselineAdjustedResult() { - } - - /** - * Get the baseline property: Baseline details. - * - * @return the baseline value. - */ - public Baseline baseline() { - return this.baseline; - } - - /** - * Set the baseline property: Baseline details. - * - * @param baseline the baseline value to set. - * @return the BaselineAdjustedResult object itself. - */ - public BaselineAdjustedResult withBaseline(Baseline baseline) { - this.baseline = baseline; - return this; - } - - /** - * Get the status property: The rule result status. - * - * @return the status value. - */ - public RuleStatus status() { - return this.status; - } - - /** - * Set the status property: The rule result status. - * - * @param status the status value to set. - * @return the BaselineAdjustedResult object itself. - */ - public BaselineAdjustedResult withStatus(RuleStatus status) { - this.status = status; - return this; - } - - /** - * Get the resultsNotInBaseline property: Results the are not in baseline. - * - * @return the resultsNotInBaseline value. - */ - public List> resultsNotInBaseline() { - return this.resultsNotInBaseline; - } - - /** - * Set the resultsNotInBaseline property: Results the are not in baseline. - * - * @param resultsNotInBaseline the resultsNotInBaseline value to set. - * @return the BaselineAdjustedResult object itself. - */ - public BaselineAdjustedResult withResultsNotInBaseline(List> resultsNotInBaseline) { - this.resultsNotInBaseline = resultsNotInBaseline; - return this; - } - - /** - * Get the resultsOnlyInBaseline property: Results the are in baseline. - * - * @return the resultsOnlyInBaseline value. - */ - public List> resultsOnlyInBaseline() { - return this.resultsOnlyInBaseline; - } - - /** - * Set the resultsOnlyInBaseline property: Results the are in baseline. - * - * @param resultsOnlyInBaseline the resultsOnlyInBaseline value to set. - * @return the BaselineAdjustedResult object itself. - */ - public BaselineAdjustedResult withResultsOnlyInBaseline(List> resultsOnlyInBaseline) { - this.resultsOnlyInBaseline = resultsOnlyInBaseline; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (baseline() != null) { - baseline().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BenchmarkReference.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BenchmarkReference.java deleted file mode 100644 index 06dc061d3069..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BenchmarkReference.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The benchmark references. */ -@Fluent -public final class BenchmarkReference { - /* - * The benchmark name. - */ - @JsonProperty(value = "benchmark") - private String benchmark; - - /* - * The benchmark reference. - */ - @JsonProperty(value = "reference") - private String reference; - - /** Creates an instance of BenchmarkReference class. */ - public BenchmarkReference() { - } - - /** - * Get the benchmark property: The benchmark name. - * - * @return the benchmark value. - */ - public String benchmark() { - return this.benchmark; - } - - /** - * Set the benchmark property: The benchmark name. - * - * @param benchmark the benchmark value to set. - * @return the BenchmarkReference object itself. - */ - public BenchmarkReference withBenchmark(String benchmark) { - this.benchmark = benchmark; - return this; - } - - /** - * Get the reference property: The benchmark reference. - * - * @return the reference value. - */ - public String reference() { - return this.reference; - } - - /** - * Set the reference property: The benchmark reference. - * - * @param reference the reference value to set. - * @return the BenchmarkReference object itself. - */ - public BenchmarkReference withReference(String reference) { - this.reference = reference; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BundleType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BundleType.java deleted file mode 100644 index e16b0198c97e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BundleType.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Alert Simulator supported bundles. */ -public final class BundleType extends ExpandableStringEnum { - /** Static value AppServices for BundleType. */ - public static final BundleType APP_SERVICES = fromString("AppServices"); - - /** Static value DNS for BundleType. */ - public static final BundleType DNS = fromString("DNS"); - - /** Static value KeyVaults for BundleType. */ - public static final BundleType KEY_VAULTS = fromString("KeyVaults"); - - /** Static value KubernetesService for BundleType. */ - public static final BundleType KUBERNETES_SERVICE = fromString("KubernetesService"); - - /** Static value ResourceManager for BundleType. */ - public static final BundleType RESOURCE_MANAGER = fromString("ResourceManager"); - - /** Static value SqlServers for BundleType. */ - public static final BundleType SQL_SERVERS = fromString("SqlServers"); - - /** Static value StorageAccounts for BundleType. */ - public static final BundleType STORAGE_ACCOUNTS = fromString("StorageAccounts"); - - /** Static value VirtualMachines for BundleType. */ - public static final BundleType VIRTUAL_MACHINES = fromString("VirtualMachines"); - - /** Static value CosmosDbs for BundleType. */ - public static final BundleType COSMOS_DBS = fromString("CosmosDbs"); - - /** - * Creates a new instance of BundleType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public BundleType() { - } - - /** - * Creates or finds a BundleType from its string representation. - * - * @param name a name to look for. - * @return the corresponding BundleType. - */ - @JsonCreator - public static BundleType fromString(String name) { - return fromString(name, BundleType.class); - } - - /** - * Gets known BundleType values. - * - * @return known BundleType values. - */ - public static Collection values() { - return values(BundleType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Categories.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Categories.java deleted file mode 100644 index deadc8605745..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Categories.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The categories of resource that is at risk when the assessment is unhealthy. */ -public final class Categories extends ExpandableStringEnum { - /** Static value Compute for Categories. */ - public static final Categories COMPUTE = fromString("Compute"); - - /** Static value Networking for Categories. */ - public static final Categories NETWORKING = fromString("Networking"); - - /** Static value Data for Categories. */ - public static final Categories DATA = fromString("Data"); - - /** Static value IdentityAndAccess for Categories. */ - public static final Categories IDENTITY_AND_ACCESS = fromString("IdentityAndAccess"); - - /** Static value IoT for Categories. */ - public static final Categories IOT = fromString("IoT"); - - /** - * Creates a new instance of Categories value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Categories() { - } - - /** - * Creates or finds a Categories from its string representation. - * - * @param name a name to look for. - * @return the corresponding Categories. - */ - @JsonCreator - public static Categories fromString(String name) { - return fromString(name, Categories.class); - } - - /** - * Gets known Categories values. - * - * @return known Categories values. - */ - public static Collection values() { - return values(Categories.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CefExternalSecuritySolution.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CefExternalSecuritySolution.java deleted file mode 100644 index 7fd9efb1e94b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CefExternalSecuritySolution.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Represents a security solution which sends CEF logs to an OMS workspace. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("CEF") -@Fluent -public final class CefExternalSecuritySolution extends ExternalSecuritySolutionInner { - /* - * The external security solution properties for CEF solutions - */ - @JsonProperty(value = "properties") - private CefSolutionProperties properties; - - /** Creates an instance of CefExternalSecuritySolution class. */ - public CefExternalSecuritySolution() { - } - - /** - * Get the properties property: The external security solution properties for CEF solutions. - * - * @return the properties value. - */ - public CefSolutionProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The external security solution properties for CEF solutions. - * - * @param properties the properties value to set. - * @return the CefExternalSecuritySolution object itself. - */ - public CefExternalSecuritySolution withProperties(CefSolutionProperties properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (properties() != null) { - properties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CefSolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CefSolutionProperties.java deleted file mode 100644 index aa7d3c3e7e1b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CefSolutionProperties.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The external security solution properties for CEF solutions. */ -@Fluent -public final class CefSolutionProperties extends ExternalSecuritySolutionProperties { - /* - * The hostname property. - */ - @JsonProperty(value = "hostname") - private String hostname; - - /* - * The agent property. - */ - @JsonProperty(value = "agent") - private String agent; - - /* - * The lastEventReceived property. - */ - @JsonProperty(value = "lastEventReceived") - private String lastEventReceived; - - /** Creates an instance of CefSolutionProperties class. */ - public CefSolutionProperties() { - } - - /** - * Get the hostname property: The hostname property. - * - * @return the hostname value. - */ - public String hostname() { - return this.hostname; - } - - /** - * Set the hostname property: The hostname property. - * - * @param hostname the hostname value to set. - * @return the CefSolutionProperties object itself. - */ - public CefSolutionProperties withHostname(String hostname) { - this.hostname = hostname; - return this; - } - - /** - * Get the agent property: The agent property. - * - * @return the agent value. - */ - public String agent() { - return this.agent; - } - - /** - * Set the agent property: The agent property. - * - * @param agent the agent value to set. - * @return the CefSolutionProperties object itself. - */ - public CefSolutionProperties withAgent(String agent) { - this.agent = agent; - return this; - } - - /** - * Get the lastEventReceived property: The lastEventReceived property. - * - * @return the lastEventReceived value. - */ - public String lastEventReceived() { - return this.lastEventReceived; - } - - /** - * Set the lastEventReceived property: The lastEventReceived property. - * - * @param lastEventReceived the lastEventReceived value to set. - * @return the CefSolutionProperties object itself. - */ - public CefSolutionProperties withLastEventReceived(String lastEventReceived) { - this.lastEventReceived = lastEventReceived; - return this; - } - - /** {@inheritDoc} */ - @Override - public CefSolutionProperties withDeviceVendor(String deviceVendor) { - super.withDeviceVendor(deviceVendor); - return this; - } - - /** {@inheritDoc} */ - @Override - public CefSolutionProperties withDeviceType(String deviceType) { - super.withDeviceType(deviceType); - return this; - } - - /** {@inheritDoc} */ - @Override - public CefSolutionProperties withWorkspace(ConnectedWorkspace workspace) { - super.withWorkspace(workspace); - 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/CloudName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java deleted file mode 100644 index 667eb58402de..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudName.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The multi cloud resource's cloud name. */ -public final class CloudName extends ExpandableStringEnum { - /** Static value Azure for CloudName. */ - public static final CloudName AZURE = fromString("Azure"); - - /** Static value AWS for CloudName. */ - public static final CloudName AWS = fromString("AWS"); - - /** Static value GCP for CloudName. */ - public static final CloudName GCP = fromString("GCP"); - - /** Static value Github for CloudName. */ - public static final CloudName GITHUB = fromString("Github"); - - /** Static value AzureDevOps for CloudName. */ - public static final CloudName AZURE_DEV_OPS = fromString("AzureDevOps"); - - /** Static value GitLab for CloudName. */ - public static final CloudName GIT_LAB = fromString("GitLab"); - - /** - * Creates a new instance of CloudName value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CloudName() { - } - - /** - * Creates or finds a CloudName from its string representation. - * - * @param name a name to look for. - * @return the corresponding CloudName. - */ - @JsonCreator - public static CloudName fromString(String name) { - return fromString(name, CloudName.class); - } - - /** - * Gets known CloudName values. - * - * @return known CloudName values. - */ - public static Collection values() { - return values(CloudName.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudOffering.java deleted file mode 100644 index d1a7b48b8634..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CloudOffering.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The security offering details. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "offeringType", - defaultImpl = CloudOffering.class) -@JsonTypeName("CloudOffering") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "CspmMonitorAws", value = CspmMonitorAwsOffering.class), - @JsonSubTypes.Type(name = "DefenderForContainersAws", value = DefenderForContainersAwsOffering.class), - @JsonSubTypes.Type(name = "DefenderForServersAws", value = DefenderForServersAwsOffering.class), - @JsonSubTypes.Type(name = "DefenderForDatabasesAws", value = DefenderFoDatabasesAwsOffering.class), - @JsonSubTypes.Type(name = "InformationProtectionAws", value = InformationProtectionAwsOffering.class), - @JsonSubTypes.Type(name = "CspmMonitorGcp", value = CspmMonitorGcpOffering.class), - @JsonSubTypes.Type(name = "DefenderForServersGcp", value = DefenderForServersGcpOffering.class), - @JsonSubTypes.Type(name = "DefenderForDatabasesGcp", value = DefenderForDatabasesGcpOffering.class), - @JsonSubTypes.Type(name = "DefenderForContainersGcp", value = DefenderForContainersGcpOffering.class), - @JsonSubTypes.Type(name = "CspmMonitorGithub", value = CspmMonitorGithubOffering.class), - @JsonSubTypes.Type(name = "CspmMonitorAzureDevOps", value = CspmMonitorAzureDevOpsOffering.class), - @JsonSubTypes.Type(name = "DefenderCspmAws", value = DefenderCspmAwsOffering.class), - @JsonSubTypes.Type(name = "DefenderCspmGcp", value = DefenderCspmGcpOffering.class), - @JsonSubTypes.Type(name = "DefenderForDevOpsGithub", value = DefenderForDevOpsGithubOffering.class), - @JsonSubTypes.Type(name = "DefenderForDevOpsAzureDevOps", value = DefenderForDevOpsAzureDevOpsOffering.class), - @JsonSubTypes.Type(name = "CspmMonitorGitLab", value = CspmMonitorGitLabOffering.class), - @JsonSubTypes.Type(name = "DefenderForDevOpsGitLab", value = DefenderForDevOpsGitLabOffering.class) -}) -@Immutable -public class CloudOffering { - /* - * The offering description. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /** Creates an instance of CloudOffering class. */ - public CloudOffering() { - } - - /** - * Get the description property: The offering description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Code.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Code.java deleted file mode 100644 index 487d31012408..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Code.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The operation status code. */ -public final class Code extends ExpandableStringEnum { - /** Static value Succeeded for Code. */ - public static final Code SUCCEEDED = fromString("Succeeded"); - - /** Static value Failed for Code. */ - public static final Code FAILED = fromString("Failed"); - - /** - * Creates a new instance of Code value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Code() { - } - - /** - * Creates or finds a Code from its string representation. - * - * @param name a name to look for. - * @return the corresponding Code. - */ - @JsonCreator - public static Code fromString(String name) { - return fromString(name, Code.class); - } - - /** - * Gets known Code values. - * - * @return known Code values. - */ - public static Collection values() { - return values(Code.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliance.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliance.java deleted file mode 100644 index 7d14f9285a72..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliance.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.models; - -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of Compliance. */ -public interface Compliance { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the assessmentTimestampUtcDate property: The timestamp when the Compliance calculation was conducted. - * - * @return the assessmentTimestampUtcDate value. - */ - OffsetDateTime assessmentTimestampUtcDate(); - - /** - * Gets the resourceCount property: The resource count of the given subscription for which the Compliance - * calculation was conducted (needed for Management Group Compliance calculation). - * - * @return the resourceCount value. - */ - Integer resourceCount(); - - /** - * Gets the assessmentResult property: An array of segment, which is the actually the compliance assessment. - * - * @return the assessmentResult value. - */ - List assessmentResult(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ComplianceInner object. - * - * @return the inner object. - */ - ComplianceInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceList.java deleted file mode 100644 index c325572625cc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceList.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of Compliance objects response. */ -@Fluent -public final class ComplianceList { - /* - * List of Compliance objects - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of ComplianceList class. */ - public ComplianceList() { - } - - /** - * Get the value property: List of Compliance objects. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Compliance objects. - * - * @param value the value value to set. - * @return the ComplianceList object itself. - */ - public ComplianceList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResult.java deleted file mode 100644 index a762e476d259..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResult.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.ComplianceResultInner; - -/** An immutable client-side representation of ComplianceResult. */ -public interface ComplianceResult { - /** - * 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 resourceStatus property: The status of the resource regarding a single assessment. - * - * @return the resourceStatus value. - */ - ResourceStatus resourceStatus(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ComplianceResultInner object. - * - * @return the inner object. - */ - ComplianceResultInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResultList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResultList.java deleted file mode 100644 index 53df27fd8499..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResultList.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.ComplianceResultInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of compliance results response. */ -@Fluent -public final class ComplianceResultList { - /* - * List of compliance results - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of ComplianceResultList class. */ - public ComplianceResultList() { - } - - /** - * Get the value property: List of compliance results. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of compliance results. - * - * @param value the value value to set. - * @return the ComplianceResultList object itself. - */ - public ComplianceResultList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model ComplianceResultList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ComplianceResultList.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResults.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResults.java deleted file mode 100644 index dfea3d053811..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceResults.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.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 ComplianceResults. */ -public interface ComplianceResults { - /** - * Security compliance results in the subscription. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of compliance results response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope); - - /** - * Security compliance results in the subscription. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of compliance results response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope, Context context); - - /** - * Security Compliance Result. - * - * @param resourceId The identifier of the resource. - * @param complianceResultName name of the desired assessment compliance result. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a compliance result along with {@link Response}. - */ - Response getWithResponse(String resourceId, String complianceResultName, Context context); - - /** - * Security Compliance Result. - * - * @param resourceId The identifier of the resource. - * @param complianceResultName name of the desired assessment compliance result. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a compliance result. - */ - ComplianceResult get(String resourceId, String complianceResultName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceSegment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceSegment.java deleted file mode 100644 index 92424ee5d4b5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ComplianceSegment.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A segment of a compliance assessment. */ -@Immutable -public final class ComplianceSegment { - /* - * The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc. - */ - @JsonProperty(value = "segmentType", access = JsonProperty.Access.WRITE_ONLY) - private String segmentType; - - /* - * The size (%) of the segment. - */ - @JsonProperty(value = "percentage", access = JsonProperty.Access.WRITE_ONLY) - private Double percentage; - - /** Creates an instance of ComplianceSegment class. */ - public ComplianceSegment() { - } - - /** - * Get the segmentType property: The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc. - * - * @return the segmentType value. - */ - public String segmentType() { - return this.segmentType; - } - - /** - * Get the percentage property: The size (%) of the segment. - * - * @return the percentage value. - */ - public Double percentage() { - return this.percentage; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliances.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliances.java deleted file mode 100644 index 3aed2c4ad78b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Compliances.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Compliances. */ -public interface Compliances { - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope); - - /** - * The Compliance scores of the specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Compliance objects response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope, Context context); - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope along with {@link Response}. - */ - Response getWithResponse(String scope, String complianceName, Context context); - - /** - * Details of a specific Compliance. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param complianceName name of the Compliance. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return compliance of a scope. - */ - Compliance get(String scope, String complianceName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConfigurationStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConfigurationStatus.java deleted file mode 100644 index ca570c91256d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConfigurationStatus.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The configuration status of the machines group or machine or rule. */ -public final class ConfigurationStatus extends ExpandableStringEnum { - /** Static value Configured for ConfigurationStatus. */ - public static final ConfigurationStatus CONFIGURED = fromString("Configured"); - - /** Static value NotConfigured for ConfigurationStatus. */ - public static final ConfigurationStatus NOT_CONFIGURED = fromString("NotConfigured"); - - /** Static value InProgress for ConfigurationStatus. */ - public static final ConfigurationStatus IN_PROGRESS = fromString("InProgress"); - - /** Static value Failed for ConfigurationStatus. */ - public static final ConfigurationStatus FAILED = fromString("Failed"); - - /** Static value NoStatus for ConfigurationStatus. */ - public static final ConfigurationStatus NO_STATUS = fromString("NoStatus"); - - /** - * Creates a new instance of ConfigurationStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ConfigurationStatus() { - } - - /** - * Creates or finds a ConfigurationStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConfigurationStatus. - */ - @JsonCreator - public static ConfigurationStatus fromString(String name) { - return fromString(name, ConfigurationStatus.class); - } - - /** - * Gets known ConfigurationStatus values. - * - * @return known ConfigurationStatus values. - */ - public static Collection values() { - return values(ConfigurationStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectableResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectableResource.java deleted file mode 100644 index 19acfd395a63..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectableResource.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes the allowed inbound and outbound traffic of an Azure resource. */ -@Immutable -public final class ConnectableResource { - /* - * The Azure resource id - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The list of Azure resources that the resource has inbound allowed connection from - */ - @JsonProperty(value = "inboundConnectedResources", access = JsonProperty.Access.WRITE_ONLY) - private List inboundConnectedResources; - - /* - * The list of Azure resources that the resource has outbound allowed connection to - */ - @JsonProperty(value = "outboundConnectedResources", access = JsonProperty.Access.WRITE_ONLY) - private List outboundConnectedResources; - - /** Creates an instance of ConnectableResource class. */ - public ConnectableResource() { - } - - /** - * Get the id property: The Azure resource id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the inboundConnectedResources property: The list of Azure resources that the resource has inbound allowed - * connection from. - * - * @return the inboundConnectedResources value. - */ - public List inboundConnectedResources() { - return this.inboundConnectedResources; - } - - /** - * Get the outboundConnectedResources property: The list of Azure resources that the resource has outbound allowed - * connection to. - * - * @return the outboundConnectedResources value. - */ - public List outboundConnectedResources() { - return this.outboundConnectedResources; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (inboundConnectedResources() != null) { - inboundConnectedResources().forEach(e -> e.validate()); - } - if (outboundConnectedResources() != null) { - outboundConnectedResources().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectedResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectedResource.java deleted file mode 100644 index 222924164abd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectedResource.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.fasterxml.jackson.annotation.JsonProperty; - -/** Describes properties of a connected resource. */ -@Immutable -public final class ConnectedResource { - /* - * The Azure resource id of the connected resource - */ - @JsonProperty(value = "connectedResourceId", access = JsonProperty.Access.WRITE_ONLY) - private String connectedResourceId; - - /* - * The allowed tcp ports - */ - @JsonProperty(value = "tcpPorts", access = JsonProperty.Access.WRITE_ONLY) - private String tcpPorts; - - /* - * The allowed udp ports - */ - @JsonProperty(value = "udpPorts", access = JsonProperty.Access.WRITE_ONLY) - private String udpPorts; - - /** Creates an instance of ConnectedResource class. */ - public ConnectedResource() { - } - - /** - * Get the connectedResourceId property: The Azure resource id of the connected resource. - * - * @return the connectedResourceId value. - */ - public String connectedResourceId() { - return this.connectedResourceId; - } - - /** - * Get the tcpPorts property: The allowed tcp ports. - * - * @return the tcpPorts value. - */ - public String tcpPorts() { - return this.tcpPorts; - } - - /** - * Get the udpPorts property: The allowed udp ports. - * - * @return the udpPorts value. - */ - public String udpPorts() { - return this.udpPorts; - } - - /** - * 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/ConnectedWorkspace.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectedWorkspace.java deleted file mode 100644 index 34a0ad3b5ccf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectedWorkspace.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents an OMS workspace to which the solution is connected. */ -@Fluent -public final class ConnectedWorkspace { - /* - * Azure resource ID of the connected OMS workspace - */ - @JsonProperty(value = "id") - private String id; - - /** Creates an instance of ConnectedWorkspace class. */ - public ConnectedWorkspace() { - } - - /** - * Get the id property: Azure resource ID of the connected OMS workspace. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Azure resource ID of the connected OMS workspace. - * - * @param id the id value to set. - * @return the ConnectedWorkspace object itself. - */ - public ConnectedWorkspace withId(String id) { - this.id = id; - 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/ConnectionFromIpNotAllowed.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionFromIpNotAllowed.java deleted file mode 100644 index 09db2166904f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionFromIpNotAllowed.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Inbound connection from an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("ConnectionFromIpNotAllowed") -@Fluent -public final class ConnectionFromIpNotAllowed extends AllowlistCustomAlertRule { - /** Creates an instance of ConnectionFromIpNotAllowed class. */ - public ConnectionFromIpNotAllowed() { - } - - /** {@inheritDoc} */ - @Override - public ConnectionFromIpNotAllowed withAllowlistValues(List allowlistValues) { - super.withAllowlistValues(allowlistValues); - return this; - } - - /** {@inheritDoc} */ - @Override - public ConnectionFromIpNotAllowed withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/ConnectionStrings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionStrings.java deleted file mode 100644 index c5da6b30ddaf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionStrings.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import java.util.List; - -/** An immutable client-side representation of ConnectionStrings. */ -public interface ConnectionStrings { - /** - * Gets the value property: Connection strings. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner object. - * - * @return the inner object. - */ - ConnectionStringsInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionToIpNotAllowed.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionToIpNotAllowed.java deleted file mode 100644 index 59841c97d2d0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionToIpNotAllowed.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("ConnectionToIpNotAllowed") -@Fluent -public final class ConnectionToIpNotAllowed extends AllowlistCustomAlertRule { - /** Creates an instance of ConnectionToIpNotAllowed class. */ - public ConnectionToIpNotAllowed() { - } - - /** {@inheritDoc} */ - @Override - public ConnectionToIpNotAllowed withAllowlistValues(List allowlistValues) { - super.withAllowlistValues(allowlistValues); - return this; - } - - /** {@inheritDoc} */ - @Override - public ConnectionToIpNotAllowed withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/ConnectionType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionType.java deleted file mode 100644 index f26f0c83f24b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectionType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ConnectionType. */ -public final class ConnectionType extends ExpandableStringEnum { - /** Static value Internal for ConnectionType. */ - public static final ConnectionType INTERNAL = fromString("Internal"); - - /** Static value External for ConnectionType. */ - public static final ConnectionType EXTERNAL = fromString("External"); - - /** - * Creates a new instance of ConnectionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ConnectionType() { - } - - /** - * Creates or finds a ConnectionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ConnectionType. - */ - @JsonCreator - public static ConnectionType fromString(String name) { - return fromString(name, ConnectionType.class); - } - - /** - * Gets known ConnectionType values. - * - * @return known ConnectionType values. - */ - public static Collection values() { - return values(ConnectionType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSetting.java deleted file mode 100644 index 5a13750d1686..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSetting.java +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; - -/** An immutable client-side representation of ConnectorSetting. */ -public interface ConnectorSetting { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the hybridComputeSettings property: Settings for hybrid compute management. These settings are relevant only - * for Arc autoProvision (Hybrid Compute). - * - * @return the hybridComputeSettings value. - */ - HybridComputeSettingsProperties hybridComputeSettings(); - - /** - * Gets the authenticationDetails property: Settings for authentication management, these settings are relevant only - * for the cloud connector. - * - * @return the authenticationDetails value. - */ - AuthenticationDetailsProperties authenticationDetails(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner object. - * - * @return the inner object. - */ - ConnectorSettingInner innerModel(); - - /** The entirety of the ConnectorSetting definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - /** The ConnectorSetting definition stages. */ - interface DefinitionStages { - /** The first stage of the ConnectorSetting definition. */ - interface Blank extends WithCreate { - } - /** - * The stage of the ConnectorSetting definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithHybridComputeSettings, DefinitionStages.WithAuthenticationDetails { - /** - * Executes the create request. - * - * @return the created resource. - */ - ConnectorSetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - ConnectorSetting create(Context context); - } - /** The stage of the ConnectorSetting definition allowing to specify hybridComputeSettings. */ - interface WithHybridComputeSettings { - /** - * Specifies the hybridComputeSettings property: Settings for hybrid compute management. These settings are - * relevant only for Arc autoProvision (Hybrid Compute).. - * - * @param hybridComputeSettings Settings for hybrid compute management. These settings are relevant only for - * Arc autoProvision (Hybrid Compute). - * @return the next definition stage. - */ - WithCreate withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings); - } - /** The stage of the ConnectorSetting definition allowing to specify authenticationDetails. */ - interface WithAuthenticationDetails { - /** - * Specifies the authenticationDetails property: Settings for authentication management, these settings are - * relevant only for the cloud connector.. - * - * @param authenticationDetails Settings for authentication management, these settings are relevant only for - * the cloud connector. - * @return the next definition stage. - */ - WithCreate withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails); - } - } - /** - * Begins update for the ConnectorSetting resource. - * - * @return the stage of resource update. - */ - ConnectorSetting.Update update(); - - /** The template for ConnectorSetting update. */ - interface Update extends UpdateStages.WithHybridComputeSettings, UpdateStages.WithAuthenticationDetails { - /** - * Executes the update request. - * - * @return the updated resource. - */ - ConnectorSetting apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - ConnectorSetting apply(Context context); - } - /** The ConnectorSetting update stages. */ - interface UpdateStages { - /** The stage of the ConnectorSetting update allowing to specify hybridComputeSettings. */ - interface WithHybridComputeSettings { - /** - * Specifies the hybridComputeSettings property: Settings for hybrid compute management. These settings are - * relevant only for Arc autoProvision (Hybrid Compute).. - * - * @param hybridComputeSettings Settings for hybrid compute management. These settings are relevant only for - * Arc autoProvision (Hybrid Compute). - * @return the next definition stage. - */ - Update withHybridComputeSettings(HybridComputeSettingsProperties hybridComputeSettings); - } - /** The stage of the ConnectorSetting update allowing to specify authenticationDetails. */ - interface WithAuthenticationDetails { - /** - * Specifies the authenticationDetails property: Settings for authentication management, these settings are - * relevant only for the cloud connector.. - * - * @param authenticationDetails Settings for authentication management, these settings are relevant only for - * the cloud connector. - * @return the next definition stage. - */ - Update withAuthenticationDetails(AuthenticationDetailsProperties authenticationDetails); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - ConnectorSetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - ConnectorSetting refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSettingList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSettingList.java deleted file mode 100644 index f593b5739380..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ConnectorSettingList.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** For a subscription, list of all cloud account connectors and their settings. */ -@Fluent -public final class ConnectorSettingList { - /* - * List of all the cloud account connector settings - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of ConnectorSettingList class. */ - public ConnectorSettingList() { - } - - /** - * Get the value property: List of all the cloud account connector settings. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of all the cloud account connector settings. - * - * @param value the value value to set. - * @return the ConnectorSettingList object itself. - */ - public ConnectorSettingList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Connectors.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Connectors.java deleted file mode 100644 index 0fbe5c0e8ca4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Connectors.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Connectors. */ -public interface Connectors { - /** - * Cloud accounts connectors of a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Cloud accounts connectors of a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return for a subscription, list of all cloud account connectors and their settings as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response}. - */ - Response getWithResponse(String connectorName, Context context); - - /** - * Details of a specific cloud account connector. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting. - */ - ConnectorSetting get(String connectorName); - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String connectorName, Context context); - - /** - * Delete a cloud account connector from a subscription. - * - * @param connectorName Name of the cloud account connector. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String connectorName); - - /** - * Details of a specific cloud account connector. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response}. - */ - ConnectorSetting getById(String id); - - /** - * Details of a specific cloud account connector. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the connector setting along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a cloud account connector from a subscription. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a cloud account connector from a subscription. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new ConnectorSetting resource. - * - * @param name resource name. - * @return the first stage of the new ConnectorSetting definition. - */ - ConnectorSetting.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java deleted file mode 100644 index 490b6e85e689..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ContainerRegistryVulnerabilityProperties.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** Additional context fields for container registry Vulnerability assessment. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "assessedResourceType") -@JsonTypeName("ContainerRegistryVulnerability") -@Immutable -public final class ContainerRegistryVulnerabilityProperties extends AdditionalData { - /* - * Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, Vulnerability - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * 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; - - /* - * Indicates whether a patch is available or not - */ - @JsonProperty(value = "patchable", access = JsonProperty.Access.WRITE_ONLY) - private Boolean patchable; - - /* - * List of CVEs - */ - @JsonProperty(value = "cve", access = JsonProperty.Access.WRITE_ONLY) - private List cve; - - /* - * Published time - */ - @JsonProperty(value = "publishedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime publishedTime; - - /* - * The vendorReferences property. - */ - @JsonProperty(value = "vendorReferences", access = JsonProperty.Access.WRITE_ONLY) - private List vendorReferences; - - /* - * Name of the repository which the vulnerable image belongs to - */ - @JsonProperty(value = "repositoryName", access = JsonProperty.Access.WRITE_ONLY) - private String repositoryName; - - /* - * Digest of the vulnerable image - */ - @JsonProperty(value = "imageDigest", access = JsonProperty.Access.WRITE_ONLY) - private String imageDigest; - - /** Creates an instance of ContainerRegistryVulnerabilityProperties class. */ - public ContainerRegistryVulnerabilityProperties() { - } - - /** - * Get the type property: Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, - * Vulnerability. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the cvss property: Dictionary from cvss version to cvss details object. - * - * @return the cvss value. - */ - public Map cvss() { - return this.cvss; - } - - /** - * Get the patchable property: Indicates whether a patch is available or not. - * - * @return the patchable value. - */ - public Boolean patchable() { - return this.patchable; - } - - /** - * Get the cve property: List of CVEs. - * - * @return the cve value. - */ - public List cve() { - return this.cve; - } - - /** - * Get the publishedTime property: Published time. - * - * @return the publishedTime value. - */ - public OffsetDateTime publishedTime() { - return this.publishedTime; - } - - /** - * Get the vendorReferences property: The vendorReferences property. - * - * @return the vendorReferences value. - */ - public List vendorReferences() { - return this.vendorReferences; - } - - /** - * Get the repositoryName property: Name of the repository which the vulnerable image belongs to. - * - * @return the repositoryName value. - */ - public String repositoryName() { - return this.repositoryName; - } - - /** - * Get the imageDigest property: Digest of the vulnerable image. - * - * @return the imageDigest value. - */ - public String imageDigest() { - return this.imageDigest; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (cvss() != null) { - cvss() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - if (cve() != null) { - cve().forEach(e -> e.validate()); - } - if (vendorReferences() != null) { - vendorReferences().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ControlType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ControlType.java deleted file mode 100644 index b2502b132198..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ControlType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The type of security control (for example, BuiltIn). */ -public final class ControlType extends ExpandableStringEnum { - /** Static value BuiltIn for ControlType. */ - public static final ControlType BUILT_IN = fromString("BuiltIn"); - - /** Static value Custom for ControlType. */ - public static final ControlType CUSTOM = fromString("Custom"); - - /** - * Creates a new instance of ControlType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ControlType() { - } - - /** - * Creates or finds a ControlType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ControlType. - */ - @JsonCreator - public static ControlType fromString(String name) { - return fromString(name, ControlType.class); - } - - /** - * Gets known ControlType values. - * - * @return known ControlType values. - */ - public static Collection values() { - return values(ControlType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOffering.java deleted file mode 100644 index 3ead5e6e1dca..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOffering.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The CSPM monitoring for AWS offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("CspmMonitorAws") -@Fluent -public final class CspmMonitorAwsOffering extends CloudOffering { - /* - * The native cloud connection configuration - */ - @JsonProperty(value = "nativeCloudConnection") - private CspmMonitorAwsOfferingNativeCloudConnection nativeCloudConnection; - - /** Creates an instance of CspmMonitorAwsOffering class. */ - public CspmMonitorAwsOffering() { - } - - /** - * Get the nativeCloudConnection property: The native cloud connection configuration. - * - * @return the nativeCloudConnection value. - */ - public CspmMonitorAwsOfferingNativeCloudConnection nativeCloudConnection() { - return this.nativeCloudConnection; - } - - /** - * Set the nativeCloudConnection property: The native cloud connection configuration. - * - * @param nativeCloudConnection the nativeCloudConnection value to set. - * @return the CspmMonitorAwsOffering object itself. - */ - public CspmMonitorAwsOffering withNativeCloudConnection( - CspmMonitorAwsOfferingNativeCloudConnection nativeCloudConnection) { - this.nativeCloudConnection = nativeCloudConnection; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (nativeCloudConnection() != null) { - nativeCloudConnection().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOfferingNativeCloudConnection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOfferingNativeCloudConnection.java deleted file mode 100644 index 0c58266fdcb8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAwsOfferingNativeCloudConnection.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The native cloud connection configuration. */ -@Fluent -public final class CspmMonitorAwsOfferingNativeCloudConnection { - /* - * The cloud role ARN in AWS for this feature - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /** Creates an instance of CspmMonitorAwsOfferingNativeCloudConnection class. */ - public CspmMonitorAwsOfferingNativeCloudConnection() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the CspmMonitorAwsOfferingNativeCloudConnection object itself. - */ - public CspmMonitorAwsOfferingNativeCloudConnection withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAzureDevOpsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAzureDevOpsOffering.java deleted file mode 100644 index 37effcc24def..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorAzureDevOpsOffering.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The CSPM monitoring for AzureDevOps offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("CspmMonitorAzureDevOps") -@Immutable -public final class CspmMonitorAzureDevOpsOffering extends CloudOffering { - /** Creates an instance of CspmMonitorAzureDevOpsOffering class. */ - public CspmMonitorAzureDevOpsOffering() { - } - - /** - * 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/CspmMonitorGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOffering.java deleted file mode 100644 index 48f5c5f63a00..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOffering.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The CSPM monitoring for GCP offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("CspmMonitorGcp") -@Fluent -public final class CspmMonitorGcpOffering extends CloudOffering { - /* - * The native cloud connection configuration - */ - @JsonProperty(value = "nativeCloudConnection") - private CspmMonitorGcpOfferingNativeCloudConnection nativeCloudConnection; - - /** Creates an instance of CspmMonitorGcpOffering class. */ - public CspmMonitorGcpOffering() { - } - - /** - * Get the nativeCloudConnection property: The native cloud connection configuration. - * - * @return the nativeCloudConnection value. - */ - public CspmMonitorGcpOfferingNativeCloudConnection nativeCloudConnection() { - return this.nativeCloudConnection; - } - - /** - * Set the nativeCloudConnection property: The native cloud connection configuration. - * - * @param nativeCloudConnection the nativeCloudConnection value to set. - * @return the CspmMonitorGcpOffering object itself. - */ - public CspmMonitorGcpOffering withNativeCloudConnection( - CspmMonitorGcpOfferingNativeCloudConnection nativeCloudConnection) { - this.nativeCloudConnection = nativeCloudConnection; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (nativeCloudConnection() != null) { - nativeCloudConnection().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOfferingNativeCloudConnection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOfferingNativeCloudConnection.java deleted file mode 100644 index 3b653d78726c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGcpOfferingNativeCloudConnection.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The native cloud connection configuration. */ -@Fluent -public final class CspmMonitorGcpOfferingNativeCloudConnection { - /* - * The GCP workload identity provider id for the offering - */ - @JsonProperty(value = "workloadIdentityProviderId") - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this offering - */ - @JsonProperty(value = "serviceAccountEmailAddress") - private String serviceAccountEmailAddress; - - /** Creates an instance of CspmMonitorGcpOfferingNativeCloudConnection class. */ - public CspmMonitorGcpOfferingNativeCloudConnection() { - } - - /** - * Get the workloadIdentityProviderId property: The GCP workload identity provider id for the offering. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The GCP workload identity provider id for the offering. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the CspmMonitorGcpOfferingNativeCloudConnection object itself. - */ - public CspmMonitorGcpOfferingNativeCloudConnection withWorkloadIdentityProviderId( - String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the CspmMonitorGcpOfferingNativeCloudConnection object itself. - */ - public CspmMonitorGcpOfferingNativeCloudConnection withServiceAccountEmailAddress( - String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGitLabOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGitLabOffering.java deleted file mode 100644 index c4968ba49cf1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGitLabOffering.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The CSPM (Cloud security posture management) monitoring for gitlab offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("CspmMonitorGitLab") -@Immutable -public final class CspmMonitorGitLabOffering extends CloudOffering { - /** Creates an instance of CspmMonitorGitLabOffering class. */ - public CspmMonitorGitLabOffering() { - } - - /** - * 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/CspmMonitorGithubOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGithubOffering.java deleted file mode 100644 index 1039d0c712fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CspmMonitorGithubOffering.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The CSPM monitoring for github offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("CspmMonitorGithub") -@Immutable -public final class CspmMonitorGithubOffering extends CloudOffering { - /** Creates an instance of CspmMonitorGithubOffering class. */ - public CspmMonitorGithubOffering() { - } - - /** - * 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/CustomAlertRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAlertRule.java deleted file mode 100644 index 6b17e8b182ee..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAlertRule.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** A custom alert rule. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "ruleType", - defaultImpl = CustomAlertRule.class) -@JsonTypeName("CustomAlertRule") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "ThresholdCustomAlertRule", value = ThresholdCustomAlertRule.class), - @JsonSubTypes.Type(name = "ListCustomAlertRule", value = ListCustomAlertRule.class) -}) -@Fluent -public class CustomAlertRule { - /* - * The display name of the custom alert. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * The description of the custom alert. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * Status of the custom alert. - */ - @JsonProperty(value = "isEnabled", required = true) - private boolean isEnabled; - - /** Creates an instance of CustomAlertRule class. */ - public CustomAlertRule() { - } - - /** - * Get the displayName property: The display name of the custom alert. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the description property: The description of the custom alert. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the isEnabled property: Status of the custom alert. - * - * @return the isEnabled value. - */ - public boolean isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Status of the custom alert. - * - * @param isEnabled the isEnabled value to set. - * @return the CustomAlertRule object itself. - */ - public CustomAlertRule withIsEnabled(boolean isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.java deleted file mode 100644 index 59ff105ba2b4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomation.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.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; - -/** An immutable client-side representation of CustomAssessmentAutomation. */ -public interface CustomAssessmentAutomation { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the compressedQuery property: GZip encoded KQL query representing the assessment automation results - * required. - * - * @return the compressedQuery value. - */ - String compressedQuery(); - - /** - * Gets the supportedCloud property: Relevant cloud for the custom assessment automation. - * - * @return the supportedCloud value. - */ - SupportedCloudEnum supportedCloud(); - - /** - * Gets the severity property: The severity to relate to the assessments generated by this assessment automation. - * - * @return the severity value. - */ - SeverityEnum severity(); - - /** - * Gets the displayName property: The display name of the assessments generated by this assessment automation. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the description property: The description to relate to the assessments generated by this assessment - * automation. - * - * @return the description value. - */ - String description(); - - /** - * Gets the remediationDescription property: The remediation description to relate to the assessments generated by - * this assessment automation. - * - * @return the remediationDescription value. - */ - String remediationDescription(); - - /** - * Gets the assessmentKey property: The assessment metadata key used when an assessment is generated for this - * assessment automation. - * - * @return the assessmentKey value. - */ - String assessmentKey(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner object. - * - * @return the inner object. - */ - CustomAssessmentAutomationInner innerModel(); - - /** The entirety of the CustomAssessmentAutomation definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { - } - /** The CustomAssessmentAutomation definition stages. */ - interface DefinitionStages { - /** The first stage of the CustomAssessmentAutomation definition. */ - interface Blank extends WithResourceGroup { - } - /** The stage of the CustomAssessmentAutomation definition allowing to specify parent resource. */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - /** - * The stage of the CustomAssessmentAutomation definition which contains all the minimum required properties for - * the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithCompressedQuery, - DefinitionStages.WithSupportedCloud, - DefinitionStages.WithSeverity, - DefinitionStages.WithDisplayName, - DefinitionStages.WithDescription, - DefinitionStages.WithRemediationDescription { - /** - * Executes the create request. - * - * @return the created resource. - */ - CustomAssessmentAutomation create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - CustomAssessmentAutomation create(Context context); - } - /** The stage of the CustomAssessmentAutomation definition allowing to specify compressedQuery. */ - interface WithCompressedQuery { - /** - * Specifies the compressedQuery property: Base 64 encoded KQL query representing the assessment automation - * results required.. - * - * @param compressedQuery Base 64 encoded KQL query representing the assessment automation results required. - * @return the next definition stage. - */ - WithCreate withCompressedQuery(String compressedQuery); - } - /** The stage of the CustomAssessmentAutomation definition allowing to specify supportedCloud. */ - interface WithSupportedCloud { - /** - * Specifies the supportedCloud property: Relevant cloud for the custom assessment automation.. - * - * @param supportedCloud Relevant cloud for the custom assessment automation. - * @return the next definition stage. - */ - WithCreate withSupportedCloud(SupportedCloudEnum supportedCloud); - } - /** The stage of the CustomAssessmentAutomation definition allowing to specify severity. */ - interface WithSeverity { - /** - * Specifies the severity property: The severity to relate to the assessments generated by this assessment - * automation.. - * - * @param severity The severity to relate to the assessments generated by this assessment automation. - * @return the next definition stage. - */ - WithCreate withSeverity(SeverityEnum severity); - } - /** The stage of the CustomAssessmentAutomation definition allowing to specify displayName. */ - interface WithDisplayName { - /** - * Specifies the displayName property: The display name of the assessments generated by this assessment - * automation.. - * - * @param displayName The display name of the assessments generated by this assessment automation. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - /** The stage of the CustomAssessmentAutomation definition allowing to specify description. */ - interface WithDescription { - /** - * Specifies the description property: The description to relate to the assessments generated by this - * assessment automation.. - * - * @param description The description to relate to the assessments generated by this assessment automation. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - /** The stage of the CustomAssessmentAutomation definition allowing to specify remediationDescription. */ - interface WithRemediationDescription { - /** - * Specifies the remediationDescription property: The remediation description to relate to the assessments - * generated by this assessment automation.. - * - * @param remediationDescription The remediation description to relate to the assessments generated by this - * assessment automation. - * @return the next definition stage. - */ - WithCreate withRemediationDescription(String remediationDescription); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - CustomAssessmentAutomation refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - CustomAssessmentAutomation refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationRequest.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationRequest.java deleted file mode 100644 index 0c48f14f9c28..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationRequest.java +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationRequestProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Custom Assessment Automation request. */ -@Fluent -public final class CustomAssessmentAutomationRequest extends ProxyResource { - /* - * describes Custom Assessment Automation request properties. - */ - @JsonProperty(value = "properties") - private CustomAssessmentAutomationRequestProperties innerProperties; - - /** Creates an instance of CustomAssessmentAutomationRequest class. */ - public CustomAssessmentAutomationRequest() { - } - - /** - * Get the innerProperties property: describes Custom Assessment Automation request properties. - * - * @return the innerProperties value. - */ - private CustomAssessmentAutomationRequestProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the compressedQuery property: Base 64 encoded KQL query representing the assessment automation results - * required. - * - * @return the compressedQuery value. - */ - public String compressedQuery() { - return this.innerProperties() == null ? null : this.innerProperties().compressedQuery(); - } - - /** - * Set the compressedQuery property: Base 64 encoded KQL query representing the assessment automation results - * required. - * - * @param compressedQuery the compressedQuery value to set. - * @return the CustomAssessmentAutomationRequest object itself. - */ - public CustomAssessmentAutomationRequest withCompressedQuery(String compressedQuery) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomAssessmentAutomationRequestProperties(); - } - this.innerProperties().withCompressedQuery(compressedQuery); - return this; - } - - /** - * Get the supportedCloud property: Relevant cloud for the custom assessment automation. - * - * @return the supportedCloud value. - */ - public SupportedCloudEnum supportedCloud() { - return this.innerProperties() == null ? null : this.innerProperties().supportedCloud(); - } - - /** - * Set the supportedCloud property: Relevant cloud for the custom assessment automation. - * - * @param supportedCloud the supportedCloud value to set. - * @return the CustomAssessmentAutomationRequest object itself. - */ - public CustomAssessmentAutomationRequest withSupportedCloud(SupportedCloudEnum supportedCloud) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomAssessmentAutomationRequestProperties(); - } - this.innerProperties().withSupportedCloud(supportedCloud); - return this; - } - - /** - * Get the severity property: The severity to relate to the assessments generated by this assessment automation. - * - * @return the severity value. - */ - public SeverityEnum severity() { - return this.innerProperties() == null ? null : this.innerProperties().severity(); - } - - /** - * Set the severity property: The severity to relate to the assessments generated by this assessment automation. - * - * @param severity the severity value to set. - * @return the CustomAssessmentAutomationRequest object itself. - */ - public CustomAssessmentAutomationRequest withSeverity(SeverityEnum severity) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomAssessmentAutomationRequestProperties(); - } - this.innerProperties().withSeverity(severity); - return this; - } - - /** - * Get the displayName property: The display name of the assessments generated by this assessment automation. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Set the displayName property: The display name of the assessments generated by this assessment automation. - * - * @param displayName the displayName value to set. - * @return the CustomAssessmentAutomationRequest object itself. - */ - public CustomAssessmentAutomationRequest withDisplayName(String displayName) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomAssessmentAutomationRequestProperties(); - } - this.innerProperties().withDisplayName(displayName); - return this; - } - - /** - * Get the description property: The description to relate to the assessments generated by this assessment - * automation. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Set the description property: The description to relate to the assessments generated by this assessment - * automation. - * - * @param description the description value to set. - * @return the CustomAssessmentAutomationRequest object itself. - */ - public CustomAssessmentAutomationRequest withDescription(String description) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomAssessmentAutomationRequestProperties(); - } - this.innerProperties().withDescription(description); - return this; - } - - /** - * Get the remediationDescription property: The remediation description to relate to the assessments generated by - * this assessment automation. - * - * @return the remediationDescription value. - */ - public String remediationDescription() { - return this.innerProperties() == null ? null : this.innerProperties().remediationDescription(); - } - - /** - * Set the remediationDescription property: The remediation description to relate to the assessments generated by - * this assessment automation. - * - * @param remediationDescription the remediationDescription value to set. - * @return the CustomAssessmentAutomationRequest object itself. - */ - public CustomAssessmentAutomationRequest withRemediationDescription(String remediationDescription) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomAssessmentAutomationRequestProperties(); - } - this.innerProperties().withRemediationDescription(remediationDescription); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomations.java deleted file mode 100644 index 5a3c288c946f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomations.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of CustomAssessmentAutomations. */ -public interface CustomAssessmentAutomations { - /** - * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom assessment automation by name for the provided subscription and resource group along with - * {@link Response}. - */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String customAssessmentAutomationName, Context context); - - /** - * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom assessment automation by name for the provided subscription and resource group. - */ - CustomAssessmentAutomation getByResourceGroup(String resourceGroupName, String customAssessmentAutomationName); - - /** - * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByResourceGroupWithResponse( - String resourceGroupName, String customAssessmentAutomationName, Context context); - - /** - * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customAssessmentAutomationName Name of the Custom Assessment Automation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String customAssessmentAutomationName); - - /** - * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List custom assessment automations in a subscription and a resource group - * - *

List custom assessment automations by provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List custom assessment automations in a subscription - * - *

List custom assessment automations by provided subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Custom Assessment Automations as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom assessment automation by name for the provided subscription and resource group along with - * {@link Response}. - */ - CustomAssessmentAutomation getById(String id); - - /** - * Gets a custom assessment automation - * - *

Gets a single custom assessment automation by name for the provided subscription and resource group. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom assessment automation by name for the provided subscription and resource group along with - * {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes a custom assessment automation - * - *

Deletes a custom assessment automation by name for a provided subscription. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new CustomAssessmentAutomation resource. - * - * @param name resource name. - * @return the first stage of the new CustomAssessmentAutomation definition. - */ - CustomAssessmentAutomation.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.java deleted file mode 100644 index 12e9233976c1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomAssessmentAutomationsListResult.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of Custom Assessment Automations. */ -@Fluent -public final class CustomAssessmentAutomationsListResult { - /* - * 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; - - /** Creates an instance of CustomAssessmentAutomationsListResult class. */ - public CustomAssessmentAutomationsListResult() { - } - - /** - * Get the value property: Collection of Custom Assessment Automations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the CustomAssessmentAutomationsListResult object itself. - */ - public CustomAssessmentAutomationsListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java deleted file mode 100644 index fcdf9e4547fe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignment.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; - -/** An immutable client-side representation of CustomEntityStoreAssignment. */ -public interface CustomEntityStoreAssignment { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the principal property: The principal assigned with entity store. Format of principal is: [AAD - * type]=[PrincipalObjectId];[TenantId]. - * - * @return the principal value. - */ - String principal(); - - /** - * Gets the entityStoreDatabaseLink property: The link to entity store database. - * - * @return the entityStoreDatabaseLink value. - */ - String entityStoreDatabaseLink(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner object. - * - * @return the inner object. - */ - CustomEntityStoreAssignmentInner innerModel(); - - /** The entirety of the CustomEntityStoreAssignment definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { - } - /** The CustomEntityStoreAssignment definition stages. */ - interface DefinitionStages { - /** The first stage of the CustomEntityStoreAssignment definition. */ - interface Blank extends WithResourceGroup { - } - /** The stage of the CustomEntityStoreAssignment definition allowing to specify parent resource. */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - /** - * The stage of the CustomEntityStoreAssignment definition which contains all the minimum required properties - * for the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithPrincipal { - /** - * Executes the create request. - * - * @return the created resource. - */ - CustomEntityStoreAssignment create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - CustomEntityStoreAssignment create(Context context); - } - /** The stage of the CustomEntityStoreAssignment definition allowing to specify principal. */ - interface WithPrincipal { - /** - * Specifies the principal property: The principal assigned with entity store. If not provided, will use - * caller principal. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. - * - * @param principal The principal assigned with entity store. If not provided, will use caller principal. - * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. - * @return the next definition stage. - */ - WithCreate withPrincipal(String principal); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - CustomEntityStoreAssignment refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - CustomEntityStoreAssignment refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentRequest.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentRequest.java deleted file mode 100644 index 915238a0ec4a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentRequest.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentRequestProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** describes the custom entity store assignment request. */ -@Fluent -public final class CustomEntityStoreAssignmentRequest { - /* - * describes properties of custom entity store assignment request - */ - @JsonProperty(value = "properties") - private CustomEntityStoreAssignmentRequestProperties innerProperties; - - /** Creates an instance of CustomEntityStoreAssignmentRequest class. */ - public CustomEntityStoreAssignmentRequest() { - } - - /** - * Get the innerProperties property: describes properties of custom entity store assignment request. - * - * @return the innerProperties value. - */ - private CustomEntityStoreAssignmentRequestProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the principal property: The principal assigned with entity store. If not provided, will use caller principal. - * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. - * - * @return the principal value. - */ - public String principal() { - return this.innerProperties() == null ? null : this.innerProperties().principal(); - } - - /** - * Set the principal property: The principal assigned with entity store. If not provided, will use caller principal. - * Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. - * - * @param principal the principal value to set. - * @return the CustomEntityStoreAssignmentRequest object itself. - */ - public CustomEntityStoreAssignmentRequest withPrincipal(String principal) { - if (this.innerProperties() == null) { - this.innerProperties = new CustomEntityStoreAssignmentRequestProperties(); - } - this.innerProperties().withPrincipal(principal); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignments.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignments.java deleted file mode 100644 index 6267ac669e8e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignments.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of CustomEntityStoreAssignments. */ -public interface CustomEntityStoreAssignments { - /** - * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom entity store assignment by name for the provided subscription and resource group along - * with {@link Response}. - */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context); - - /** - * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom entity store assignment by name for the provided subscription and resource group. - */ - CustomEntityStoreAssignment getByResourceGroup(String resourceGroupName, String customEntityStoreAssignmentName); - - /** - * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByResourceGroupWithResponse( - String resourceGroupName, String customEntityStoreAssignmentName, Context context); - - /** - * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param customEntityStoreAssignmentName Name of the custom entity store assignment. Generated name is GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String customEntityStoreAssignmentName); - - /** - * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List custom entity store assignments in a subscription and a resource group - * - *

List custom entity store assignments by a provided subscription and resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List custom entity store assignments in a subscription - * - *

List custom entity store assignments by provided subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of custom entity store assignments as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom entity store assignment by name for the provided subscription and resource group along - * with {@link Response}. - */ - CustomEntityStoreAssignment getById(String id); - - /** - * Gets a custom entity store assignment - * - *

Gets a single custom entity store assignment by name for the provided subscription and resource group. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single custom entity store assignment by name for the provided subscription and resource group along - * with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deleted a custom entity store assignment - * - *

Delete a custom entity store assignment by name for a provided subscription. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new CustomEntityStoreAssignment resource. - * - * @param name resource name. - * @return the first stage of the new CustomEntityStoreAssignment definition. - */ - CustomEntityStoreAssignment.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentsListResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentsListResult.java deleted file mode 100644 index 72fd9d924f5f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/CustomEntityStoreAssignmentsListResult.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A list of custom entity store assignments. */ -@Fluent -public final class CustomEntityStoreAssignmentsListResult { - /* - * Collection of custom entity store assignments - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The link used to get the next page of operations. - */ - @JsonProperty(value = "nextLink") - private String nextLink; - - /** Creates an instance of CustomEntityStoreAssignmentsListResult class. */ - public CustomEntityStoreAssignmentsListResult() { - } - - /** - * Get the value property: Collection of custom entity store assignments. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The link used to get the next page of operations. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The link used to get the next page of operations. - * - * @param nextLink the nextLink value to set. - * @return the CustomEntityStoreAssignmentsListResult object itself. - */ - public CustomEntityStoreAssignmentsListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cve.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cve.java deleted file mode 100644 index d7ce9a9681b1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cve.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** CVE details. */ -@Immutable -public final class Cve { - /* - * CVE title - */ - @JsonProperty(value = "title", access = JsonProperty.Access.WRITE_ONLY) - private String title; - - /* - * Link url - */ - @JsonProperty(value = "link", access = JsonProperty.Access.WRITE_ONLY) - private String link; - - /** Creates an instance of Cve class. */ - public Cve() { - } - - /** - * Get the title property: CVE title. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Get the link property: Link url. - * - * @return the link value. - */ - public String link() { - return this.link; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cvss.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cvss.java deleted file mode 100644 index 2e1f3a22d534..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Cvss.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.fasterxml.jackson.annotation.JsonProperty; - -/** CVSS details. */ -@Immutable -public final class Cvss { - /* - * CVSS base - */ - @JsonProperty(value = "base", access = JsonProperty.Access.WRITE_ONLY) - private Float base; - - /** Creates an instance of Cvss class. */ - public Cvss() { - } - - /** - * Get the base property: CVSS base. - * - * @return the base value. - */ - public Float base() { - return this.base; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.java deleted file mode 100644 index ed4306d48879..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataExportSettings.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.DataExportSettingProperties; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Represents a data export setting. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") -@JsonTypeName("DataExportSettings") -@Fluent -public final class DataExportSettings extends SettingInner { - /* - * Data export setting data - */ - @JsonProperty(value = "properties") - private DataExportSettingProperties innerProperties; - - /** Creates an instance of DataExportSettings class. */ - public DataExportSettings() { - } - - /** - * Get the innerProperties property: Data export setting data. - * - * @return the innerProperties value. - */ - private DataExportSettingProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the enabled property: Is the data export setting enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.innerProperties() == null ? null : this.innerProperties().enabled(); - } - - /** - * Set the enabled property: Is the data export setting enabled. - * - * @param enabled the enabled value to set. - * @return the DataExportSettings object itself. - */ - public DataExportSettings withEnabled(Boolean enabled) { - if (this.innerProperties() == null) { - this.innerProperties = new DataExportSettingProperties(); - } - this.innerProperties().withEnabled(enabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataSource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataSource.java deleted file mode 100644 index 8327adbc4f49..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DataSource.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for DataSource. */ -public final class DataSource extends ExpandableStringEnum { - /** Static value TwinData for DataSource. */ - public static final DataSource TWIN_DATA = fromString("TwinData"); - - /** - * Creates a new instance of DataSource value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public DataSource() { - } - - /** - * Creates or finds a DataSource from its string representation. - * - * @param name a name to look for. - * @return the corresponding DataSource. - */ - @JsonCreator - public static DataSource fromString(String name) { - return fromString(name, DataSource.class); - } - - /** - * Gets known DataSource values. - * - * @return known DataSource values. - */ - public static Collection values() { - return values(DataSource.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOffering.java deleted file mode 100644 index 0d4bb91cd0c7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOffering.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The CSPM P1 for AWS offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("DefenderCspmAws") -@Fluent -public final class DefenderCspmAwsOffering extends CloudOffering { - /* - * The Microsoft Defender for Server VM scanning configuration - */ - @JsonProperty(value = "vmScanners") - private DefenderCspmAwsOfferingVmScanners vmScanners; - - /* - * The Microsoft Defender Data Sensitivity discovery configuration - */ - @JsonProperty(value = "dataSensitivityDiscovery") - private DefenderCspmAwsOfferingDataSensitivityDiscovery dataSensitivityDiscovery; - - /* - * The databases DSPM configuration - */ - @JsonProperty(value = "databasesDspm") - private DefenderCspmAwsOfferingDatabasesDspm databasesDspm; - - /** Creates an instance of DefenderCspmAwsOffering class. */ - public DefenderCspmAwsOffering() { - } - - /** - * Get the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderCspmAwsOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering withVmScanners(DefenderCspmAwsOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Get the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration. - * - * @return the dataSensitivityDiscovery value. - */ - public DefenderCspmAwsOfferingDataSensitivityDiscovery dataSensitivityDiscovery() { - return this.dataSensitivityDiscovery; - } - - /** - * Set the dataSensitivityDiscovery property: The Microsoft Defender Data Sensitivity discovery configuration. - * - * @param dataSensitivityDiscovery the dataSensitivityDiscovery value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering withDataSensitivityDiscovery( - DefenderCspmAwsOfferingDataSensitivityDiscovery dataSensitivityDiscovery) { - this.dataSensitivityDiscovery = dataSensitivityDiscovery; - return this; - } - - /** - * Get the databasesDspm property: The databases DSPM configuration. - * - * @return the databasesDspm value. - */ - public DefenderCspmAwsOfferingDatabasesDspm databasesDspm() { - return this.databasesDspm; - } - - /** - * Set the databasesDspm property: The databases DSPM configuration. - * - * @param databasesDspm the databasesDspm value to set. - * @return the DefenderCspmAwsOffering object itself. - */ - public DefenderCspmAwsOffering withDatabasesDspm(DefenderCspmAwsOfferingDatabasesDspm databasesDspm) { - this.databasesDspm = databasesDspm; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (vmScanners() != null) { - vmScanners().validate(); - } - if (dataSensitivityDiscovery() != null) { - dataSensitivityDiscovery().validate(); - } - if (databasesDspm() != null) { - databasesDspm().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDataSensitivityDiscovery.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDataSensitivityDiscovery.java deleted file mode 100644 index 4db399753ec8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDataSensitivityDiscovery.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Microsoft Defender Data Sensitivity discovery configuration. */ -@Fluent -public final class DefenderCspmAwsOfferingDataSensitivityDiscovery { - /* - * Is Microsoft Defender Data Sensitivity discovery enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /** Creates an instance of DefenderCspmAwsOfferingDataSensitivityDiscovery class. */ - public DefenderCspmAwsOfferingDataSensitivityDiscovery() { - } - - /** - * Get the enabled property: Is Microsoft Defender Data Sensitivity discovery enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender Data Sensitivity discovery enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmAwsOfferingDataSensitivityDiscovery object itself. - */ - public DefenderCspmAwsOfferingDataSensitivityDiscovery withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingDataSensitivityDiscovery object itself. - */ - public DefenderCspmAwsOfferingDataSensitivityDiscovery withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDatabasesDspm.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDatabasesDspm.java deleted file mode 100644 index 15821e5d425b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingDatabasesDspm.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The databases DSPM configuration. */ -@Fluent -public final class DefenderCspmAwsOfferingDatabasesDspm { - /* - * Is databases DSPM protection enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /** Creates an instance of DefenderCspmAwsOfferingDatabasesDspm class. */ - public DefenderCspmAwsOfferingDatabasesDspm() { - } - - /** - * Get the enabled property: Is databases DSPM protection enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is databases DSPM protection enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmAwsOfferingDatabasesDspm object itself. - */ - public DefenderCspmAwsOfferingDatabasesDspm withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingDatabasesDspm object itself. - */ - public DefenderCspmAwsOfferingDatabasesDspm withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScanners.java deleted file mode 100644 index 8854c0967acf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScanners.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Microsoft Defender for Server VM scanning configuration. */ -@Fluent -public final class DefenderCspmAwsOfferingVmScanners { - /* - * Is Microsoft Defender for Server VM scanning enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * configuration for Microsoft Defender for Server VM scanning - */ - @JsonProperty(value = "configuration") - private DefenderCspmAwsOfferingVmScannersConfiguration configuration; - - /** Creates an instance of DefenderCspmAwsOfferingVmScanners class. */ - public DefenderCspmAwsOfferingVmScanners() { - } - - /** - * Get the enabled property: Is Microsoft Defender for Server VM scanning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender for Server VM scanning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderCspmAwsOfferingVmScanners object itself. - */ - public DefenderCspmAwsOfferingVmScanners withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Microsoft Defender for Server VM scanning. - * - * @return the configuration value. - */ - public DefenderCspmAwsOfferingVmScannersConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Microsoft Defender for Server VM scanning. - * - * @param configuration the configuration value to set. - * @return the DefenderCspmAwsOfferingVmScanners object itself. - */ - public DefenderCspmAwsOfferingVmScanners withConfiguration( - DefenderCspmAwsOfferingVmScannersConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScannersConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScannersConfiguration.java deleted file mode 100644 index e70b7f13e8c2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmAwsOfferingVmScannersConfiguration.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** configuration for Microsoft Defender for Server VM scanning. */ -@Fluent -public final class DefenderCspmAwsOfferingVmScannersConfiguration { - /* - * The cloud role ARN in AWS for this feature - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /* - * The scanning mode for the VM scan. - */ - @JsonProperty(value = "scanningMode") - private ScanningMode scanningMode; - - /* - * VM tags that indicates that VM should not be scanned - */ - @JsonProperty(value = "exclusionTags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map exclusionTags; - - /** Creates an instance of DefenderCspmAwsOfferingVmScannersConfiguration class. */ - public DefenderCspmAwsOfferingVmScannersConfiguration() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderCspmAwsOfferingVmScannersConfiguration object itself. - */ - public DefenderCspmAwsOfferingVmScannersConfiguration withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Get the scanningMode property: The scanning mode for the VM scan. - * - * @return the scanningMode value. - */ - public ScanningMode scanningMode() { - return this.scanningMode; - } - - /** - * Set the scanningMode property: The scanning mode for the VM scan. - * - * @param scanningMode the scanningMode value to set. - * @return the DefenderCspmAwsOfferingVmScannersConfiguration object itself. - */ - public DefenderCspmAwsOfferingVmScannersConfiguration withScanningMode(ScanningMode scanningMode) { - this.scanningMode = scanningMode; - return this; - } - - /** - * Get the exclusionTags property: VM tags that indicates that VM should not be scanned. - * - * @return the exclusionTags value. - */ - public Map exclusionTags() { - return this.exclusionTags; - } - - /** - * Set the exclusionTags property: VM tags that indicates that VM should not be scanned. - * - * @param exclusionTags the exclusionTags value to set. - * @return the DefenderCspmAwsOfferingVmScannersConfiguration object itself. - */ - public DefenderCspmAwsOfferingVmScannersConfiguration withExclusionTags(Map exclusionTags) { - this.exclusionTags = exclusionTags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOffering.java deleted file mode 100644 index cea6a0f8d95e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderCspmGcpOffering.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The CSPM P1 for GCP offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("DefenderCspmGcp") -@Immutable -public final class DefenderCspmGcpOffering extends CloudOffering { - /** Creates an instance of DefenderCspmGcpOffering class. */ - public DefenderCspmGcpOffering() { - } - - /** - * 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/DefenderFoDatabasesAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOffering.java deleted file mode 100644 index d95d5ca67fb6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOffering.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The Defender for Databases AWS offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("DefenderForDatabasesAws") -@Fluent -public final class DefenderFoDatabasesAwsOffering extends CloudOffering { - /* - * The ARC autoprovisioning configuration - */ - @JsonProperty(value = "arcAutoProvisioning") - private DefenderFoDatabasesAwsOfferingArcAutoProvisioning arcAutoProvisioning; - - /* - * The RDS configuration - */ - @JsonProperty(value = "rds") - private DefenderFoDatabasesAwsOfferingRds rds; - - /* - * The databases data security posture management (DSPM) configuration - */ - @JsonProperty(value = "databasesDspm") - private DefenderFoDatabasesAwsOfferingDatabasesDspm databasesDspm; - - /** Creates an instance of DefenderFoDatabasesAwsOffering class. */ - public DefenderFoDatabasesAwsOffering() { - } - - /** - * Get the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @return the arcAutoProvisioning value. - */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning arcAutoProvisioning() { - return this.arcAutoProvisioning; - } - - /** - * Set the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @param arcAutoProvisioning the arcAutoProvisioning value to set. - * @return the DefenderFoDatabasesAwsOffering object itself. - */ - public DefenderFoDatabasesAwsOffering withArcAutoProvisioning( - DefenderFoDatabasesAwsOfferingArcAutoProvisioning arcAutoProvisioning) { - this.arcAutoProvisioning = arcAutoProvisioning; - return this; - } - - /** - * Get the rds property: The RDS configuration. - * - * @return the rds value. - */ - public DefenderFoDatabasesAwsOfferingRds rds() { - return this.rds; - } - - /** - * Set the rds property: The RDS configuration. - * - * @param rds the rds value to set. - * @return the DefenderFoDatabasesAwsOffering object itself. - */ - public DefenderFoDatabasesAwsOffering withRds(DefenderFoDatabasesAwsOfferingRds rds) { - this.rds = rds; - return this; - } - - /** - * Get the databasesDspm property: The databases data security posture management (DSPM) configuration. - * - * @return the databasesDspm value. - */ - public DefenderFoDatabasesAwsOfferingDatabasesDspm databasesDspm() { - return this.databasesDspm; - } - - /** - * Set the databasesDspm property: The databases data security posture management (DSPM) configuration. - * - * @param databasesDspm the databasesDspm value to set. - * @return the DefenderFoDatabasesAwsOffering object itself. - */ - public DefenderFoDatabasesAwsOffering withDatabasesDspm(DefenderFoDatabasesAwsOfferingDatabasesDspm databasesDspm) { - this.databasesDspm = databasesDspm; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (arcAutoProvisioning() != null) { - arcAutoProvisioning().validate(); - } - if (rds() != null) { - rds().validate(); - } - if (databasesDspm() != null) { - databasesDspm().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioning.java deleted file mode 100644 index b08183d5e9f3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioning.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ARC autoprovisioning configuration. */ -@Fluent -public final class DefenderFoDatabasesAwsOfferingArcAutoProvisioning { - /* - * Is arc auto provisioning enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /* - * Configuration for servers Arc auto provisioning - */ - @JsonProperty(value = "configuration") - private DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration configuration; - - /** Creates an instance of DefenderFoDatabasesAwsOfferingArcAutoProvisioning class. */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning() { - } - - /** - * Get the enabled property: Is arc auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is arc auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderFoDatabasesAwsOfferingArcAutoProvisioning object itself. - */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderFoDatabasesAwsOfferingArcAutoProvisioning object itself. - */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Get the configuration property: Configuration for servers Arc auto provisioning. - * - * @return the configuration value. - */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: Configuration for servers Arc auto provisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderFoDatabasesAwsOfferingArcAutoProvisioning object itself. - */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioning withConfiguration( - DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration.java deleted file mode 100644 index a4796bf24775..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configuration for servers Arc auto provisioning. */ -@Fluent -public final class DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration { - /* - * Optional http proxy endpoint to use for the Arc agent - */ - @JsonProperty(value = "proxy") - private String proxy; - - /* - * Optional Arc private link scope resource id to link the Arc agent - */ - @JsonProperty(value = "privateLinkScope") - private String privateLinkScope; - - /** Creates an instance of DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration class. */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration() { - } - - /** - * Get the proxy property: Optional http proxy endpoint to use for the Arc agent. - * - * @return the proxy value. - */ - public String proxy() { - return this.proxy; - } - - /** - * Set the proxy property: Optional http proxy endpoint to use for the Arc agent. - * - * @param proxy the proxy value to set. - * @return the DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration object itself. - */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration withProxy(String proxy) { - this.proxy = proxy; - return this; - } - - /** - * Get the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * - * @return the privateLinkScope value. - */ - public String privateLinkScope() { - return this.privateLinkScope; - } - - /** - * Set the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * - * @param privateLinkScope the privateLinkScope value to set. - * @return the DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration object itself. - */ - public DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration withPrivateLinkScope( - String privateLinkScope) { - this.privateLinkScope = privateLinkScope; - 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/DefenderFoDatabasesAwsOfferingDatabasesDspm.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingDatabasesDspm.java deleted file mode 100644 index f4e4b88c8735..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingDatabasesDspm.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The databases data security posture management (DSPM) configuration. */ -@Fluent -public final class DefenderFoDatabasesAwsOfferingDatabasesDspm { - /* - * Is databases data security posture management (DSPM) protection enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /** Creates an instance of DefenderFoDatabasesAwsOfferingDatabasesDspm class. */ - public DefenderFoDatabasesAwsOfferingDatabasesDspm() { - } - - /** - * Get the enabled property: Is databases data security posture management (DSPM) protection enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is databases data security posture management (DSPM) protection enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderFoDatabasesAwsOfferingDatabasesDspm object itself. - */ - public DefenderFoDatabasesAwsOfferingDatabasesDspm withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderFoDatabasesAwsOfferingDatabasesDspm object itself. - */ - public DefenderFoDatabasesAwsOfferingDatabasesDspm withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingRds.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingRds.java deleted file mode 100644 index 73c9f6277ef5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderFoDatabasesAwsOfferingRds.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The RDS configuration. */ -@Fluent -public final class DefenderFoDatabasesAwsOfferingRds { - /* - * Is RDS protection enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /** Creates an instance of DefenderFoDatabasesAwsOfferingRds class. */ - public DefenderFoDatabasesAwsOfferingRds() { - } - - /** - * Get the enabled property: Is RDS protection enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is RDS protection enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderFoDatabasesAwsOfferingRds object itself. - */ - public DefenderFoDatabasesAwsOfferingRds withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderFoDatabasesAwsOfferingRds object itself. - */ - public DefenderFoDatabasesAwsOfferingRds withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.java deleted file mode 100644 index 9877dfd1b938..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOffering.java +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The Defender for Containers AWS offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("DefenderForContainersAws") -@Fluent -public final class DefenderForContainersAwsOffering extends CloudOffering { - /* - * The kubernetes service connection configuration - */ - @JsonProperty(value = "kubernetesService") - private DefenderForContainersAwsOfferingKubernetesService kubernetesService; - - /* - * The kubernetes to scuba connection configuration - */ - @JsonProperty(value = "kubernetesScubaReader") - private DefenderForContainersAwsOfferingKubernetesScubaReader kubernetesScubaReader; - - /* - * The cloudwatch to kinesis connection configuration - */ - @JsonProperty(value = "cloudWatchToKinesis") - private DefenderForContainersAwsOfferingCloudWatchToKinesis cloudWatchToKinesis; - - /* - * The kinesis to s3 connection configuration - */ - @JsonProperty(value = "kinesisToS3") - private DefenderForContainersAwsOfferingKinesisToS3 kinesisToS3; - - /* - * The container vulnerability assessment configuration - */ - @JsonProperty(value = "containerVulnerabilityAssessment") - private DefenderForContainersAwsOfferingContainerVulnerabilityAssessment containerVulnerabilityAssessment; - - /* - * The container vulnerability assessment task configuration - */ - @JsonProperty(value = "containerVulnerabilityAssessmentTask") - private DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask containerVulnerabilityAssessmentTask; - - /* - * Enable container vulnerability assessment feature - */ - @JsonProperty(value = "enableContainerVulnerabilityAssessment") - private Boolean enableContainerVulnerabilityAssessment; - - /* - * Is audit logs pipeline auto provisioning enabled - */ - @JsonProperty(value = "autoProvisioning") - private Boolean autoProvisioning; - - /* - * The retention time in days of kube audit logs set on the CloudWatch log group - */ - @JsonProperty(value = "kubeAuditRetentionTime") - private Long kubeAuditRetentionTime; - - /* - * The externalId used by the data reader to prevent the confused deputy attack - */ - @JsonProperty(value = "scubaExternalId") - private String scubaExternalId; - - /** Creates an instance of DefenderForContainersAwsOffering class. */ - public DefenderForContainersAwsOffering() { - } - - /** - * Get the kubernetesService property: The kubernetes service connection configuration. - * - * @return the kubernetesService value. - */ - public DefenderForContainersAwsOfferingKubernetesService kubernetesService() { - return this.kubernetesService; - } - - /** - * Set the kubernetesService property: The kubernetes service connection configuration. - * - * @param kubernetesService the kubernetesService value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withKubernetesService( - DefenderForContainersAwsOfferingKubernetesService kubernetesService) { - this.kubernetesService = kubernetesService; - return this; - } - - /** - * Get the kubernetesScubaReader property: The kubernetes to scuba connection configuration. - * - * @return the kubernetesScubaReader value. - */ - public DefenderForContainersAwsOfferingKubernetesScubaReader kubernetesScubaReader() { - return this.kubernetesScubaReader; - } - - /** - * Set the kubernetesScubaReader property: The kubernetes to scuba connection configuration. - * - * @param kubernetesScubaReader the kubernetesScubaReader value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withKubernetesScubaReader( - DefenderForContainersAwsOfferingKubernetesScubaReader kubernetesScubaReader) { - this.kubernetesScubaReader = kubernetesScubaReader; - return this; - } - - /** - * Get the cloudWatchToKinesis property: The cloudwatch to kinesis connection configuration. - * - * @return the cloudWatchToKinesis value. - */ - public DefenderForContainersAwsOfferingCloudWatchToKinesis cloudWatchToKinesis() { - return this.cloudWatchToKinesis; - } - - /** - * Set the cloudWatchToKinesis property: The cloudwatch to kinesis connection configuration. - * - * @param cloudWatchToKinesis the cloudWatchToKinesis value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withCloudWatchToKinesis( - DefenderForContainersAwsOfferingCloudWatchToKinesis cloudWatchToKinesis) { - this.cloudWatchToKinesis = cloudWatchToKinesis; - return this; - } - - /** - * Get the kinesisToS3 property: The kinesis to s3 connection configuration. - * - * @return the kinesisToS3 value. - */ - public DefenderForContainersAwsOfferingKinesisToS3 kinesisToS3() { - return this.kinesisToS3; - } - - /** - * Set the kinesisToS3 property: The kinesis to s3 connection configuration. - * - * @param kinesisToS3 the kinesisToS3 value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withKinesisToS3(DefenderForContainersAwsOfferingKinesisToS3 kinesisToS3) { - this.kinesisToS3 = kinesisToS3; - return this; - } - - /** - * Get the containerVulnerabilityAssessment property: The container vulnerability assessment configuration. - * - * @return the containerVulnerabilityAssessment value. - */ - public DefenderForContainersAwsOfferingContainerVulnerabilityAssessment containerVulnerabilityAssessment() { - return this.containerVulnerabilityAssessment; - } - - /** - * Set the containerVulnerabilityAssessment property: The container vulnerability assessment configuration. - * - * @param containerVulnerabilityAssessment the containerVulnerabilityAssessment value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withContainerVulnerabilityAssessment( - DefenderForContainersAwsOfferingContainerVulnerabilityAssessment containerVulnerabilityAssessment) { - this.containerVulnerabilityAssessment = containerVulnerabilityAssessment; - return this; - } - - /** - * Get the containerVulnerabilityAssessmentTask property: The container vulnerability assessment task configuration. - * - * @return the containerVulnerabilityAssessmentTask value. - */ - public DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask containerVulnerabilityAssessmentTask() { - return this.containerVulnerabilityAssessmentTask; - } - - /** - * Set the containerVulnerabilityAssessmentTask property: The container vulnerability assessment task configuration. - * - * @param containerVulnerabilityAssessmentTask the containerVulnerabilityAssessmentTask value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withContainerVulnerabilityAssessmentTask( - DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask containerVulnerabilityAssessmentTask) { - this.containerVulnerabilityAssessmentTask = containerVulnerabilityAssessmentTask; - return this; - } - - /** - * Get the enableContainerVulnerabilityAssessment property: Enable container vulnerability assessment feature. - * - * @return the enableContainerVulnerabilityAssessment value. - */ - public Boolean enableContainerVulnerabilityAssessment() { - return this.enableContainerVulnerabilityAssessment; - } - - /** - * Set the enableContainerVulnerabilityAssessment property: Enable container vulnerability assessment feature. - * - * @param enableContainerVulnerabilityAssessment the enableContainerVulnerabilityAssessment value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withEnableContainerVulnerabilityAssessment( - Boolean enableContainerVulnerabilityAssessment) { - this.enableContainerVulnerabilityAssessment = enableContainerVulnerabilityAssessment; - return this; - } - - /** - * Get the autoProvisioning property: Is audit logs pipeline auto provisioning enabled. - * - * @return the autoProvisioning value. - */ - public Boolean autoProvisioning() { - return this.autoProvisioning; - } - - /** - * Set the autoProvisioning property: Is audit logs pipeline auto provisioning enabled. - * - * @param autoProvisioning the autoProvisioning value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withAutoProvisioning(Boolean autoProvisioning) { - this.autoProvisioning = autoProvisioning; - return this; - } - - /** - * Get the kubeAuditRetentionTime property: The retention time in days of kube audit logs set on the CloudWatch log - * group. - * - * @return the kubeAuditRetentionTime value. - */ - public Long kubeAuditRetentionTime() { - return this.kubeAuditRetentionTime; - } - - /** - * Set the kubeAuditRetentionTime property: The retention time in days of kube audit logs set on the CloudWatch log - * group. - * - * @param kubeAuditRetentionTime the kubeAuditRetentionTime value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withKubeAuditRetentionTime(Long kubeAuditRetentionTime) { - this.kubeAuditRetentionTime = kubeAuditRetentionTime; - return this; - } - - /** - * Get the scubaExternalId property: The externalId used by the data reader to prevent the confused deputy attack. - * - * @return the scubaExternalId value. - */ - public String scubaExternalId() { - return this.scubaExternalId; - } - - /** - * Set the scubaExternalId property: The externalId used by the data reader to prevent the confused deputy attack. - * - * @param scubaExternalId the scubaExternalId value to set. - * @return the DefenderForContainersAwsOffering object itself. - */ - public DefenderForContainersAwsOffering withScubaExternalId(String scubaExternalId) { - this.scubaExternalId = scubaExternalId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (kubernetesService() != null) { - kubernetesService().validate(); - } - if (kubernetesScubaReader() != null) { - kubernetesScubaReader().validate(); - } - if (cloudWatchToKinesis() != null) { - cloudWatchToKinesis().validate(); - } - if (kinesisToS3() != null) { - kinesisToS3().validate(); - } - if (containerVulnerabilityAssessment() != null) { - containerVulnerabilityAssessment().validate(); - } - if (containerVulnerabilityAssessmentTask() != null) { - containerVulnerabilityAssessmentTask().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingCloudWatchToKinesis.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingCloudWatchToKinesis.java deleted file mode 100644 index d27c5a0afc7b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingCloudWatchToKinesis.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The cloudwatch to kinesis connection configuration. */ -@Fluent -public final class DefenderForContainersAwsOfferingCloudWatchToKinesis { - /* - * The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /** Creates an instance of DefenderForContainersAwsOfferingCloudWatchToKinesis class. */ - public DefenderForContainersAwsOfferingCloudWatchToKinesis() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingCloudWatchToKinesis object itself. - */ - public DefenderForContainersAwsOfferingCloudWatchToKinesis withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.java deleted file mode 100644 index a1348cee8522..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The container vulnerability assessment configuration. */ -@Fluent -public final class DefenderForContainersAwsOfferingContainerVulnerabilityAssessment { - /* - * The cloud role ARN in AWS for this feature - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /** Creates an instance of DefenderForContainersAwsOfferingContainerVulnerabilityAssessment class. */ - public DefenderForContainersAwsOfferingContainerVulnerabilityAssessment() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingContainerVulnerabilityAssessment object itself. - */ - public DefenderForContainersAwsOfferingContainerVulnerabilityAssessment withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.java deleted file mode 100644 index 711d36db19c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The container vulnerability assessment task configuration. */ -@Fluent -public final class DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask { - /* - * The cloud role ARN in AWS for this feature - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /** Creates an instance of DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask class. */ - public DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask object itself. - */ - public DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKinesisToS3.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKinesisToS3.java deleted file mode 100644 index 1dc228f61ddf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKinesisToS3.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The kinesis to s3 connection configuration. */ -@Fluent -public final class DefenderForContainersAwsOfferingKinesisToS3 { - /* - * The cloud role ARN in AWS used by Kinesis to transfer data into S3 - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /** Creates an instance of DefenderForContainersAwsOfferingKinesisToS3 class. */ - public DefenderForContainersAwsOfferingKinesisToS3() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS used by Kinesis to transfer data into S3. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS used by Kinesis to transfer data into S3. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingKinesisToS3 object itself. - */ - public DefenderForContainersAwsOfferingKinesisToS3 withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesScubaReader.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesScubaReader.java deleted file mode 100644 index 13533efccb8f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesScubaReader.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The kubernetes to scuba connection configuration. */ -@Fluent -public final class DefenderForContainersAwsOfferingKubernetesScubaReader { - /* - * The cloud role ARN in AWS for this feature used for reading data - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /** Creates an instance of DefenderForContainersAwsOfferingKubernetesScubaReader class. */ - public DefenderForContainersAwsOfferingKubernetesScubaReader() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature used for reading data. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature used for reading data. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingKubernetesScubaReader object itself. - */ - public DefenderForContainersAwsOfferingKubernetesScubaReader withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesService.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesService.java deleted file mode 100644 index 391c18cb98e0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersAwsOfferingKubernetesService.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The kubernetes service connection configuration. */ -@Fluent -public final class DefenderForContainersAwsOfferingKubernetesService { - /* - * The cloud role ARN in AWS for this feature used for provisioning resources - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /** Creates an instance of DefenderForContainersAwsOfferingKubernetesService class. */ - public DefenderForContainersAwsOfferingKubernetesService() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature used for provisioning resources. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature used for provisioning resources. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForContainersAwsOfferingKubernetesService object itself. - */ - public DefenderForContainersAwsOfferingKubernetesService withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOffering.java deleted file mode 100644 index 4f6379839b46..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOffering.java +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The containers GCP offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("DefenderForContainersGcp") -@Fluent -public final class DefenderForContainersGcpOffering extends CloudOffering { - /* - * The native cloud connection configuration - */ - @JsonProperty(value = "nativeCloudConnection") - private DefenderForContainersGcpOfferingNativeCloudConnection nativeCloudConnection; - - /* - * The native cloud connection configuration - */ - @JsonProperty(value = "dataPipelineNativeCloudConnection") - private DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection dataPipelineNativeCloudConnection; - - /* - * Is audit logs data collection enabled - */ - @JsonProperty(value = "auditLogsAutoProvisioningFlag") - private Boolean auditLogsAutoProvisioningFlag; - - /* - * Is Microsoft Defender for Cloud Kubernetes agent auto provisioning enabled - */ - @JsonProperty(value = "defenderAgentAutoProvisioningFlag") - private Boolean defenderAgentAutoProvisioningFlag; - - /* - * Is Policy Kubernetes agent auto provisioning enabled - */ - @JsonProperty(value = "policyAgentAutoProvisioningFlag") - private Boolean policyAgentAutoProvisioningFlag; - - /** Creates an instance of DefenderForContainersGcpOffering class. */ - public DefenderForContainersGcpOffering() { - } - - /** - * Get the nativeCloudConnection property: The native cloud connection configuration. - * - * @return the nativeCloudConnection value. - */ - public DefenderForContainersGcpOfferingNativeCloudConnection nativeCloudConnection() { - return this.nativeCloudConnection; - } - - /** - * Set the nativeCloudConnection property: The native cloud connection configuration. - * - * @param nativeCloudConnection the nativeCloudConnection value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering withNativeCloudConnection( - DefenderForContainersGcpOfferingNativeCloudConnection nativeCloudConnection) { - this.nativeCloudConnection = nativeCloudConnection; - return this; - } - - /** - * Get the dataPipelineNativeCloudConnection property: The native cloud connection configuration. - * - * @return the dataPipelineNativeCloudConnection value. - */ - public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection dataPipelineNativeCloudConnection() { - return this.dataPipelineNativeCloudConnection; - } - - /** - * Set the dataPipelineNativeCloudConnection property: The native cloud connection configuration. - * - * @param dataPipelineNativeCloudConnection the dataPipelineNativeCloudConnection value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering withDataPipelineNativeCloudConnection( - DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection dataPipelineNativeCloudConnection) { - this.dataPipelineNativeCloudConnection = dataPipelineNativeCloudConnection; - return this; - } - - /** - * Get the auditLogsAutoProvisioningFlag property: Is audit logs data collection enabled. - * - * @return the auditLogsAutoProvisioningFlag value. - */ - public Boolean auditLogsAutoProvisioningFlag() { - return this.auditLogsAutoProvisioningFlag; - } - - /** - * Set the auditLogsAutoProvisioningFlag property: Is audit logs data collection enabled. - * - * @param auditLogsAutoProvisioningFlag the auditLogsAutoProvisioningFlag value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering withAuditLogsAutoProvisioningFlag(Boolean auditLogsAutoProvisioningFlag) { - this.auditLogsAutoProvisioningFlag = auditLogsAutoProvisioningFlag; - return this; - } - - /** - * Get the defenderAgentAutoProvisioningFlag property: Is Microsoft Defender for Cloud Kubernetes agent auto - * provisioning enabled. - * - * @return the defenderAgentAutoProvisioningFlag value. - */ - public Boolean defenderAgentAutoProvisioningFlag() { - return this.defenderAgentAutoProvisioningFlag; - } - - /** - * Set the defenderAgentAutoProvisioningFlag property: Is Microsoft Defender for Cloud Kubernetes agent auto - * provisioning enabled. - * - * @param defenderAgentAutoProvisioningFlag the defenderAgentAutoProvisioningFlag value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering withDefenderAgentAutoProvisioningFlag( - Boolean defenderAgentAutoProvisioningFlag) { - this.defenderAgentAutoProvisioningFlag = defenderAgentAutoProvisioningFlag; - return this; - } - - /** - * Get the policyAgentAutoProvisioningFlag property: Is Policy Kubernetes agent auto provisioning enabled. - * - * @return the policyAgentAutoProvisioningFlag value. - */ - public Boolean policyAgentAutoProvisioningFlag() { - return this.policyAgentAutoProvisioningFlag; - } - - /** - * Set the policyAgentAutoProvisioningFlag property: Is Policy Kubernetes agent auto provisioning enabled. - * - * @param policyAgentAutoProvisioningFlag the policyAgentAutoProvisioningFlag value to set. - * @return the DefenderForContainersGcpOffering object itself. - */ - public DefenderForContainersGcpOffering withPolicyAgentAutoProvisioningFlag( - Boolean policyAgentAutoProvisioningFlag) { - this.policyAgentAutoProvisioningFlag = policyAgentAutoProvisioningFlag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (nativeCloudConnection() != null) { - nativeCloudConnection().validate(); - } - if (dataPipelineNativeCloudConnection() != null) { - dataPipelineNativeCloudConnection().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.java deleted file mode 100644 index 263ea9aa2cc4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The native cloud connection configuration. */ -@Fluent -public final class DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection { - /* - * The data collection service account email address in GCP for this offering - */ - @JsonProperty(value = "serviceAccountEmailAddress") - private String serviceAccountEmailAddress; - - /* - * The data collection GCP workload identity provider id for this offering - */ - @JsonProperty(value = "workloadIdentityProviderId") - private String workloadIdentityProviderId; - - /** Creates an instance of DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection class. */ - public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection() { - } - - /** - * Get the serviceAccountEmailAddress property: The data collection service account email address in GCP for this - * offering. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The data collection service account email address in GCP for this - * offering. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection object itself. - */ - public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection withServiceAccountEmailAddress( - String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The data collection GCP workload identity provider id for this - * offering. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The data collection GCP workload identity provider id for this - * offering. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection object itself. - */ - public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection withWorkloadIdentityProviderId( - String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingNativeCloudConnection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingNativeCloudConnection.java deleted file mode 100644 index bc0088a59a9d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForContainersGcpOfferingNativeCloudConnection.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The native cloud connection configuration. */ -@Fluent -public final class DefenderForContainersGcpOfferingNativeCloudConnection { - /* - * The service account email address in GCP for this offering - */ - @JsonProperty(value = "serviceAccountEmailAddress") - private String serviceAccountEmailAddress; - - /* - * The GCP workload identity provider id for this offering - */ - @JsonProperty(value = "workloadIdentityProviderId") - private String workloadIdentityProviderId; - - /** Creates an instance of DefenderForContainersGcpOfferingNativeCloudConnection class. */ - public DefenderForContainersGcpOfferingNativeCloudConnection() { - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForContainersGcpOfferingNativeCloudConnection object itself. - */ - public DefenderForContainersGcpOfferingNativeCloudConnection withServiceAccountEmailAddress( - String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The GCP workload identity provider id for this offering. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The GCP workload identity provider id for this offering. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForContainersGcpOfferingNativeCloudConnection object itself. - */ - public DefenderForContainersGcpOfferingNativeCloudConnection withWorkloadIdentityProviderId( - String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOffering.java deleted file mode 100644 index 0dc9a2ad7509..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOffering.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The Defender for Databases GCP offering configurations. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("DefenderForDatabasesGcp") -@Fluent -public final class DefenderForDatabasesGcpOffering extends CloudOffering { - /* - * The ARC autoprovisioning configuration - */ - @JsonProperty(value = "arcAutoProvisioning") - private DefenderForDatabasesGcpOfferingArcAutoProvisioning arcAutoProvisioning; - - /* - * The native cloud connection configuration - */ - @JsonProperty(value = "defenderForDatabasesArcAutoProvisioning") - private DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - defenderForDatabasesArcAutoProvisioning; - - /** Creates an instance of DefenderForDatabasesGcpOffering class. */ - public DefenderForDatabasesGcpOffering() { - } - - /** - * Get the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @return the arcAutoProvisioning value. - */ - public DefenderForDatabasesGcpOfferingArcAutoProvisioning arcAutoProvisioning() { - return this.arcAutoProvisioning; - } - - /** - * Set the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @param arcAutoProvisioning the arcAutoProvisioning value to set. - * @return the DefenderForDatabasesGcpOffering object itself. - */ - public DefenderForDatabasesGcpOffering withArcAutoProvisioning( - DefenderForDatabasesGcpOfferingArcAutoProvisioning arcAutoProvisioning) { - this.arcAutoProvisioning = arcAutoProvisioning; - return this; - } - - /** - * Get the defenderForDatabasesArcAutoProvisioning property: The native cloud connection configuration. - * - * @return the defenderForDatabasesArcAutoProvisioning value. - */ - public DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - defenderForDatabasesArcAutoProvisioning() { - return this.defenderForDatabasesArcAutoProvisioning; - } - - /** - * Set the defenderForDatabasesArcAutoProvisioning property: The native cloud connection configuration. - * - * @param defenderForDatabasesArcAutoProvisioning the defenderForDatabasesArcAutoProvisioning value to set. - * @return the DefenderForDatabasesGcpOffering object itself. - */ - public DefenderForDatabasesGcpOffering withDefenderForDatabasesArcAutoProvisioning( - DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - defenderForDatabasesArcAutoProvisioning) { - this.defenderForDatabasesArcAutoProvisioning = defenderForDatabasesArcAutoProvisioning; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (arcAutoProvisioning() != null) { - arcAutoProvisioning().validate(); - } - if (defenderForDatabasesArcAutoProvisioning() != null) { - defenderForDatabasesArcAutoProvisioning().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.java deleted file mode 100644 index a1af1380b1b1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ARC autoprovisioning configuration. */ -@Fluent -public final class DefenderForDatabasesGcpOfferingArcAutoProvisioning { - /* - * Is arc auto provisioning enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * Configuration for servers Arc auto provisioning - */ - @JsonProperty(value = "configuration") - private DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration configuration; - - /** Creates an instance of DefenderForDatabasesGcpOfferingArcAutoProvisioning class. */ - public DefenderForDatabasesGcpOfferingArcAutoProvisioning() { - } - - /** - * Get the enabled property: Is arc auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is arc auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForDatabasesGcpOfferingArcAutoProvisioning object itself. - */ - public DefenderForDatabasesGcpOfferingArcAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: Configuration for servers Arc auto provisioning. - * - * @return the configuration value. - */ - public DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: Configuration for servers Arc auto provisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForDatabasesGcpOfferingArcAutoProvisioning object itself. - */ - public DefenderForDatabasesGcpOfferingArcAutoProvisioning withConfiguration( - DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration.java deleted file mode 100644 index e44b9dc662fe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configuration for servers Arc auto provisioning. */ -@Fluent -public final class DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration { - /* - * Optional http proxy endpoint to use for the Arc agent - */ - @JsonProperty(value = "proxy") - private String proxy; - - /* - * Optional Arc private link scope resource id to link the Arc agent - */ - @JsonProperty(value = "privateLinkScope") - private String privateLinkScope; - - /** Creates an instance of DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration class. */ - public DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration() { - } - - /** - * Get the proxy property: Optional http proxy endpoint to use for the Arc agent. - * - * @return the proxy value. - */ - public String proxy() { - return this.proxy; - } - - /** - * Set the proxy property: Optional http proxy endpoint to use for the Arc agent. - * - * @param proxy the proxy value to set. - * @return the DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration object itself. - */ - public DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration withProxy(String proxy) { - this.proxy = proxy; - return this; - } - - /** - * Get the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * - * @return the privateLinkScope value. - */ - public String privateLinkScope() { - return this.privateLinkScope; - } - - /** - * Set the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * - * @param privateLinkScope the privateLinkScope value to set. - * @return the DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration object itself. - */ - public DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration withPrivateLinkScope( - String privateLinkScope) { - this.privateLinkScope = privateLinkScope; - 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/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.java deleted file mode 100644 index 552d3f4dd765..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The native cloud connection configuration. */ -@Fluent -public final class DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning { - /* - * The service account email address in GCP for this offering - */ - @JsonProperty(value = "serviceAccountEmailAddress") - private String serviceAccountEmailAddress; - - /* - * The GCP workload identity provider id for this offering - */ - @JsonProperty(value = "workloadIdentityProviderId") - private String workloadIdentityProviderId; - - /** Creates an instance of DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning class. */ - public DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning() { - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this offering. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning object itself. - */ - public DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning withServiceAccountEmailAddress( - String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The GCP workload identity provider id for this offering. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The GCP workload identity provider id for this offering. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning object itself. - */ - public DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning withWorkloadIdentityProviderId( - String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsAzureDevOpsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsAzureDevOpsOffering.java deleted file mode 100644 index 841f54763380..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsAzureDevOpsOffering.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The Defender for DevOps for Azure DevOps offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("DefenderForDevOpsAzureDevOps") -@Immutable -public final class DefenderForDevOpsAzureDevOpsOffering extends CloudOffering { - /** Creates an instance of DefenderForDevOpsAzureDevOpsOffering class. */ - public DefenderForDevOpsAzureDevOpsOffering() { - } - - /** - * 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/DefenderForDevOpsGitLabOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsGitLabOffering.java deleted file mode 100644 index e194b6df990b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsGitLabOffering.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The Defender for DevOps for Gitlab offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("DefenderForDevOpsGitLab") -@Immutable -public final class DefenderForDevOpsGitLabOffering extends CloudOffering { - /** Creates an instance of DefenderForDevOpsGitLabOffering class. */ - public DefenderForDevOpsGitLabOffering() { - } - - /** - * 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/DefenderForDevOpsGithubOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsGithubOffering.java deleted file mode 100644 index 22df7340c130..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForDevOpsGithubOffering.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The Defender for DevOps for Github offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("DefenderForDevOpsGithub") -@Immutable -public final class DefenderForDevOpsGithubOffering extends CloudOffering { - /** Creates an instance of DefenderForDevOpsGithubOffering class. */ - public DefenderForDevOpsGithubOffering() { - } - - /** - * 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/DefenderForServersAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOffering.java deleted file mode 100644 index e261069b5d20..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOffering.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.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The Defender for Servers AWS offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("DefenderForServersAws") -@Fluent -public final class DefenderForServersAwsOffering extends CloudOffering { - /* - * The Defender for servers connection configuration - */ - @JsonProperty(value = "defenderForServers") - private DefenderForServersAwsOfferingDefenderForServers defenderForServers; - - /* - * The ARC autoprovisioning configuration - */ - @JsonProperty(value = "arcAutoProvisioning") - private DefenderForServersAwsOfferingArcAutoProvisioning arcAutoProvisioning; - - /* - * The Vulnerability Assessment autoprovisioning configuration - */ - @JsonProperty(value = "vaAutoProvisioning") - private DefenderForServersAwsOfferingVaAutoProvisioning vaAutoProvisioning; - - /* - * The Microsoft Defender for Endpoint autoprovisioning configuration - */ - @JsonProperty(value = "mdeAutoProvisioning") - private DefenderForServersAwsOfferingMdeAutoProvisioning mdeAutoProvisioning; - - /* - * configuration for the servers offering subPlan - */ - @JsonProperty(value = "subPlan") - private DefenderForServersAwsOfferingSubPlan subPlan; - - /* - * The Microsoft Defender for Server VM scanning configuration - */ - @JsonProperty(value = "vmScanners") - private DefenderForServersAwsOfferingVmScanners vmScanners; - - /** Creates an instance of DefenderForServersAwsOffering class. */ - public DefenderForServersAwsOffering() { - } - - /** - * Get the defenderForServers property: The Defender for servers connection configuration. - * - * @return the defenderForServers value. - */ - public DefenderForServersAwsOfferingDefenderForServers defenderForServers() { - return this.defenderForServers; - } - - /** - * Set the defenderForServers property: The Defender for servers connection configuration. - * - * @param defenderForServers the defenderForServers value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering withDefenderForServers( - DefenderForServersAwsOfferingDefenderForServers defenderForServers) { - this.defenderForServers = defenderForServers; - return this; - } - - /** - * Get the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @return the arcAutoProvisioning value. - */ - public DefenderForServersAwsOfferingArcAutoProvisioning arcAutoProvisioning() { - return this.arcAutoProvisioning; - } - - /** - * Set the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @param arcAutoProvisioning the arcAutoProvisioning value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering withArcAutoProvisioning( - DefenderForServersAwsOfferingArcAutoProvisioning arcAutoProvisioning) { - this.arcAutoProvisioning = arcAutoProvisioning; - return this; - } - - /** - * Get the vaAutoProvisioning property: The Vulnerability Assessment autoprovisioning configuration. - * - * @return the vaAutoProvisioning value. - */ - public DefenderForServersAwsOfferingVaAutoProvisioning vaAutoProvisioning() { - return this.vaAutoProvisioning; - } - - /** - * Set the vaAutoProvisioning property: The Vulnerability Assessment autoprovisioning configuration. - * - * @param vaAutoProvisioning the vaAutoProvisioning value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering withVaAutoProvisioning( - DefenderForServersAwsOfferingVaAutoProvisioning vaAutoProvisioning) { - this.vaAutoProvisioning = vaAutoProvisioning; - return this; - } - - /** - * Get the mdeAutoProvisioning property: The Microsoft Defender for Endpoint autoprovisioning configuration. - * - * @return the mdeAutoProvisioning value. - */ - public DefenderForServersAwsOfferingMdeAutoProvisioning mdeAutoProvisioning() { - return this.mdeAutoProvisioning; - } - - /** - * Set the mdeAutoProvisioning property: The Microsoft Defender for Endpoint autoprovisioning configuration. - * - * @param mdeAutoProvisioning the mdeAutoProvisioning value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering withMdeAutoProvisioning( - DefenderForServersAwsOfferingMdeAutoProvisioning mdeAutoProvisioning) { - this.mdeAutoProvisioning = mdeAutoProvisioning; - return this; - } - - /** - * Get the subPlan property: configuration for the servers offering subPlan. - * - * @return the subPlan value. - */ - public DefenderForServersAwsOfferingSubPlan subPlan() { - return this.subPlan; - } - - /** - * Set the subPlan property: configuration for the servers offering subPlan. - * - * @param subPlan the subPlan value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering withSubPlan(DefenderForServersAwsOfferingSubPlan subPlan) { - this.subPlan = subPlan; - return this; - } - - /** - * Get the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderForServersAwsOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderForServersAwsOffering object itself. - */ - public DefenderForServersAwsOffering withVmScanners(DefenderForServersAwsOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (defenderForServers() != null) { - defenderForServers().validate(); - } - if (arcAutoProvisioning() != null) { - arcAutoProvisioning().validate(); - } - if (vaAutoProvisioning() != null) { - vaAutoProvisioning().validate(); - } - if (mdeAutoProvisioning() != null) { - mdeAutoProvisioning().validate(); - } - if (subPlan() != null) { - subPlan().validate(); - } - if (vmScanners() != null) { - vmScanners().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioning.java deleted file mode 100644 index 0d1ff8f1543e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioning.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ARC autoprovisioning configuration. */ -@Fluent -public final class DefenderForServersAwsOfferingArcAutoProvisioning { - /* - * Is arc auto provisioning enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * The cloud role ARN in AWS for this feature - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /* - * Configuration for servers Arc auto provisioning - */ - @JsonProperty(value = "configuration") - private DefenderForServersAwsOfferingArcAutoProvisioningConfiguration configuration; - - /** Creates an instance of DefenderForServersAwsOfferingArcAutoProvisioning class. */ - public DefenderForServersAwsOfferingArcAutoProvisioning() { - } - - /** - * Get the enabled property: Is arc auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is arc auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersAwsOfferingArcAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingArcAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForServersAwsOfferingArcAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingArcAutoProvisioning withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Get the configuration property: Configuration for servers Arc auto provisioning. - * - * @return the configuration value. - */ - public DefenderForServersAwsOfferingArcAutoProvisioningConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: Configuration for servers Arc auto provisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersAwsOfferingArcAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingArcAutoProvisioning withConfiguration( - DefenderForServersAwsOfferingArcAutoProvisioningConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioningConfiguration.java deleted file mode 100644 index 327bf081344c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingArcAutoProvisioningConfiguration.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configuration for servers Arc auto provisioning. */ -@Fluent -public final class DefenderForServersAwsOfferingArcAutoProvisioningConfiguration { - /* - * Optional HTTP proxy endpoint to use for the Arc agent - */ - @JsonProperty(value = "proxy") - private String proxy; - - /* - * Optional Arc private link scope resource id to link the Arc agent - */ - @JsonProperty(value = "privateLinkScope") - private String privateLinkScope; - - /** Creates an instance of DefenderForServersAwsOfferingArcAutoProvisioningConfiguration class. */ - public DefenderForServersAwsOfferingArcAutoProvisioningConfiguration() { - } - - /** - * Get the proxy property: Optional HTTP proxy endpoint to use for the Arc agent. - * - * @return the proxy value. - */ - public String proxy() { - return this.proxy; - } - - /** - * Set the proxy property: Optional HTTP proxy endpoint to use for the Arc agent. - * - * @param proxy the proxy value to set. - * @return the DefenderForServersAwsOfferingArcAutoProvisioningConfiguration object itself. - */ - public DefenderForServersAwsOfferingArcAutoProvisioningConfiguration withProxy(String proxy) { - this.proxy = proxy; - return this; - } - - /** - * Get the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * - * @return the privateLinkScope value. - */ - public String privateLinkScope() { - return this.privateLinkScope; - } - - /** - * Set the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * - * @param privateLinkScope the privateLinkScope value to set. - * @return the DefenderForServersAwsOfferingArcAutoProvisioningConfiguration object itself. - */ - public DefenderForServersAwsOfferingArcAutoProvisioningConfiguration withPrivateLinkScope(String privateLinkScope) { - this.privateLinkScope = privateLinkScope; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingDefenderForServers.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingDefenderForServers.java deleted file mode 100644 index aa05784fa66b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingDefenderForServers.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Defender for servers connection configuration. */ -@Fluent -public final class DefenderForServersAwsOfferingDefenderForServers { - /* - * The cloud role ARN in AWS for this feature - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /** Creates an instance of DefenderForServersAwsOfferingDefenderForServers class. */ - public DefenderForServersAwsOfferingDefenderForServers() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForServersAwsOfferingDefenderForServers object itself. - */ - public DefenderForServersAwsOfferingDefenderForServers withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingMdeAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingMdeAutoProvisioning.java deleted file mode 100644 index 0bef82c51ccb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingMdeAutoProvisioning.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Microsoft Defender for Endpoint autoprovisioning configuration. */ -@Fluent -public final class DefenderForServersAwsOfferingMdeAutoProvisioning { - /* - * Is Microsoft Defender for Endpoint auto provisioning enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * configuration for Microsoft Defender for Endpoint autoprovisioning - */ - @JsonProperty(value = "configuration") - private Object configuration; - - /** Creates an instance of DefenderForServersAwsOfferingMdeAutoProvisioning class. */ - public DefenderForServersAwsOfferingMdeAutoProvisioning() { - } - - /** - * Get the enabled property: Is Microsoft Defender for Endpoint auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender for Endpoint auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersAwsOfferingMdeAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingMdeAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * - * @return the configuration value. - */ - public Object configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersAwsOfferingMdeAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingMdeAutoProvisioning withConfiguration(Object configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingSubPlan.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingSubPlan.java deleted file mode 100644 index b9f80ce25dca..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingSubPlan.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** configuration for the servers offering subPlan. */ -@Fluent -public final class DefenderForServersAwsOfferingSubPlan { - /* - * The available sub plans - */ - @JsonProperty(value = "type") - private SubPlan type; - - /** Creates an instance of DefenderForServersAwsOfferingSubPlan class. */ - public DefenderForServersAwsOfferingSubPlan() { - } - - /** - * Get the type property: The available sub plans. - * - * @return the type value. - */ - public SubPlan type() { - return this.type; - } - - /** - * Set the type property: The available sub plans. - * - * @param type the type value to set. - * @return the DefenderForServersAwsOfferingSubPlan object itself. - */ - public DefenderForServersAwsOfferingSubPlan withType(SubPlan type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioning.java deleted file mode 100644 index ec83a52f46eb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioning.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Vulnerability Assessment autoprovisioning configuration. */ -@Fluent -public final class DefenderForServersAwsOfferingVaAutoProvisioning { - /* - * Is Vulnerability Assessment auto provisioning enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * configuration for Vulnerability Assessment autoprovisioning - */ - @JsonProperty(value = "configuration") - private DefenderForServersAwsOfferingVaAutoProvisioningConfiguration configuration; - - /** Creates an instance of DefenderForServersAwsOfferingVaAutoProvisioning class. */ - public DefenderForServersAwsOfferingVaAutoProvisioning() { - } - - /** - * Get the enabled property: Is Vulnerability Assessment auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Vulnerability Assessment auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersAwsOfferingVaAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingVaAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Vulnerability Assessment autoprovisioning. - * - * @return the configuration value. - */ - public DefenderForServersAwsOfferingVaAutoProvisioningConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Vulnerability Assessment autoprovisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersAwsOfferingVaAutoProvisioning object itself. - */ - public DefenderForServersAwsOfferingVaAutoProvisioning withConfiguration( - DefenderForServersAwsOfferingVaAutoProvisioningConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.java deleted file mode 100644 index 1afa0a454e4c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** configuration for Vulnerability Assessment autoprovisioning. */ -@Fluent -public final class DefenderForServersAwsOfferingVaAutoProvisioningConfiguration { - /* - * The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys' - */ - @JsonProperty(value = "type") - private Type type; - - /** Creates an instance of DefenderForServersAwsOfferingVaAutoProvisioningConfiguration class. */ - public DefenderForServersAwsOfferingVaAutoProvisioningConfiguration() { - } - - /** - * Get the type property: The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - * - * @return the type value. - */ - public Type type() { - return this.type; - } - - /** - * Set the type property: The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - * - * @param type the type value to set. - * @return the DefenderForServersAwsOfferingVaAutoProvisioningConfiguration object itself. - */ - public DefenderForServersAwsOfferingVaAutoProvisioningConfiguration withType(Type type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScanners.java deleted file mode 100644 index bc3612691f4e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScanners.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Microsoft Defender for Server VM scanning configuration. */ -@Fluent -public final class DefenderForServersAwsOfferingVmScanners { - /* - * Is Microsoft Defender for Server VM scanning enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * configuration for Microsoft Defender for Server VM scanning - */ - @JsonProperty(value = "configuration") - private DefenderForServersAwsOfferingVmScannersConfiguration configuration; - - /** Creates an instance of DefenderForServersAwsOfferingVmScanners class. */ - public DefenderForServersAwsOfferingVmScanners() { - } - - /** - * Get the enabled property: Is Microsoft Defender for Server VM scanning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender for Server VM scanning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersAwsOfferingVmScanners object itself. - */ - public DefenderForServersAwsOfferingVmScanners withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Microsoft Defender for Server VM scanning. - * - * @return the configuration value. - */ - public DefenderForServersAwsOfferingVmScannersConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Microsoft Defender for Server VM scanning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersAwsOfferingVmScanners object itself. - */ - public DefenderForServersAwsOfferingVmScanners withConfiguration( - DefenderForServersAwsOfferingVmScannersConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScannersConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScannersConfiguration.java deleted file mode 100644 index 0d8b78178250..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersAwsOfferingVmScannersConfiguration.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** configuration for Microsoft Defender for Server VM scanning. */ -@Fluent -public final class DefenderForServersAwsOfferingVmScannersConfiguration { - /* - * The cloud role ARN in AWS for this feature - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /* - * The scanning mode for the VM scan. - */ - @JsonProperty(value = "scanningMode") - private ScanningMode scanningMode; - - /* - * VM tags that indicates that VM should not be scanned - */ - @JsonProperty(value = "exclusionTags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map exclusionTags; - - /** Creates an instance of DefenderForServersAwsOfferingVmScannersConfiguration class. */ - public DefenderForServersAwsOfferingVmScannersConfiguration() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the DefenderForServersAwsOfferingVmScannersConfiguration object itself. - */ - public DefenderForServersAwsOfferingVmScannersConfiguration withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Get the scanningMode property: The scanning mode for the VM scan. - * - * @return the scanningMode value. - */ - public ScanningMode scanningMode() { - return this.scanningMode; - } - - /** - * Set the scanningMode property: The scanning mode for the VM scan. - * - * @param scanningMode the scanningMode value to set. - * @return the DefenderForServersAwsOfferingVmScannersConfiguration object itself. - */ - public DefenderForServersAwsOfferingVmScannersConfiguration withScanningMode(ScanningMode scanningMode) { - this.scanningMode = scanningMode; - return this; - } - - /** - * Get the exclusionTags property: VM tags that indicates that VM should not be scanned. - * - * @return the exclusionTags value. - */ - public Map exclusionTags() { - return this.exclusionTags; - } - - /** - * Set the exclusionTags property: VM tags that indicates that VM should not be scanned. - * - * @param exclusionTags the exclusionTags value to set. - * @return the DefenderForServersAwsOfferingVmScannersConfiguration object itself. - */ - public DefenderForServersAwsOfferingVmScannersConfiguration withExclusionTags(Map exclusionTags) { - this.exclusionTags = exclusionTags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOffering.java deleted file mode 100644 index 336fa465a9c9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOffering.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.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The Defender for Servers GCP offering configurations. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("DefenderForServersGcp") -@Fluent -public final class DefenderForServersGcpOffering extends CloudOffering { - /* - * The Defender for servers connection configuration - */ - @JsonProperty(value = "defenderForServers") - private DefenderForServersGcpOfferingDefenderForServers defenderForServers; - - /* - * The ARC autoprovisioning configuration - */ - @JsonProperty(value = "arcAutoProvisioning") - private DefenderForServersGcpOfferingArcAutoProvisioning arcAutoProvisioning; - - /* - * The Vulnerability Assessment autoprovisioning configuration - */ - @JsonProperty(value = "vaAutoProvisioning") - private DefenderForServersGcpOfferingVaAutoProvisioning vaAutoProvisioning; - - /* - * The Microsoft Defender for Endpoint autoprovisioning configuration - */ - @JsonProperty(value = "mdeAutoProvisioning") - private DefenderForServersGcpOfferingMdeAutoProvisioning mdeAutoProvisioning; - - /* - * configuration for the servers offering subPlan - */ - @JsonProperty(value = "subPlan") - private DefenderForServersGcpOfferingSubPlan subPlan; - - /* - * The Microsoft Defender for Server VM scanning configuration - */ - @JsonProperty(value = "vmScanners") - private DefenderForServersGcpOfferingVmScanners vmScanners; - - /** Creates an instance of DefenderForServersGcpOffering class. */ - public DefenderForServersGcpOffering() { - } - - /** - * Get the defenderForServers property: The Defender for servers connection configuration. - * - * @return the defenderForServers value. - */ - public DefenderForServersGcpOfferingDefenderForServers defenderForServers() { - return this.defenderForServers; - } - - /** - * Set the defenderForServers property: The Defender for servers connection configuration. - * - * @param defenderForServers the defenderForServers value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering withDefenderForServers( - DefenderForServersGcpOfferingDefenderForServers defenderForServers) { - this.defenderForServers = defenderForServers; - return this; - } - - /** - * Get the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @return the arcAutoProvisioning value. - */ - public DefenderForServersGcpOfferingArcAutoProvisioning arcAutoProvisioning() { - return this.arcAutoProvisioning; - } - - /** - * Set the arcAutoProvisioning property: The ARC autoprovisioning configuration. - * - * @param arcAutoProvisioning the arcAutoProvisioning value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering withArcAutoProvisioning( - DefenderForServersGcpOfferingArcAutoProvisioning arcAutoProvisioning) { - this.arcAutoProvisioning = arcAutoProvisioning; - return this; - } - - /** - * Get the vaAutoProvisioning property: The Vulnerability Assessment autoprovisioning configuration. - * - * @return the vaAutoProvisioning value. - */ - public DefenderForServersGcpOfferingVaAutoProvisioning vaAutoProvisioning() { - return this.vaAutoProvisioning; - } - - /** - * Set the vaAutoProvisioning property: The Vulnerability Assessment autoprovisioning configuration. - * - * @param vaAutoProvisioning the vaAutoProvisioning value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering withVaAutoProvisioning( - DefenderForServersGcpOfferingVaAutoProvisioning vaAutoProvisioning) { - this.vaAutoProvisioning = vaAutoProvisioning; - return this; - } - - /** - * Get the mdeAutoProvisioning property: The Microsoft Defender for Endpoint autoprovisioning configuration. - * - * @return the mdeAutoProvisioning value. - */ - public DefenderForServersGcpOfferingMdeAutoProvisioning mdeAutoProvisioning() { - return this.mdeAutoProvisioning; - } - - /** - * Set the mdeAutoProvisioning property: The Microsoft Defender for Endpoint autoprovisioning configuration. - * - * @param mdeAutoProvisioning the mdeAutoProvisioning value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering withMdeAutoProvisioning( - DefenderForServersGcpOfferingMdeAutoProvisioning mdeAutoProvisioning) { - this.mdeAutoProvisioning = mdeAutoProvisioning; - return this; - } - - /** - * Get the subPlan property: configuration for the servers offering subPlan. - * - * @return the subPlan value. - */ - public DefenderForServersGcpOfferingSubPlan subPlan() { - return this.subPlan; - } - - /** - * Set the subPlan property: configuration for the servers offering subPlan. - * - * @param subPlan the subPlan value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering withSubPlan(DefenderForServersGcpOfferingSubPlan subPlan) { - this.subPlan = subPlan; - return this; - } - - /** - * Get the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * - * @return the vmScanners value. - */ - public DefenderForServersGcpOfferingVmScanners vmScanners() { - return this.vmScanners; - } - - /** - * Set the vmScanners property: The Microsoft Defender for Server VM scanning configuration. - * - * @param vmScanners the vmScanners value to set. - * @return the DefenderForServersGcpOffering object itself. - */ - public DefenderForServersGcpOffering withVmScanners(DefenderForServersGcpOfferingVmScanners vmScanners) { - this.vmScanners = vmScanners; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (defenderForServers() != null) { - defenderForServers().validate(); - } - if (arcAutoProvisioning() != null) { - arcAutoProvisioning().validate(); - } - if (vaAutoProvisioning() != null) { - vaAutoProvisioning().validate(); - } - if (mdeAutoProvisioning() != null) { - mdeAutoProvisioning().validate(); - } - if (subPlan() != null) { - subPlan().validate(); - } - if (vmScanners() != null) { - vmScanners().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioning.java deleted file mode 100644 index 62a8766f49c5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioning.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The ARC autoprovisioning configuration. */ -@Fluent -public final class DefenderForServersGcpOfferingArcAutoProvisioning { - /* - * Is arc auto provisioning enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * Configuration for servers Arc auto provisioning - */ - @JsonProperty(value = "configuration") - private DefenderForServersGcpOfferingArcAutoProvisioningConfiguration configuration; - - /** Creates an instance of DefenderForServersGcpOfferingArcAutoProvisioning class. */ - public DefenderForServersGcpOfferingArcAutoProvisioning() { - } - - /** - * Get the enabled property: Is arc auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is arc auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersGcpOfferingArcAutoProvisioning object itself. - */ - public DefenderForServersGcpOfferingArcAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: Configuration for servers Arc auto provisioning. - * - * @return the configuration value. - */ - public DefenderForServersGcpOfferingArcAutoProvisioningConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: Configuration for servers Arc auto provisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersGcpOfferingArcAutoProvisioning object itself. - */ - public DefenderForServersGcpOfferingArcAutoProvisioning withConfiguration( - DefenderForServersGcpOfferingArcAutoProvisioningConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioningConfiguration.java deleted file mode 100644 index ff5655dfab0a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingArcAutoProvisioningConfiguration.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Configuration for servers Arc auto provisioning. */ -@Fluent -public final class DefenderForServersGcpOfferingArcAutoProvisioningConfiguration { - /* - * Optional HTTP proxy endpoint to use for the Arc agent - */ - @JsonProperty(value = "proxy") - private String proxy; - - /* - * Optional Arc private link scope resource id to link the Arc agent - */ - @JsonProperty(value = "privateLinkScope") - private String privateLinkScope; - - /** Creates an instance of DefenderForServersGcpOfferingArcAutoProvisioningConfiguration class. */ - public DefenderForServersGcpOfferingArcAutoProvisioningConfiguration() { - } - - /** - * Get the proxy property: Optional HTTP proxy endpoint to use for the Arc agent. - * - * @return the proxy value. - */ - public String proxy() { - return this.proxy; - } - - /** - * Set the proxy property: Optional HTTP proxy endpoint to use for the Arc agent. - * - * @param proxy the proxy value to set. - * @return the DefenderForServersGcpOfferingArcAutoProvisioningConfiguration object itself. - */ - public DefenderForServersGcpOfferingArcAutoProvisioningConfiguration withProxy(String proxy) { - this.proxy = proxy; - return this; - } - - /** - * Get the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * - * @return the privateLinkScope value. - */ - public String privateLinkScope() { - return this.privateLinkScope; - } - - /** - * Set the privateLinkScope property: Optional Arc private link scope resource id to link the Arc agent. - * - * @param privateLinkScope the privateLinkScope value to set. - * @return the DefenderForServersGcpOfferingArcAutoProvisioningConfiguration object itself. - */ - public DefenderForServersGcpOfferingArcAutoProvisioningConfiguration withPrivateLinkScope(String privateLinkScope) { - this.privateLinkScope = privateLinkScope; - 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/DefenderForServersGcpOfferingDefenderForServers.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingDefenderForServers.java deleted file mode 100644 index 1533e9171d67..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingDefenderForServers.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Defender for servers connection configuration. */ -@Fluent -public final class DefenderForServersGcpOfferingDefenderForServers { - /* - * The workload identity provider id in GCP for this feature - */ - @JsonProperty(value = "workloadIdentityProviderId") - private String workloadIdentityProviderId; - - /* - * The service account email address in GCP for this feature - */ - @JsonProperty(value = "serviceAccountEmailAddress") - private String serviceAccountEmailAddress; - - /** Creates an instance of DefenderForServersGcpOfferingDefenderForServers class. */ - public DefenderForServersGcpOfferingDefenderForServers() { - } - - /** - * Get the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The workload identity provider id in GCP for this feature. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the DefenderForServersGcpOfferingDefenderForServers object itself. - */ - public DefenderForServersGcpOfferingDefenderForServers withWorkloadIdentityProviderId( - String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address in GCP for this feature. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the DefenderForServersGcpOfferingDefenderForServers object itself. - */ - public DefenderForServersGcpOfferingDefenderForServers withServiceAccountEmailAddress( - String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingMdeAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingMdeAutoProvisioning.java deleted file mode 100644 index 51bb24407416..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingMdeAutoProvisioning.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Microsoft Defender for Endpoint autoprovisioning configuration. */ -@Fluent -public final class DefenderForServersGcpOfferingMdeAutoProvisioning { - /* - * Is Microsoft Defender for Endpoint auto provisioning enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * configuration for Microsoft Defender for Endpoint autoprovisioning - */ - @JsonProperty(value = "configuration") - private Object configuration; - - /** Creates an instance of DefenderForServersGcpOfferingMdeAutoProvisioning class. */ - public DefenderForServersGcpOfferingMdeAutoProvisioning() { - } - - /** - * Get the enabled property: Is Microsoft Defender for Endpoint auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender for Endpoint auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersGcpOfferingMdeAutoProvisioning object itself. - */ - public DefenderForServersGcpOfferingMdeAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * - * @return the configuration value. - */ - public Object configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Microsoft Defender for Endpoint autoprovisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersGcpOfferingMdeAutoProvisioning object itself. - */ - public DefenderForServersGcpOfferingMdeAutoProvisioning withConfiguration(Object configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingSubPlan.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingSubPlan.java deleted file mode 100644 index 22ba934ffb52..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingSubPlan.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** configuration for the servers offering subPlan. */ -@Fluent -public final class DefenderForServersGcpOfferingSubPlan { - /* - * The available sub plans - */ - @JsonProperty(value = "type") - private SubPlan type; - - /** Creates an instance of DefenderForServersGcpOfferingSubPlan class. */ - public DefenderForServersGcpOfferingSubPlan() { - } - - /** - * Get the type property: The available sub plans. - * - * @return the type value. - */ - public SubPlan type() { - return this.type; - } - - /** - * Set the type property: The available sub plans. - * - * @param type the type value to set. - * @return the DefenderForServersGcpOfferingSubPlan object itself. - */ - public DefenderForServersGcpOfferingSubPlan withType(SubPlan type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioning.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioning.java deleted file mode 100644 index f6b41f749fd8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioning.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Vulnerability Assessment autoprovisioning configuration. */ -@Fluent -public final class DefenderForServersGcpOfferingVaAutoProvisioning { - /* - * Is Vulnerability Assessment auto provisioning enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * configuration for Vulnerability Assessment autoprovisioning - */ - @JsonProperty(value = "configuration") - private DefenderForServersGcpOfferingVaAutoProvisioningConfiguration configuration; - - /** Creates an instance of DefenderForServersGcpOfferingVaAutoProvisioning class. */ - public DefenderForServersGcpOfferingVaAutoProvisioning() { - } - - /** - * Get the enabled property: Is Vulnerability Assessment auto provisioning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Vulnerability Assessment auto provisioning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersGcpOfferingVaAutoProvisioning object itself. - */ - public DefenderForServersGcpOfferingVaAutoProvisioning withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Vulnerability Assessment autoprovisioning. - * - * @return the configuration value. - */ - public DefenderForServersGcpOfferingVaAutoProvisioningConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Vulnerability Assessment autoprovisioning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersGcpOfferingVaAutoProvisioning object itself. - */ - public DefenderForServersGcpOfferingVaAutoProvisioning withConfiguration( - DefenderForServersGcpOfferingVaAutoProvisioningConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.java deleted file mode 100644 index 4c51b2de7748..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** configuration for Vulnerability Assessment autoprovisioning. */ -@Fluent -public final class DefenderForServersGcpOfferingVaAutoProvisioningConfiguration { - /* - * The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys' - */ - @JsonProperty(value = "type") - private Type type; - - /** Creates an instance of DefenderForServersGcpOfferingVaAutoProvisioningConfiguration class. */ - public DefenderForServersGcpOfferingVaAutoProvisioningConfiguration() { - } - - /** - * Get the type property: The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - * - * @return the type value. - */ - public Type type() { - return this.type; - } - - /** - * Set the type property: The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - * - * @param type the type value to set. - * @return the DefenderForServersGcpOfferingVaAutoProvisioningConfiguration object itself. - */ - public DefenderForServersGcpOfferingVaAutoProvisioningConfiguration withType(Type type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScanners.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScanners.java deleted file mode 100644 index d530ace03cb6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScanners.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The Microsoft Defender for Server VM scanning configuration. */ -@Fluent -public final class DefenderForServersGcpOfferingVmScanners { - /* - * Is Microsoft Defender for Server VM scanning enabled - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * configuration for Microsoft Defender for Server VM scanning - */ - @JsonProperty(value = "configuration") - private DefenderForServersGcpOfferingVmScannersConfiguration configuration; - - /** Creates an instance of DefenderForServersGcpOfferingVmScanners class. */ - public DefenderForServersGcpOfferingVmScanners() { - } - - /** - * Get the enabled property: Is Microsoft Defender for Server VM scanning enabled. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Is Microsoft Defender for Server VM scanning enabled. - * - * @param enabled the enabled value to set. - * @return the DefenderForServersGcpOfferingVmScanners object itself. - */ - public DefenderForServersGcpOfferingVmScanners withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the configuration property: configuration for Microsoft Defender for Server VM scanning. - * - * @return the configuration value. - */ - public DefenderForServersGcpOfferingVmScannersConfiguration configuration() { - return this.configuration; - } - - /** - * Set the configuration property: configuration for Microsoft Defender for Server VM scanning. - * - * @param configuration the configuration value to set. - * @return the DefenderForServersGcpOfferingVmScanners object itself. - */ - public DefenderForServersGcpOfferingVmScanners withConfiguration( - DefenderForServersGcpOfferingVmScannersConfiguration configuration) { - this.configuration = configuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (configuration() != null) { - configuration().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScannersConfiguration.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScannersConfiguration.java deleted file mode 100644 index aedf865b1f86..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DefenderForServersGcpOfferingVmScannersConfiguration.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.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** configuration for Microsoft Defender for Server VM scanning. */ -@Fluent -public final class DefenderForServersGcpOfferingVmScannersConfiguration { - /* - * The scanning mode for the VM scan. - */ - @JsonProperty(value = "scanningMode") - private ScanningMode scanningMode; - - /* - * VM tags that indicate that VM should not be scanned - */ - @JsonProperty(value = "exclusionTags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map exclusionTags; - - /** Creates an instance of DefenderForServersGcpOfferingVmScannersConfiguration class. */ - public DefenderForServersGcpOfferingVmScannersConfiguration() { - } - - /** - * Get the scanningMode property: The scanning mode for the VM scan. - * - * @return the scanningMode value. - */ - public ScanningMode scanningMode() { - return this.scanningMode; - } - - /** - * Set the scanningMode property: The scanning mode for the VM scan. - * - * @param scanningMode the scanningMode value to set. - * @return the DefenderForServersGcpOfferingVmScannersConfiguration object itself. - */ - public DefenderForServersGcpOfferingVmScannersConfiguration withScanningMode(ScanningMode scanningMode) { - this.scanningMode = scanningMode; - return this; - } - - /** - * Get the exclusionTags property: VM tags that indicate that VM should not be scanned. - * - * @return the exclusionTags value. - */ - public Map exclusionTags() { - return this.exclusionTags; - } - - /** - * Set the exclusionTags property: VM tags that indicate that VM should not be scanned. - * - * @param exclusionTags the exclusionTags value to set. - * @return the DefenderForServersGcpOfferingVmScannersConfiguration object itself. - */ - public DefenderForServersGcpOfferingVmScannersConfiguration withExclusionTags(Map exclusionTags) { - this.exclusionTags = exclusionTags; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DenylistCustomAlertRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DenylistCustomAlertRule.java deleted file mode 100644 index 184d7b23a1f5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DenylistCustomAlertRule.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** A custom alert rule that checks if a value (depends on the custom alert type) is denied. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("DenylistCustomAlertRule") -@Fluent -public final class DenylistCustomAlertRule extends ListCustomAlertRule { - /* - * The values to deny. The format of the values depends on the rule type. - */ - @JsonProperty(value = "denylistValues", required = true) - private List denylistValues; - - /** Creates an instance of DenylistCustomAlertRule class. */ - public DenylistCustomAlertRule() { - } - - /** - * Get the denylistValues property: The values to deny. The format of the values depends on the rule type. - * - * @return the denylistValues value. - */ - public List denylistValues() { - return this.denylistValues; - } - - /** - * Set the denylistValues property: The values to deny. The format of the values depends on the rule type. - * - * @param denylistValues the denylistValues value to set. - * @return the DenylistCustomAlertRule object itself. - */ - public DenylistCustomAlertRule withDenylistValues(List denylistValues) { - this.denylistValues = denylistValues; - return this; - } - - /** {@inheritDoc} */ - @Override - public DenylistCustomAlertRule withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (denylistValues() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property denylistValues in model DenylistCustomAlertRule")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DenylistCustomAlertRule.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroup.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroup.java deleted file mode 100644 index 8cf36f7d77a0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroup.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; -import java.util.List; - -/** An immutable client-side representation of DeviceSecurityGroup. */ -public interface DeviceSecurityGroup { - /** - * 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 thresholdRules property: The list of custom alert threshold rules. - * - * @return the thresholdRules value. - */ - List thresholdRules(); - - /** - * Gets the timeWindowRules property: The list of custom alert time-window rules. - * - * @return the timeWindowRules value. - */ - List timeWindowRules(); - - /** - * Gets the allowlistRules property: The allow-list custom alert rules. - * - * @return the allowlistRules value. - */ - List allowlistRules(); - - /** - * Gets the denylistRules property: The deny-list custom alert rules. - * - * @return the denylistRules value. - */ - List denylistRules(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner object. - * - * @return the inner object. - */ - DeviceSecurityGroupInner innerModel(); - - /** The entirety of the DeviceSecurityGroup definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - /** The DeviceSecurityGroup definition stages. */ - interface DefinitionStages { - /** The first stage of the DeviceSecurityGroup definition. */ - interface Blank extends WithScope { - } - /** The stage of the DeviceSecurityGroup definition allowing to specify parent resource. */ - interface WithScope { - /** - * Specifies resourceId. - * - * @param resourceId The identifier of the resource. - * @return the next definition stage. - */ - WithCreate withExistingResourceId(String resourceId); - } - /** - * The stage of the DeviceSecurityGroup definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithThresholdRules, - DefinitionStages.WithTimeWindowRules, - DefinitionStages.WithAllowlistRules, - DefinitionStages.WithDenylistRules { - /** - * Executes the create request. - * - * @return the created resource. - */ - DeviceSecurityGroup create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - DeviceSecurityGroup create(Context context); - } - /** The stage of the DeviceSecurityGroup definition allowing to specify thresholdRules. */ - interface WithThresholdRules { - /** - * Specifies the thresholdRules property: The list of custom alert threshold rules.. - * - * @param thresholdRules The list of custom alert threshold rules. - * @return the next definition stage. - */ - WithCreate withThresholdRules(List thresholdRules); - } - /** The stage of the DeviceSecurityGroup definition allowing to specify timeWindowRules. */ - interface WithTimeWindowRules { - /** - * Specifies the timeWindowRules property: The list of custom alert time-window rules.. - * - * @param timeWindowRules The list of custom alert time-window rules. - * @return the next definition stage. - */ - WithCreate withTimeWindowRules(List timeWindowRules); - } - /** The stage of the DeviceSecurityGroup definition allowing to specify allowlistRules. */ - interface WithAllowlistRules { - /** - * Specifies the allowlistRules property: The allow-list custom alert rules.. - * - * @param allowlistRules The allow-list custom alert rules. - * @return the next definition stage. - */ - WithCreate withAllowlistRules(List allowlistRules); - } - /** The stage of the DeviceSecurityGroup definition allowing to specify denylistRules. */ - interface WithDenylistRules { - /** - * Specifies the denylistRules property: The deny-list custom alert rules.. - * - * @param denylistRules The deny-list custom alert rules. - * @return the next definition stage. - */ - WithCreate withDenylistRules(List denylistRules); - } - } - /** - * Begins update for the DeviceSecurityGroup resource. - * - * @return the stage of resource update. - */ - DeviceSecurityGroup.Update update(); - - /** The template for DeviceSecurityGroup update. */ - interface Update - extends UpdateStages.WithThresholdRules, - UpdateStages.WithTimeWindowRules, - UpdateStages.WithAllowlistRules, - UpdateStages.WithDenylistRules { - /** - * Executes the update request. - * - * @return the updated resource. - */ - DeviceSecurityGroup apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - DeviceSecurityGroup apply(Context context); - } - /** The DeviceSecurityGroup update stages. */ - interface UpdateStages { - /** The stage of the DeviceSecurityGroup update allowing to specify thresholdRules. */ - interface WithThresholdRules { - /** - * Specifies the thresholdRules property: The list of custom alert threshold rules.. - * - * @param thresholdRules The list of custom alert threshold rules. - * @return the next definition stage. - */ - Update withThresholdRules(List thresholdRules); - } - /** The stage of the DeviceSecurityGroup update allowing to specify timeWindowRules. */ - interface WithTimeWindowRules { - /** - * Specifies the timeWindowRules property: The list of custom alert time-window rules.. - * - * @param timeWindowRules The list of custom alert time-window rules. - * @return the next definition stage. - */ - Update withTimeWindowRules(List timeWindowRules); - } - /** The stage of the DeviceSecurityGroup update allowing to specify allowlistRules. */ - interface WithAllowlistRules { - /** - * Specifies the allowlistRules property: The allow-list custom alert rules.. - * - * @param allowlistRules The allow-list custom alert rules. - * @return the next definition stage. - */ - Update withAllowlistRules(List allowlistRules); - } - /** The stage of the DeviceSecurityGroup update allowing to specify denylistRules. */ - interface WithDenylistRules { - /** - * Specifies the denylistRules property: The deny-list custom alert rules.. - * - * @param denylistRules The deny-list custom alert rules. - * @return the next definition stage. - */ - Update withDenylistRules(List denylistRules); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - DeviceSecurityGroup refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - DeviceSecurityGroup refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroupList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroupList.java deleted file mode 100644 index 037c1991ff6e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroupList.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of device security groups. */ -@Fluent -public final class DeviceSecurityGroupList { - /* - * List of device security group objects - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of DeviceSecurityGroupList class. */ - public DeviceSecurityGroupList() { - } - - /** - * Get the value property: List of device security group objects. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of device security group objects. - * - * @param value the value value to set. - * @return the DeviceSecurityGroupList object itself. - */ - public DeviceSecurityGroupList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroups.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroups.java deleted file mode 100644 index 83cc69b063b7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DeviceSecurityGroups.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of DeviceSecurityGroups. */ -public interface DeviceSecurityGroups { - /** - * Use this method get the list of device security groups 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 device security groups as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceId); - - /** - * Use this method get the list of device security groups for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of device security groups as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceId, Context context); - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response}. - */ - Response getWithResponse(String resourceId, String deviceSecurityGroupName, Context context); - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource. - */ - DeviceSecurityGroup get(String resourceId, String deviceSecurityGroupName); - - /** - * User this method to deletes the device security group. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByResourceGroupWithResponse( - String resourceId, String deviceSecurityGroupName, Context context); - - /** - * User this method to deletes the device security group. - * - * @param resourceId The identifier of the resource. - * @param deviceSecurityGroupName The name of the device security group. Note that the name of the device security - * group 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. - */ - void deleteByResourceGroup(String resourceId, String deviceSecurityGroupName); - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response}. - */ - DeviceSecurityGroup getById(String id); - - /** - * Use this method to get the device security group for the specified IoT Hub resource. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the device security group resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * User this method to deletes the device security group. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * User this method to deletes the device security group. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new DeviceSecurityGroup resource. - * - * @param name resource name. - * @return the first stage of the new DeviceSecurityGroup definition. - */ - DeviceSecurityGroup.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DirectMethodInvokesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DirectMethodInvokesNotInAllowedRange.java deleted file mode 100644 index 2a932e08c998..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DirectMethodInvokesNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of direct method invokes is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("DirectMethodInvokesNotInAllowedRange") -@Fluent -public final class DirectMethodInvokesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of DirectMethodInvokesNotInAllowedRange class. */ - public DirectMethodInvokesNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public DirectMethodInvokesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public DirectMethodInvokesNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public DirectMethodInvokesNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public DirectMethodInvokesNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/Direction.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Direction.java deleted file mode 100644 index 9042afdbef2e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Direction.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The rule's direction. */ -public final class Direction extends ExpandableStringEnum { - /** Static value Inbound for Direction. */ - public static final Direction INBOUND = fromString("Inbound"); - - /** Static value Outbound for Direction. */ - public static final Direction OUTBOUND = fromString("Outbound"); - - /** - * Creates a new instance of Direction value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Direction() { - } - - /** - * Creates or finds a Direction from its string representation. - * - * @param name a name to look for. - * @return the corresponding Direction. - */ - @JsonCreator - public static Direction fromString(String name) { - return fromString(name, Direction.class); - } - - /** - * Gets known Direction values. - * - * @return known Direction values. - */ - public static Collection values() { - return values(Direction.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolution.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolution.java deleted file mode 100644 index ffb98c4d786d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolution.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.models; - -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; - -/** An immutable client-side representation of DiscoveredSecuritySolution. */ -public interface DiscoveredSecuritySolution { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - - /** - * Gets the securityFamily property: The security family of the discovered solution. - * - * @return the securityFamily value. - */ - SecurityFamily securityFamily(); - - /** - * Gets the offer property: The security solutions' image offer. - * - * @return the offer value. - */ - String offer(); - - /** - * Gets the publisher property: The security solutions' image publisher. - * - * @return the publisher value. - */ - String publisher(); - - /** - * Gets the sku property: The security solutions' image sku. - * - * @return the sku value. - */ - String sku(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner object. - * - * @return the inner object. - */ - DiscoveredSecuritySolutionInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolutionList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolutionList.java deleted file mode 100644 index b20c1a5413ad..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolutionList.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The DiscoveredSecuritySolutionList model. */ -@Fluent -public final class DiscoveredSecuritySolutionList { - /* - * The value property. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of DiscoveredSecuritySolutionList class. */ - public DiscoveredSecuritySolutionList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the DiscoveredSecuritySolutionList object itself. - */ - public DiscoveredSecuritySolutionList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolutions.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolutions.java deleted file mode 100644 index 0dec60d24da0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/DiscoveredSecuritySolutions.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of DiscoveredSecuritySolutions. */ -public interface DiscoveredSecuritySolutions { - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(); - - /** - * Gets a list of discovered Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets a list of discovered Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of discovered Security Solutions for the subscription and location as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific discovered Security Solution along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName, Context context); - - /** - * Gets a specific discovered Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param discoveredSecuritySolutionName Name of a discovered security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific discovered Security Solution. - */ - DiscoveredSecuritySolution get(String resourceGroupName, String ascLocation, String discoveredSecuritySolutionName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EffectiveNetworkSecurityGroups.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EffectiveNetworkSecurityGroups.java deleted file mode 100644 index de51e989459e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EffectiveNetworkSecurityGroups.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Describes the Network Security Groups effective on a network interface. */ -@Fluent -public final class EffectiveNetworkSecurityGroups { - /* - * The Azure resource ID of the network interface - */ - @JsonProperty(value = "networkInterface") - private String networkInterface; - - /* - * The Network Security Groups effective on the network interface - */ - @JsonProperty(value = "networkSecurityGroups") - private List networkSecurityGroups; - - /** Creates an instance of EffectiveNetworkSecurityGroups class. */ - public EffectiveNetworkSecurityGroups() { - } - - /** - * Get the networkInterface property: The Azure resource ID of the network interface. - * - * @return the networkInterface value. - */ - public String networkInterface() { - return this.networkInterface; - } - - /** - * Set the networkInterface property: The Azure resource ID of the network interface. - * - * @param networkInterface the networkInterface value to set. - * @return the EffectiveNetworkSecurityGroups object itself. - */ - public EffectiveNetworkSecurityGroups withNetworkInterface(String networkInterface) { - this.networkInterface = networkInterface; - return this; - } - - /** - * Get the networkSecurityGroups property: The Network Security Groups effective on the network interface. - * - * @return the networkSecurityGroups value. - */ - public List networkSecurityGroups() { - return this.networkSecurityGroups; - } - - /** - * Set the networkSecurityGroups property: The Network Security Groups effective on the network interface. - * - * @param networkSecurityGroups the networkSecurityGroups value to set. - * @return the EffectiveNetworkSecurityGroups object itself. - */ - public EffectiveNetworkSecurityGroups withNetworkSecurityGroups(List networkSecurityGroups) { - this.networkSecurityGroups = networkSecurityGroups; - 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/EndOfSupportStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EndOfSupportStatus.java deleted file mode 100644 index ffd0f46c7c4f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EndOfSupportStatus.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** End of support status. */ -public final class EndOfSupportStatus extends ExpandableStringEnum { - /** Static value None for EndOfSupportStatus. */ - public static final EndOfSupportStatus NONE = fromString("None"); - - /** Static value noLongerSupported for EndOfSupportStatus. */ - public static final EndOfSupportStatus NO_LONGER_SUPPORTED = fromString("noLongerSupported"); - - /** Static value versionNoLongerSupported for EndOfSupportStatus. */ - public static final EndOfSupportStatus VERSION_NO_LONGER_SUPPORTED = fromString("versionNoLongerSupported"); - - /** Static value upcomingNoLongerSupported for EndOfSupportStatus. */ - public static final EndOfSupportStatus UPCOMING_NO_LONGER_SUPPORTED = fromString("upcomingNoLongerSupported"); - - /** Static value upcomingVersionNoLongerSupported for EndOfSupportStatus. */ - public static final EndOfSupportStatus UPCOMING_VERSION_NO_LONGER_SUPPORTED = - fromString("upcomingVersionNoLongerSupported"); - - /** - * Creates a new instance of EndOfSupportStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EndOfSupportStatus() { - } - - /** - * Creates or finds a EndOfSupportStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding EndOfSupportStatus. - */ - @JsonCreator - public static EndOfSupportStatus fromString(String name) { - return fromString(name, EndOfSupportStatus.class); - } - - /** - * Gets known EndOfSupportStatus values. - * - * @return known EndOfSupportStatus values. - */ - public static Collection values() { - return values(EndOfSupportStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementMode.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementMode.java deleted file mode 100644 index 6235187ef470..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementMode.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The application control policy enforcement/protection mode of the machine group. */ -public final class EnforcementMode extends ExpandableStringEnum { - /** Static value Audit for EnforcementMode. */ - public static final EnforcementMode AUDIT = fromString("Audit"); - - /** Static value Enforce for EnforcementMode. */ - public static final EnforcementMode ENFORCE = fromString("Enforce"); - - /** Static value None for EnforcementMode. */ - public static final EnforcementMode NONE = fromString("None"); - - /** - * Creates a new instance of EnforcementMode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EnforcementMode() { - } - - /** - * Creates or finds a EnforcementMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding EnforcementMode. - */ - @JsonCreator - public static EnforcementMode fromString(String name) { - return fromString(name, EnforcementMode.class); - } - - /** - * Gets known EnforcementMode values. - * - * @return known EnforcementMode values. - */ - public static Collection values() { - return values(EnforcementMode.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementSupport.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementSupport.java deleted file mode 100644 index 89f498dd851a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnforcementSupport.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The machine supportability of Enforce feature. */ -public final class EnforcementSupport extends ExpandableStringEnum { - /** Static value Supported for EnforcementSupport. */ - public static final EnforcementSupport SUPPORTED = fromString("Supported"); - - /** Static value NotSupported for EnforcementSupport. */ - public static final EnforcementSupport NOT_SUPPORTED = fromString("NotSupported"); - - /** Static value Unknown for EnforcementSupport. */ - public static final EnforcementSupport UNKNOWN = fromString("Unknown"); - - /** - * Creates a new instance of EnforcementSupport value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EnforcementSupport() { - } - - /** - * Creates or finds a EnforcementSupport from its string representation. - * - * @param name a name to look for. - * @return the corresponding EnforcementSupport. - */ - @JsonCreator - public static EnforcementSupport fromString(String name) { - return fromString(name, EnforcementSupport.class); - } - - /** - * Gets known EnforcementSupport values. - * - * @return known EnforcementSupport values. - */ - public static Collection values() { - return values(EnforcementSupport.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentData.java deleted file mode 100644 index 105f62c59a09..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentData.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.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The security connector environment data. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "environmentType", - defaultImpl = EnvironmentData.class) -@JsonTypeName("EnvironmentData") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AwsAccount", value = AwsEnvironmentData.class), - @JsonSubTypes.Type(name = "GcpProject", value = GcpProjectEnvironmentData.class), - @JsonSubTypes.Type(name = "GithubScope", value = GithubScopeEnvironmentData.class), - @JsonSubTypes.Type(name = "AzureDevOpsScope", value = AzureDevOpsScopeEnvironmentData.class), - @JsonSubTypes.Type(name = "GitlabScope", value = GitlabScopeEnvironmentData.class) -}) -@Immutable -public class EnvironmentData { - /** Creates an instance of EnvironmentData class. */ - public EnvironmentData() { - } - - /** - * 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/EnvironmentDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentDetails.java deleted file mode 100644 index 4bc4556cbae7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentDetails.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The environment details of the resource. */ -@Fluent -public final class EnvironmentDetails { - /* - * The native resource id of the resource (in case of Azure - the resource Id, in case of MC - the native resource - * id) - */ - @JsonProperty(value = "nativeResourceId") - private String nativeResourceId; - - /* - * The hierarchy id of the connector (in case of Azure - the subscription Id, in case of MC - the hierarchyId id) - */ - @JsonProperty(value = "environmentHierarchyId") - private String environmentHierarchyId; - - /* - * The organizational hierarchy id of the connector (in case of Azure - the subscription Id, in case of MC - the - * organizational hierarchyId id) - */ - @JsonProperty(value = "organizationalHierarchyId") - private String organizationalHierarchyId; - - /* - * The subscription Id - */ - @JsonProperty(value = "subscriptionId") - private String subscriptionId; - - /* - * The tenant Id - */ - @JsonProperty(value = "tenantId") - private String tenantId; - - /** Creates an instance of EnvironmentDetails class. */ - public EnvironmentDetails() { - } - - /** - * Get the nativeResourceId property: The native resource id of the resource (in case of Azure - the resource Id, in - * case of MC - the native resource id). - * - * @return the nativeResourceId value. - */ - public String nativeResourceId() { - return this.nativeResourceId; - } - - /** - * Set the nativeResourceId property: The native resource id of the resource (in case of Azure - the resource Id, in - * case of MC - the native resource id). - * - * @param nativeResourceId the nativeResourceId value to set. - * @return the EnvironmentDetails object itself. - */ - public EnvironmentDetails withNativeResourceId(String nativeResourceId) { - this.nativeResourceId = nativeResourceId; - return this; - } - - /** - * Get the environmentHierarchyId property: The hierarchy id of the connector (in case of Azure - the subscription - * Id, in case of MC - the hierarchyId id). - * - * @return the environmentHierarchyId value. - */ - public String environmentHierarchyId() { - return this.environmentHierarchyId; - } - - /** - * Set the environmentHierarchyId property: The hierarchy id of the connector (in case of Azure - the subscription - * Id, in case of MC - the hierarchyId id). - * - * @param environmentHierarchyId the environmentHierarchyId value to set. - * @return the EnvironmentDetails object itself. - */ - public EnvironmentDetails withEnvironmentHierarchyId(String environmentHierarchyId) { - this.environmentHierarchyId = environmentHierarchyId; - return this; - } - - /** - * Get the organizationalHierarchyId property: The organizational hierarchy id of the connector (in case of Azure - - * the subscription Id, in case of MC - the organizational hierarchyId id). - * - * @return the organizationalHierarchyId value. - */ - public String organizationalHierarchyId() { - return this.organizationalHierarchyId; - } - - /** - * Set the organizationalHierarchyId property: The organizational hierarchy id of the connector (in case of Azure - - * the subscription Id, in case of MC - the organizational hierarchyId id). - * - * @param organizationalHierarchyId the organizationalHierarchyId value to set. - * @return the EnvironmentDetails object itself. - */ - public EnvironmentDetails withOrganizationalHierarchyId(String organizationalHierarchyId) { - this.organizationalHierarchyId = organizationalHierarchyId; - return this; - } - - /** - * Get the subscriptionId property: The subscription Id. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Set the subscriptionId property: The subscription Id. - * - * @param subscriptionId the subscriptionId value to set. - * @return the EnvironmentDetails object itself. - */ - public EnvironmentDetails withSubscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /** - * Get the tenantId property: The tenant Id. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Set the tenantId property: The tenant Id. - * - * @param tenantId the tenantId value to set. - * @return the EnvironmentDetails object itself. - */ - public EnvironmentDetails withTenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentType.java deleted file mode 100644 index c70a011dfa98..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EnvironmentType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The type of the environment data. */ -public final class EnvironmentType extends ExpandableStringEnum { - /** Static value AwsAccount for EnvironmentType. */ - public static final EnvironmentType AWS_ACCOUNT = fromString("AwsAccount"); - - /** Static value GcpProject for EnvironmentType. */ - public static final EnvironmentType GCP_PROJECT = fromString("GcpProject"); - - /** Static value GithubScope for EnvironmentType. */ - public static final EnvironmentType GITHUB_SCOPE = fromString("GithubScope"); - - /** Static value AzureDevOpsScope for EnvironmentType. */ - public static final EnvironmentType AZURE_DEV_OPS_SCOPE = fromString("AzureDevOpsScope"); - - /** Static value GitlabScope for EnvironmentType. */ - public static final EnvironmentType GITLAB_SCOPE = fromString("GitlabScope"); - - /** - * Creates a new instance of EnvironmentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EnvironmentType() { - } - - /** - * Creates or finds a EnvironmentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding EnvironmentType. - */ - @JsonCreator - public static EnvironmentType fromString(String name) { - return fromString(name, EnvironmentType.class); - } - - /** - * Gets known EnvironmentType values. - * - * @return known EnvironmentType values. - */ - public static Collection values() { - return values(EnvironmentType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Etag.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Etag.java deleted file mode 100644 index 0e0178c4057f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Etag.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Entity tag is used for comparing two or more entities from the same requested resource. */ -@Fluent -public class Etag { - /* - * Entity tag is used for comparing two or more entities from the same requested resource. - */ - @JsonProperty(value = "etag") - private String etag; - - /** Creates an instance of Etag class. */ - public Etag() { - } - - /** - * Get the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @param etag the etag value to set. - * @return the Etag object itself. - */ - public Etag withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.java deleted file mode 100644 index 39678faa9907..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/EventSource.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.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** A valid event source type. */ -public final class EventSource extends ExpandableStringEnum { - /** Static value Assessments for EventSource. */ - public static final EventSource ASSESSMENTS = fromString("Assessments"); - - /** Static value AssessmentsSnapshot for EventSource. */ - public static final EventSource ASSESSMENTS_SNAPSHOT = fromString("AssessmentsSnapshot"); - - /** Static value SubAssessments for EventSource. */ - public static final EventSource SUB_ASSESSMENTS = fromString("SubAssessments"); - - /** Static value SubAssessmentsSnapshot for EventSource. */ - public static final EventSource SUB_ASSESSMENTS_SNAPSHOT = fromString("SubAssessmentsSnapshot"); - - /** Static value Alerts for EventSource. */ - public static final EventSource ALERTS = fromString("Alerts"); - - /** Static value SecureScores for EventSource. */ - public static final EventSource SECURE_SCORES = fromString("SecureScores"); - - /** Static value SecureScoresSnapshot for EventSource. */ - public static final EventSource SECURE_SCORES_SNAPSHOT = fromString("SecureScoresSnapshot"); - - /** Static value SecureScoreControls for EventSource. */ - public static final EventSource SECURE_SCORE_CONTROLS = fromString("SecureScoreControls"); - - /** Static value SecureScoreControlsSnapshot for EventSource. */ - public static final EventSource SECURE_SCORE_CONTROLS_SNAPSHOT = fromString("SecureScoreControlsSnapshot"); - - /** Static value RegulatoryComplianceAssessment for EventSource. */ - public static final EventSource REGULATORY_COMPLIANCE_ASSESSMENT = fromString("RegulatoryComplianceAssessment"); - - /** Static value RegulatoryComplianceAssessmentSnapshot for EventSource. */ - public static final EventSource REGULATORY_COMPLIANCE_ASSESSMENT_SNAPSHOT = - fromString("RegulatoryComplianceAssessmentSnapshot"); - - /** - * Creates a new instance of EventSource value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public EventSource() { - } - - /** - * Creates or finds a EventSource from its string representation. - * - * @param name a name to look for. - * @return the corresponding EventSource. - */ - @JsonCreator - public static EventSource fromString(String name) { - return fromString(name, EventSource.class); - } - - /** - * Gets known EventSource values. - * - * @return known EventSource values. - */ - public static Collection values() { - return values(EventSource.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteGovernanceRuleParams.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteGovernanceRuleParams.java deleted file mode 100644 index 985f61f94758..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExecuteGovernanceRuleParams.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Governance rule execution parameters. */ -@Fluent -public final class ExecuteGovernanceRuleParams { - /* - * Describe if governance rule should be override - */ - @JsonProperty(value = "override") - private Boolean override; - - /** Creates an instance of ExecuteGovernanceRuleParams class. */ - public ExecuteGovernanceRuleParams() { - } - - /** - * Get the override property: Describe if governance rule should be override. - * - * @return the override value. - */ - public Boolean override() { - return this.override; - } - - /** - * Set the override property: Describe if governance rule should be override. - * - * @param override the override value to set. - * @return the ExecuteGovernanceRuleParams object itself. - */ - public ExecuteGovernanceRuleParams withOverride(Boolean override) { - this.override = override; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandControlsEnum.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandControlsEnum.java deleted file mode 100644 index 05be0c5ea44f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandControlsEnum.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExpandControlsEnum. */ -public final class ExpandControlsEnum extends ExpandableStringEnum { - /** Static value definition for ExpandControlsEnum. */ - public static final ExpandControlsEnum DEFINITION = fromString("definition"); - - /** - * Creates a new instance of ExpandControlsEnum value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ExpandControlsEnum() { - } - - /** - * Creates or finds a ExpandControlsEnum from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExpandControlsEnum. - */ - @JsonCreator - public static ExpandControlsEnum fromString(String name) { - return fromString(name, ExpandControlsEnum.class); - } - - /** - * Gets known ExpandControlsEnum values. - * - * @return known ExpandControlsEnum values. - */ - public static Collection values() { - return values(ExpandControlsEnum.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandEnum.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandEnum.java deleted file mode 100644 index 2a5584e0fb55..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExpandEnum.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExpandEnum. */ -public final class ExpandEnum extends ExpandableStringEnum { - /** Static value links for ExpandEnum. */ - public static final ExpandEnum LINKS = fromString("links"); - - /** Static value metadata for ExpandEnum. */ - public static final ExpandEnum METADATA = fromString("metadata"); - - /** - * Creates a new instance of ExpandEnum value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ExpandEnum() { - } - - /** - * Creates or finds a ExpandEnum from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExpandEnum. - */ - @JsonCreator - public static ExpandEnum fromString(String name) { - return fromString(name, ExpandEnum.class); - } - - /** - * Gets known ExpandEnum values. - * - * @return known ExpandEnum values. - */ - public static Collection values() { - return values(ExpandEnum.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExportData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExportData.java deleted file mode 100644 index d24f2e1271f8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExportData.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ExportData. */ -public final class ExportData extends ExpandableStringEnum { - /** Static value RawEvents for ExportData. */ - public static final ExportData RAW_EVENTS = fromString("RawEvents"); - - /** - * Creates a new instance of ExportData value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ExportData() { - } - - /** - * Creates or finds a ExportData from its string representation. - * - * @param name a name to look for. - * @return the corresponding ExportData. - */ - @JsonCreator - public static ExportData fromString(String name) { - return fromString(name, ExportData.class); - } - - /** - * Gets known ExportData values. - * - * @return known ExportData values. - */ - public static Collection values() { - return values(ExportData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Extension.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Extension.java deleted file mode 100644 index 08661bf27476..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Extension.java +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** A plan's extension properties. */ -@Fluent -public final class Extension { - /* - * The extension name. Supported values are:

**AgentlessDiscoveryForKubernetes** - API-based discovery of - * information about Kubernetes cluster architecture, workload objects, and setup. Required for Kubernetes - * inventory, identity and network exposure detection, attack path analysis and risk hunting as part of the cloud - * security explorer. - * Available for CloudPosture plan.

**OnUploadMalwareScanning** - Limits the GB to be scanned per month for - * each storage account within the subscription. Once this limit reached on a given storage account, Blobs won't be - * scanned during current calendar month. - * Available for StorageAccounts plan.

**SensitiveDataDiscovery** - Sensitive data discovery identifies Blob - * storage container with sensitive data such as credentials, credit cards, and more, to help prioritize and - * investigate security events. - * Available for StorageAccounts and CloudPosture plans.

**ContainerRegistriesVulnerabilityAssessments** - - * Provides vulnerability management for images stored in your container registries. - * Available for CloudPosture and Containers plans. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * Indicates whether the extension is enabled. - */ - @JsonProperty(value = "isEnabled", required = true) - private IsEnabled isEnabled; - - /* - * Property values associated with the extension. - */ - @JsonProperty(value = "additionalExtensionProperties") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map additionalExtensionProperties; - - /* - * Optional. A status describing the success/failure of the extension's enablement/disablement operation. - */ - @JsonProperty(value = "operationStatus", access = JsonProperty.Access.WRITE_ONLY) - private OperationStatus operationStatus; - - /** Creates an instance of Extension class. */ - public Extension() { - } - - /** - * Get the name property: The extension name. Supported values are: - * <br><br>**AgentlessDiscoveryForKubernetes** - API-based discovery of information about Kubernetes - * cluster architecture, workload objects, and setup. Required for Kubernetes inventory, identity and network - * exposure detection, attack path analysis and risk hunting as part of the cloud security explorer. Available for - * CloudPosture plan.<br><br>**OnUploadMalwareScanning** - Limits the GB to be scanned per month for - * each storage account within the subscription. Once this limit reached on a given storage account, Blobs won't be - * scanned during current calendar month. Available for StorageAccounts - * plan.<br><br>**SensitiveDataDiscovery** - Sensitive data discovery identifies Blob storage container - * with sensitive data such as credentials, credit cards, and more, to help prioritize and investigate security - * events. Available for StorageAccounts and CloudPosture - * plans.<br><br>**ContainerRegistriesVulnerabilityAssessments** - Provides vulnerability management for - * images stored in your container registries. Available for CloudPosture and Containers plans. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The extension name. Supported values are: - * <br><br>**AgentlessDiscoveryForKubernetes** - API-based discovery of information about Kubernetes - * cluster architecture, workload objects, and setup. Required for Kubernetes inventory, identity and network - * exposure detection, attack path analysis and risk hunting as part of the cloud security explorer. Available for - * CloudPosture plan.<br><br>**OnUploadMalwareScanning** - Limits the GB to be scanned per month for - * each storage account within the subscription. Once this limit reached on a given storage account, Blobs won't be - * scanned during current calendar month. Available for StorageAccounts - * plan.<br><br>**SensitiveDataDiscovery** - Sensitive data discovery identifies Blob storage container - * with sensitive data such as credentials, credit cards, and more, to help prioritize and investigate security - * events. Available for StorageAccounts and CloudPosture - * plans.<br><br>**ContainerRegistriesVulnerabilityAssessments** - Provides vulnerability management for - * images stored in your container registries. Available for CloudPosture and Containers plans. - * - * @param name the name value to set. - * @return the Extension object itself. - */ - public Extension withName(String name) { - this.name = name; - return this; - } - - /** - * Get the isEnabled property: Indicates whether the extension is enabled. - * - * @return the isEnabled value. - */ - public IsEnabled isEnabled() { - return this.isEnabled; - } - - /** - * Set the isEnabled property: Indicates whether the extension is enabled. - * - * @param isEnabled the isEnabled value to set. - * @return the Extension object itself. - */ - public Extension withIsEnabled(IsEnabled isEnabled) { - this.isEnabled = isEnabled; - return this; - } - - /** - * Get the additionalExtensionProperties property: Property values associated with the extension. - * - * @return the additionalExtensionProperties value. - */ - public Map additionalExtensionProperties() { - return this.additionalExtensionProperties; - } - - /** - * Set the additionalExtensionProperties property: Property values associated with the extension. - * - * @param additionalExtensionProperties the additionalExtensionProperties value to set. - * @return the Extension object itself. - */ - public Extension withAdditionalExtensionProperties(Map additionalExtensionProperties) { - this.additionalExtensionProperties = additionalExtensionProperties; - return this; - } - - /** - * Get the operationStatus property: Optional. A status describing the success/failure of the extension's - * enablement/disablement operation. - * - * @return the operationStatus value. - */ - public OperationStatus operationStatus() { - return this.operationStatus; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Extension")); - } - if (isEnabled() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property isEnabled in model Extension")); - } - if (operationStatus() != null) { - operationStatus().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Extension.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolution.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolution.java deleted file mode 100644 index 59722076e72b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolution.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.ExternalSecuritySolutionInner; - -/** An immutable client-side representation of ExternalSecuritySolution. */ -public interface ExternalSecuritySolution { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner object. - * - * @return the inner object. - */ - ExternalSecuritySolutionInner innerModel(); -} 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 deleted file mode 100644 index cbbc0b7acb37..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionKind.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The kind of the external solution. */ -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 a new instance of ExternalSecuritySolutionKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ExternalSecuritySolutionKind() { - } - - /** - * 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); - } - - /** - * Gets known ExternalSecuritySolutionKind values. - * - * @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/ExternalSecuritySolutionList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionList.java deleted file mode 100644 index 8afc46f34ad0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionList.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The ExternalSecuritySolutionList model. */ -@Fluent -public final class ExternalSecuritySolutionList { - /* - * The value property. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of ExternalSecuritySolutionList class. */ - public ExternalSecuritySolutionList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the ExternalSecuritySolutionList object itself. - */ - public ExternalSecuritySolutionList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionProperties.java deleted file mode 100644 index 83ad48819fe2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutionProperties.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** The solution properties (correspond to the solution kind). */ -@Fluent -public class ExternalSecuritySolutionProperties { - /* - * The deviceVendor property. - */ - @JsonProperty(value = "deviceVendor") - private String deviceVendor; - - /* - * The deviceType property. - */ - @JsonProperty(value = "deviceType") - private String deviceType; - - /* - * Represents an OMS workspace to which the solution is connected - */ - @JsonProperty(value = "workspace") - private ConnectedWorkspace workspace; - - /* - * The solution properties (correspond to the solution kind) - */ - @JsonIgnore private Map additionalProperties; - - /** Creates an instance of ExternalSecuritySolutionProperties class. */ - public ExternalSecuritySolutionProperties() { - } - - /** - * Get the deviceVendor property: The deviceVendor property. - * - * @return the deviceVendor value. - */ - public String deviceVendor() { - return this.deviceVendor; - } - - /** - * Set the deviceVendor property: The deviceVendor property. - * - * @param deviceVendor the deviceVendor value to set. - * @return the ExternalSecuritySolutionProperties object itself. - */ - public ExternalSecuritySolutionProperties withDeviceVendor(String deviceVendor) { - this.deviceVendor = deviceVendor; - return this; - } - - /** - * Get the deviceType property: The deviceType property. - * - * @return the deviceType value. - */ - public String deviceType() { - return this.deviceType; - } - - /** - * Set the deviceType property: The deviceType property. - * - * @param deviceType the deviceType value to set. - * @return the ExternalSecuritySolutionProperties object itself. - */ - public ExternalSecuritySolutionProperties withDeviceType(String deviceType) { - this.deviceType = deviceType; - return this; - } - - /** - * Get the workspace property: Represents an OMS workspace to which the solution is connected. - * - * @return the workspace value. - */ - public ConnectedWorkspace workspace() { - return this.workspace; - } - - /** - * Set the workspace property: Represents an OMS workspace to which the solution is connected. - * - * @param workspace the workspace value to set. - * @return the ExternalSecuritySolutionProperties object itself. - */ - public ExternalSecuritySolutionProperties withWorkspace(ConnectedWorkspace workspace) { - this.workspace = workspace; - return this; - } - - /** - * Get the additionalProperties property: The solution properties (correspond to the solution kind). - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: The solution properties (correspond to the solution kind). - * - * @param additionalProperties the additionalProperties value to set. - * @return the ExternalSecuritySolutionProperties object itself. - */ - public ExternalSecuritySolutionProperties withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (workspace() != null) { - workspace().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutions.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutions.java deleted file mode 100644 index 60dc430b9b7f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ExternalSecuritySolutions.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of ExternalSecuritySolutions. */ -public interface ExternalSecuritySolutions { - /** - * Gets a list of external security solutions for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(); - - /** - * Gets a list of external security solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external security solutions for the subscription as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with {@link - * PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets a list of external Security Solutions for the subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of external Security Solutions for the subscription and location as paginated response with {@link - * PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific external Security Solution along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String ascLocation, String externalSecuritySolutionsName, Context context); - - /** - * Gets a specific external Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param externalSecuritySolutionsName Name of an external security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific external Security Solution. - */ - ExternalSecuritySolution get(String resourceGroupName, String ascLocation, String externalSecuritySolutionsName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FailedLocalLoginsNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FailedLocalLoginsNotInAllowedRange.java deleted file mode 100644 index 47e420007902..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FailedLocalLoginsNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of failed local logins is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("FailedLocalLoginsNotInAllowedRange") -@Fluent -public final class FailedLocalLoginsNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of FailedLocalLoginsNotInAllowedRange class. */ - public FailedLocalLoginsNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public FailedLocalLoginsNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public FailedLocalLoginsNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public FailedLocalLoginsNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public FailedLocalLoginsNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/FileType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FileType.java deleted file mode 100644 index f6830ab5e804..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FileType.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The type of the file (for Linux files - Executable is used). */ -public final class FileType extends ExpandableStringEnum { - /** Static value Exe for FileType. */ - public static final FileType EXE = fromString("Exe"); - - /** Static value Dll for FileType. */ - public static final FileType DLL = fromString("Dll"); - - /** Static value Msi for FileType. */ - public static final FileType MSI = fromString("Msi"); - - /** Static value Script for FileType. */ - public static final FileType SCRIPT = fromString("Script"); - - /** Static value Executable for FileType. */ - public static final FileType EXECUTABLE = fromString("Executable"); - - /** Static value Unknown for FileType. */ - public static final FileType UNKNOWN = fromString("Unknown"); - - /** - * Creates a new instance of FileType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public FileType() { - } - - /** - * Creates or finds a FileType from its string representation. - * - * @param name a name to look for. - * @return the corresponding FileType. - */ - @JsonCreator - public static FileType fromString(String name) { - return fromString(name, FileType.class); - } - - /** - * Gets known FileType values. - * - * @return known FileType values. - */ - public static Collection values() { - return values(FileType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FileUploadsNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FileUploadsNotInAllowedRange.java deleted file mode 100644 index 69f8cf762e20..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/FileUploadsNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of file uploads is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("FileUploadsNotInAllowedRange") -@Fluent -public final class FileUploadsNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of FileUploadsNotInAllowedRange class. */ - public FileUploadsNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public FileUploadsNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public FileUploadsNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public FileUploadsNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public FileUploadsNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/GcpCredentialsDetailsProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpCredentialsDetailsProperties.java deleted file mode 100644 index ee933d133b16..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpCredentialsDetailsProperties.java +++ /dev/null @@ -1,388 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * GCP cloud account connector based service to service credentials, the credentials are composed of the organization ID - * and a JSON API key (write only). - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "authenticationType") -@JsonTypeName("gcpCredentials") -@Fluent -public final class GcpCredentialsDetailsProperties extends AuthenticationDetailsProperties { - /* - * The organization ID of the GCP cloud account - */ - @JsonProperty(value = "organizationId", required = true) - private String organizationId; - - /* - * Type field of the API key (write only) - */ - @JsonProperty(value = "type", required = true) - private String type; - - /* - * Project ID field of the API key (write only) - */ - @JsonProperty(value = "projectId", required = true) - private String projectId; - - /* - * Private key ID field of the API key (write only) - */ - @JsonProperty(value = "privateKeyId", required = true) - private String privateKeyId; - - /* - * Private key field of the API key (write only) - */ - @JsonProperty(value = "privateKey", required = true) - private String privateKey; - - /* - * Client email field of the API key (write only) - */ - @JsonProperty(value = "clientEmail", required = true) - private String clientEmail; - - /* - * Client ID field of the API key (write only) - */ - @JsonProperty(value = "clientId", required = true) - private String clientId; - - /* - * Auth URI field of the API key (write only) - */ - @JsonProperty(value = "authUri", required = true) - private String authUri; - - /* - * Token URI field of the API key (write only) - */ - @JsonProperty(value = "tokenUri", required = true) - private String tokenUri; - - /* - * Auth provider x509 certificate URL field of the API key (write only) - */ - @JsonProperty(value = "authProviderX509CertUrl", required = true) - private String authProviderX509CertUrl; - - /* - * Client x509 certificate URL field of the API key (write only) - */ - @JsonProperty(value = "clientX509CertUrl", required = true) - private String clientX509CertUrl; - - /** Creates an instance of GcpCredentialsDetailsProperties class. */ - public GcpCredentialsDetailsProperties() { - } - - /** - * Get the organizationId property: The organization ID of the GCP cloud account. - * - * @return the organizationId value. - */ - public String organizationId() { - return this.organizationId; - } - - /** - * Set the organizationId property: The organization ID of the GCP cloud account. - * - * @param organizationId the organizationId value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withOrganizationId(String organizationId) { - this.organizationId = organizationId; - return this; - } - - /** - * Get the type property: Type field of the API key (write only). - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Type field of the API key (write only). - * - * @param type the type value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withType(String type) { - this.type = type; - return this; - } - - /** - * Get the projectId property: Project ID field of the API key (write only). - * - * @return the projectId value. - */ - public String projectId() { - return this.projectId; - } - - /** - * Set the projectId property: Project ID field of the API key (write only). - * - * @param projectId the projectId value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withProjectId(String projectId) { - this.projectId = projectId; - return this; - } - - /** - * Get the privateKeyId property: Private key ID field of the API key (write only). - * - * @return the privateKeyId value. - */ - public String privateKeyId() { - return this.privateKeyId; - } - - /** - * Set the privateKeyId property: Private key ID field of the API key (write only). - * - * @param privateKeyId the privateKeyId value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withPrivateKeyId(String privateKeyId) { - this.privateKeyId = privateKeyId; - return this; - } - - /** - * Get the privateKey property: Private key field of the API key (write only). - * - * @return the privateKey value. - */ - public String privateKey() { - return this.privateKey; - } - - /** - * Set the privateKey property: Private key field of the API key (write only). - * - * @param privateKey the privateKey value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withPrivateKey(String privateKey) { - this.privateKey = privateKey; - return this; - } - - /** - * Get the clientEmail property: Client email field of the API key (write only). - * - * @return the clientEmail value. - */ - public String clientEmail() { - return this.clientEmail; - } - - /** - * Set the clientEmail property: Client email field of the API key (write only). - * - * @param clientEmail the clientEmail value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withClientEmail(String clientEmail) { - this.clientEmail = clientEmail; - return this; - } - - /** - * Get the clientId property: Client ID field of the API key (write only). - * - * @return the clientId value. - */ - public String clientId() { - return this.clientId; - } - - /** - * Set the clientId property: Client ID field of the API key (write only). - * - * @param clientId the clientId value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withClientId(String clientId) { - this.clientId = clientId; - return this; - } - - /** - * Get the authUri property: Auth URI field of the API key (write only). - * - * @return the authUri value. - */ - public String authUri() { - return this.authUri; - } - - /** - * Set the authUri property: Auth URI field of the API key (write only). - * - * @param authUri the authUri value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withAuthUri(String authUri) { - this.authUri = authUri; - return this; - } - - /** - * Get the tokenUri property: Token URI field of the API key (write only). - * - * @return the tokenUri value. - */ - public String tokenUri() { - return this.tokenUri; - } - - /** - * Set the tokenUri property: Token URI field of the API key (write only). - * - * @param tokenUri the tokenUri value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withTokenUri(String tokenUri) { - this.tokenUri = tokenUri; - return this; - } - - /** - * Get the authProviderX509CertUrl property: Auth provider x509 certificate URL field of the API key (write only). - * - * @return the authProviderX509CertUrl value. - */ - public String authProviderX509CertUrl() { - return this.authProviderX509CertUrl; - } - - /** - * Set the authProviderX509CertUrl property: Auth provider x509 certificate URL field of the API key (write only). - * - * @param authProviderX509CertUrl the authProviderX509CertUrl value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withAuthProviderX509CertUrl(String authProviderX509CertUrl) { - this.authProviderX509CertUrl = authProviderX509CertUrl; - return this; - } - - /** - * Get the clientX509CertUrl property: Client x509 certificate URL field of the API key (write only). - * - * @return the clientX509CertUrl value. - */ - public String clientX509CertUrl() { - return this.clientX509CertUrl; - } - - /** - * Set the clientX509CertUrl property: Client x509 certificate URL field of the API key (write only). - * - * @param clientX509CertUrl the clientX509CertUrl value to set. - * @return the GcpCredentialsDetailsProperties object itself. - */ - public GcpCredentialsDetailsProperties withClientX509CertUrl(String clientX509CertUrl) { - this.clientX509CertUrl = clientX509CertUrl; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (organizationId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property organizationId in model GcpCredentialsDetailsProperties")); - } - if (type() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property type in model GcpCredentialsDetailsProperties")); - } - if (projectId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property projectId in model GcpCredentialsDetailsProperties")); - } - if (privateKeyId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property privateKeyId in model GcpCredentialsDetailsProperties")); - } - if (privateKey() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property privateKey in model GcpCredentialsDetailsProperties")); - } - if (clientEmail() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property clientEmail in model GcpCredentialsDetailsProperties")); - } - if (clientId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property clientId in model GcpCredentialsDetailsProperties")); - } - if (authUri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property authUri in model GcpCredentialsDetailsProperties")); - } - if (tokenUri() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property tokenUri in model GcpCredentialsDetailsProperties")); - } - if (authProviderX509CertUrl() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property authProviderX509CertUrl in model GcpCredentialsDetailsProperties")); - } - if (clientX509CertUrl() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property clientX509CertUrl in model GcpCredentialsDetailsProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(GcpCredentialsDetailsProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalData.java deleted file mode 100644 index 4dabcf13f820..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalData.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.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The gcpOrganization data. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "organizationMembershipType", - defaultImpl = GcpOrganizationalData.class) -@JsonTypeName("GcpOrganizationalData") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Organization", value = GcpOrganizationalDataOrganization.class), - @JsonSubTypes.Type(name = "Member", value = GcpOrganizationalDataMember.class) -}) -@Immutable -public class GcpOrganizationalData { - /** Creates an instance of GcpOrganizationalData class. */ - public GcpOrganizationalData() { - } - - /** - * 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/GcpOrganizationalDataMember.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataMember.java deleted file mode 100644 index 7fda4d5a6317..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataMember.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The gcpOrganization data for the member account. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "organizationMembershipType") -@JsonTypeName("Member") -@Fluent -public final class GcpOrganizationalDataMember extends GcpOrganizationalData { - /* - * If the multi cloud account is not of membership type organization, this will be the ID of the project's parent - */ - @JsonProperty(value = "parentHierarchyId") - private String parentHierarchyId; - - /* - * The GCP management project number from organizational onboarding - */ - @JsonProperty(value = "managementProjectNumber") - private String managementProjectNumber; - - /** Creates an instance of GcpOrganizationalDataMember class. */ - public GcpOrganizationalDataMember() { - } - - /** - * Get the parentHierarchyId property: If the multi cloud account is not of membership type organization, this will - * be the ID of the project's parent. - * - * @return the parentHierarchyId value. - */ - public String parentHierarchyId() { - return this.parentHierarchyId; - } - - /** - * Set the parentHierarchyId property: If the multi cloud account is not of membership type organization, this will - * be the ID of the project's parent. - * - * @param parentHierarchyId the parentHierarchyId value to set. - * @return the GcpOrganizationalDataMember object itself. - */ - public GcpOrganizationalDataMember withParentHierarchyId(String parentHierarchyId) { - this.parentHierarchyId = parentHierarchyId; - return this; - } - - /** - * Get the managementProjectNumber property: The GCP management project number from organizational onboarding. - * - * @return the managementProjectNumber value. - */ - public String managementProjectNumber() { - return this.managementProjectNumber; - } - - /** - * Set the managementProjectNumber property: The GCP management project number from organizational onboarding. - * - * @param managementProjectNumber the managementProjectNumber value to set. - * @return the GcpOrganizationalDataMember object itself. - */ - public GcpOrganizationalDataMember withManagementProjectNumber(String managementProjectNumber) { - this.managementProjectNumber = managementProjectNumber; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataOrganization.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataOrganization.java deleted file mode 100644 index fc324cde8326..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpOrganizationalDataOrganization.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** The gcpOrganization data for the parent account. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "organizationMembershipType") -@JsonTypeName("Organization") -@Fluent -public final class GcpOrganizationalDataOrganization extends GcpOrganizationalData { - /* - * If the multi cloud account is of membership type organization, list of accounts excluded from offering - */ - @JsonProperty(value = "excludedProjectNumbers") - private List excludedProjectNumbers; - - /* - * The service account email address which represents the organization level permissions container. - */ - @JsonProperty(value = "serviceAccountEmailAddress") - private String serviceAccountEmailAddress; - - /* - * The GCP workload identity provider id which represents the permissions required to auto provision security - * connectors - */ - @JsonProperty(value = "workloadIdentityProviderId") - private String workloadIdentityProviderId; - - /* - * GCP organization name - */ - @JsonProperty(value = "organizationName", access = JsonProperty.Access.WRITE_ONLY) - private String organizationName; - - /** Creates an instance of GcpOrganizationalDataOrganization class. */ - public GcpOrganizationalDataOrganization() { - } - - /** - * Get the excludedProjectNumbers property: If the multi cloud account is of membership type organization, list of - * accounts excluded from offering. - * - * @return the excludedProjectNumbers value. - */ - public List excludedProjectNumbers() { - return this.excludedProjectNumbers; - } - - /** - * Set the excludedProjectNumbers property: If the multi cloud account is of membership type organization, list of - * accounts excluded from offering. - * - * @param excludedProjectNumbers the excludedProjectNumbers value to set. - * @return the GcpOrganizationalDataOrganization object itself. - */ - public GcpOrganizationalDataOrganization withExcludedProjectNumbers(List excludedProjectNumbers) { - this.excludedProjectNumbers = excludedProjectNumbers; - return this; - } - - /** - * Get the serviceAccountEmailAddress property: The service account email address which represents the organization - * level permissions container. - * - * @return the serviceAccountEmailAddress value. - */ - public String serviceAccountEmailAddress() { - return this.serviceAccountEmailAddress; - } - - /** - * Set the serviceAccountEmailAddress property: The service account email address which represents the organization - * level permissions container. - * - * @param serviceAccountEmailAddress the serviceAccountEmailAddress value to set. - * @return the GcpOrganizationalDataOrganization object itself. - */ - public GcpOrganizationalDataOrganization withServiceAccountEmailAddress(String serviceAccountEmailAddress) { - this.serviceAccountEmailAddress = serviceAccountEmailAddress; - return this; - } - - /** - * Get the workloadIdentityProviderId property: The GCP workload identity provider id which represents the - * permissions required to auto provision security connectors. - * - * @return the workloadIdentityProviderId value. - */ - public String workloadIdentityProviderId() { - return this.workloadIdentityProviderId; - } - - /** - * Set the workloadIdentityProviderId property: The GCP workload identity provider id which represents the - * permissions required to auto provision security connectors. - * - * @param workloadIdentityProviderId the workloadIdentityProviderId value to set. - * @return the GcpOrganizationalDataOrganization object itself. - */ - public GcpOrganizationalDataOrganization withWorkloadIdentityProviderId(String workloadIdentityProviderId) { - this.workloadIdentityProviderId = workloadIdentityProviderId; - return this; - } - - /** - * Get the organizationName property: GCP organization name. - * - * @return the organizationName value. - */ - public String organizationName() { - return this.organizationName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectDetails.java deleted file mode 100644 index ac6bbd2acf3f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectDetails.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The details about the project represented by the security connector. */ -@Fluent -public final class GcpProjectDetails { - /* - * The unique GCP Project number - */ - @JsonProperty(value = "projectNumber") - private String projectNumber; - - /* - * The GCP Project id - */ - @JsonProperty(value = "projectId") - private String projectId; - - /* - * The GCP workload identity federation pool id - */ - @JsonProperty(value = "workloadIdentityPoolId", access = JsonProperty.Access.WRITE_ONLY) - private String workloadIdentityPoolId; - - /* - * GCP project name - */ - @JsonProperty(value = "projectName", access = JsonProperty.Access.WRITE_ONLY) - private String projectName; - - /** Creates an instance of GcpProjectDetails class. */ - public GcpProjectDetails() { - } - - /** - * Get the projectNumber property: The unique GCP Project number. - * - * @return the projectNumber value. - */ - public String projectNumber() { - return this.projectNumber; - } - - /** - * Set the projectNumber property: The unique GCP Project number. - * - * @param projectNumber the projectNumber value to set. - * @return the GcpProjectDetails object itself. - */ - public GcpProjectDetails withProjectNumber(String projectNumber) { - this.projectNumber = projectNumber; - return this; - } - - /** - * Get the projectId property: The GCP Project id. - * - * @return the projectId value. - */ - public String projectId() { - return this.projectId; - } - - /** - * Set the projectId property: The GCP Project id. - * - * @param projectId the projectId value to set. - * @return the GcpProjectDetails object itself. - */ - public GcpProjectDetails withProjectId(String projectId) { - this.projectId = projectId; - return this; - } - - /** - * Get the workloadIdentityPoolId property: The GCP workload identity federation pool id. - * - * @return the workloadIdentityPoolId value. - */ - public String workloadIdentityPoolId() { - return this.workloadIdentityPoolId; - } - - /** - * Get the projectName property: GCP project name. - * - * @return the projectName value. - */ - public String projectName() { - return this.projectName; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectEnvironmentData.java deleted file mode 100644 index 68697c94c1f4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GcpProjectEnvironmentData.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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The GCP project connector environment data. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "environmentType") -@JsonTypeName("GcpProject") -@Fluent -public final class GcpProjectEnvironmentData extends EnvironmentData { - /* - * The Gcp project's organizational data - */ - @JsonProperty(value = "organizationalData") - private GcpOrganizationalData organizationalData; - - /* - * The Gcp project's details - */ - @JsonProperty(value = "projectDetails") - private GcpProjectDetails projectDetails; - - /** Creates an instance of GcpProjectEnvironmentData class. */ - public GcpProjectEnvironmentData() { - } - - /** - * Get the organizationalData property: The Gcp project's organizational data. - * - * @return the organizationalData value. - */ - public GcpOrganizationalData organizationalData() { - return this.organizationalData; - } - - /** - * Set the organizationalData property: The Gcp project's organizational data. - * - * @param organizationalData the organizationalData value to set. - * @return the GcpProjectEnvironmentData object itself. - */ - public GcpProjectEnvironmentData withOrganizationalData(GcpOrganizationalData organizationalData) { - this.organizationalData = organizationalData; - return this; - } - - /** - * Get the projectDetails property: The Gcp project's details. - * - * @return the projectDetails value. - */ - public GcpProjectDetails projectDetails() { - return this.projectDetails; - } - - /** - * Set the projectDetails property: The Gcp project's details. - * - * @param projectDetails the projectDetails value to set. - * @return the GcpProjectEnvironmentData object itself. - */ - public GcpProjectEnvironmentData withProjectDetails(GcpProjectDetails projectDetails) { - this.projectDetails = projectDetails; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (organizationalData() != null) { - organizationalData().validate(); - } - if (projectDetails() != null) { - projectDetails().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GithubScopeEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GithubScopeEnvironmentData.java deleted file mode 100644 index 15bdf9ab57ff..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GithubScopeEnvironmentData.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The github scope connector's environment data. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "environmentType") -@JsonTypeName("GithubScope") -@Immutable -public final class GithubScopeEnvironmentData extends EnvironmentData { - /** Creates an instance of GithubScopeEnvironmentData class. */ - public GithubScopeEnvironmentData() { - } - - /** - * 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/GitlabScopeEnvironmentData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitlabScopeEnvironmentData.java deleted file mode 100644 index 514c6e578d4f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GitlabScopeEnvironmentData.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The GitLab scope connector's environment data. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "environmentType") -@JsonTypeName("GitlabScope") -@Immutable -public final class GitlabScopeEnvironmentData extends EnvironmentData { - /** Creates an instance of GitlabScopeEnvironmentData class. */ - public GitlabScopeEnvironmentData() { - } - - /** - * 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/GovernanceAssignment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignment.java deleted file mode 100644 index 8d0fb0553d18..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignment.java +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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.GovernanceAssignmentInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of GovernanceAssignment. */ -public interface GovernanceAssignment { - /** - * 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 owner property: The Owner for the governance assignment - e.g. user@contoso.com - see example. - * - * @return the owner value. - */ - String owner(); - - /** - * Gets the remediationDueDate property: The remediation due-date - after this date Secure Score will be affected - * (in case of active grace-period). - * - * @return the remediationDueDate value. - */ - OffsetDateTime remediationDueDate(); - - /** - * Gets the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), see example. - * - * @return the remediationEta value. - */ - RemediationEta remediationEta(); - - /** - * Gets the isGracePeriod property: Defines whether there is a grace period on the governance assignment. - * - * @return the isGracePeriod value. - */ - Boolean isGracePeriod(); - - /** - * Gets the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @return the governanceEmailNotification value. - */ - GovernanceEmailNotification governanceEmailNotification(); - - /** - * Gets the additionalData property: The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * - * @return the additionalData value. - */ - GovernanceAssignmentAdditionalData additionalData(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner object. - * - * @return the inner object. - */ - GovernanceAssignmentInner innerModel(); - - /** The entirety of the GovernanceAssignment definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { - } - /** The GovernanceAssignment definition stages. */ - interface DefinitionStages { - /** The first stage of the GovernanceAssignment definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the GovernanceAssignment definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies scope, assessmentName. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @return the next definition stage. - */ - WithCreate withExistingAssessment(String scope, String assessmentName); - } - /** - * The stage of the GovernanceAssignment definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithOwner, - DefinitionStages.WithRemediationDueDate, - DefinitionStages.WithRemediationEta, - DefinitionStages.WithIsGracePeriod, - DefinitionStages.WithGovernanceEmailNotification, - DefinitionStages.WithAdditionalData { - /** - * Executes the create request. - * - * @return the created resource. - */ - GovernanceAssignment create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - GovernanceAssignment create(Context context); - } - /** The stage of the GovernanceAssignment definition allowing to specify owner. */ - interface WithOwner { - /** - * Specifies the owner property: The Owner for the governance assignment - e.g. user@contoso.com - see - * example. - * - * @param owner The Owner for the governance assignment - e.g. user@contoso.com - see example. - * @return the next definition stage. - */ - WithCreate withOwner(String owner); - } - /** The stage of the GovernanceAssignment definition allowing to specify remediationDueDate. */ - interface WithRemediationDueDate { - /** - * Specifies the remediationDueDate property: The remediation due-date - after this date Secure Score will - * be affected (in case of active grace-period). - * - * @param remediationDueDate The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * @return the next definition stage. - */ - WithCreate withRemediationDueDate(OffsetDateTime remediationDueDate); - } - /** The stage of the GovernanceAssignment definition allowing to specify remediationEta. */ - interface WithRemediationEta { - /** - * Specifies the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), - * see example. - * - * @param remediationEta The ETA (estimated time of arrival) for remediation (optional), see example. - * @return the next definition stage. - */ - WithCreate withRemediationEta(RemediationEta remediationEta); - } - /** The stage of the GovernanceAssignment definition allowing to specify isGracePeriod. */ - interface WithIsGracePeriod { - /** - * Specifies the isGracePeriod property: Defines whether there is a grace period on the governance - * assignment. - * - * @param isGracePeriod Defines whether there is a grace period on the governance assignment. - * @return the next definition stage. - */ - WithCreate withIsGracePeriod(Boolean isGracePeriod); - } - /** The stage of the GovernanceAssignment definition allowing to specify governanceEmailNotification. */ - interface WithGovernanceEmailNotification { - /** - * Specifies the governanceEmailNotification property: The email notifications settings for the governance - * rule, states whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * @return the next definition stage. - */ - WithCreate withGovernanceEmailNotification(GovernanceEmailNotification governanceEmailNotification); - } - /** The stage of the GovernanceAssignment definition allowing to specify additionalData. */ - interface WithAdditionalData { - /** - * Specifies the additionalData property: The additional data for the governance assignment - e.g. links to - * ticket (optional), see example. - * - * @param additionalData The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * @return the next definition stage. - */ - WithCreate withAdditionalData(GovernanceAssignmentAdditionalData additionalData); - } - } - /** - * Begins update for the GovernanceAssignment resource. - * - * @return the stage of resource update. - */ - GovernanceAssignment.Update update(); - - /** The template for GovernanceAssignment update. */ - interface Update - extends UpdateStages.WithOwner, - UpdateStages.WithRemediationDueDate, - UpdateStages.WithRemediationEta, - UpdateStages.WithIsGracePeriod, - UpdateStages.WithGovernanceEmailNotification, - UpdateStages.WithAdditionalData { - /** - * Executes the update request. - * - * @return the updated resource. - */ - GovernanceAssignment apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - GovernanceAssignment apply(Context context); - } - /** The GovernanceAssignment update stages. */ - interface UpdateStages { - /** The stage of the GovernanceAssignment update allowing to specify owner. */ - interface WithOwner { - /** - * Specifies the owner property: The Owner for the governance assignment - e.g. user@contoso.com - see - * example. - * - * @param owner The Owner for the governance assignment - e.g. user@contoso.com - see example. - * @return the next definition stage. - */ - Update withOwner(String owner); - } - /** The stage of the GovernanceAssignment update allowing to specify remediationDueDate. */ - interface WithRemediationDueDate { - /** - * Specifies the remediationDueDate property: The remediation due-date - after this date Secure Score will - * be affected (in case of active grace-period). - * - * @param remediationDueDate The remediation due-date - after this date Secure Score will be affected (in - * case of active grace-period). - * @return the next definition stage. - */ - Update withRemediationDueDate(OffsetDateTime remediationDueDate); - } - /** The stage of the GovernanceAssignment update allowing to specify remediationEta. */ - interface WithRemediationEta { - /** - * Specifies the remediationEta property: The ETA (estimated time of arrival) for remediation (optional), - * see example. - * - * @param remediationEta The ETA (estimated time of arrival) for remediation (optional), see example. - * @return the next definition stage. - */ - Update withRemediationEta(RemediationEta remediationEta); - } - /** The stage of the GovernanceAssignment update allowing to specify isGracePeriod. */ - interface WithIsGracePeriod { - /** - * Specifies the isGracePeriod property: Defines whether there is a grace period on the governance - * assignment. - * - * @param isGracePeriod Defines whether there is a grace period on the governance assignment. - * @return the next definition stage. - */ - Update withIsGracePeriod(Boolean isGracePeriod); - } - /** The stage of the GovernanceAssignment update allowing to specify governanceEmailNotification. */ - interface WithGovernanceEmailNotification { - /** - * Specifies the governanceEmailNotification property: The email notifications settings for the governance - * rule, states whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * @return the next definition stage. - */ - Update withGovernanceEmailNotification(GovernanceEmailNotification governanceEmailNotification); - } - /** The stage of the GovernanceAssignment update allowing to specify additionalData. */ - interface WithAdditionalData { - /** - * Specifies the additionalData property: The additional data for the governance assignment - e.g. links to - * ticket (optional), see example. - * - * @param additionalData The additional data for the governance assignment - e.g. links to ticket - * (optional), see example. - * @return the next definition stage. - */ - Update withAdditionalData(GovernanceAssignmentAdditionalData additionalData); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - GovernanceAssignment refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - GovernanceAssignment refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentAdditionalData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentAdditionalData.java deleted file mode 100644 index 5e3045c9ce81..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentAdditionalData.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describe the additional data of governance assignment - optional. */ -@Fluent -public final class GovernanceAssignmentAdditionalData { - /* - * Ticket number associated with this governance assignment - */ - @JsonProperty(value = "ticketNumber") - private Integer ticketNumber; - - /* - * Ticket link associated with this governance assignment - for example: https://snow.com - */ - @JsonProperty(value = "ticketLink") - private String ticketLink; - - /* - * The ticket status associated with this governance assignment - for example: Active - */ - @JsonProperty(value = "ticketStatus") - private String ticketStatus; - - /** Creates an instance of GovernanceAssignmentAdditionalData class. */ - public GovernanceAssignmentAdditionalData() { - } - - /** - * Get the ticketNumber property: Ticket number associated with this governance assignment. - * - * @return the ticketNumber value. - */ - public Integer ticketNumber() { - return this.ticketNumber; - } - - /** - * Set the ticketNumber property: Ticket number associated with this governance assignment. - * - * @param ticketNumber the ticketNumber value to set. - * @return the GovernanceAssignmentAdditionalData object itself. - */ - public GovernanceAssignmentAdditionalData withTicketNumber(Integer ticketNumber) { - this.ticketNumber = ticketNumber; - return this; - } - - /** - * Get the ticketLink property: Ticket link associated with this governance assignment - for example: - * https://snow.com. - * - * @return the ticketLink value. - */ - public String ticketLink() { - return this.ticketLink; - } - - /** - * Set the ticketLink property: Ticket link associated with this governance assignment - for example: - * https://snow.com. - * - * @param ticketLink the ticketLink value to set. - * @return the GovernanceAssignmentAdditionalData object itself. - */ - public GovernanceAssignmentAdditionalData withTicketLink(String ticketLink) { - this.ticketLink = ticketLink; - return this; - } - - /** - * Get the ticketStatus property: The ticket status associated with this governance assignment - for example: - * Active. - * - * @return the ticketStatus value. - */ - public String ticketStatus() { - return this.ticketStatus; - } - - /** - * Set the ticketStatus property: The ticket status associated with this governance assignment - for example: - * Active. - * - * @param ticketStatus the ticketStatus value to set. - * @return the GovernanceAssignmentAdditionalData object itself. - */ - public GovernanceAssignmentAdditionalData withTicketStatus(String ticketStatus) { - this.ticketStatus = ticketStatus; - 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/GovernanceAssignments.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignments.java deleted file mode 100644 index ee86df36eed0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignments.java +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of GovernanceAssignments. */ -public interface GovernanceAssignments { - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(String scope, String assessmentName); - - /** - * Get governance assignments on all of your resources inside a scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance assignments on all of your resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(String scope, String assessmentName, Context context); - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey along with {@link Response}. - */ - Response getWithResponse( - String scope, String assessmentName, String assignmentKey, Context context); - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey. - */ - GovernanceAssignment get(String scope, String assessmentName, String assignmentKey); - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String scope, String assessmentName, String assignmentKey, Context context); - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param scope The scope of the Governance assignments. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param assessmentName The Assessment Key - A unique key for the assessment type. - * @param assignmentKey The governance assignment key - the assessment key of the required governance assignment. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String scope, String assessmentName, String assignmentKey); - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey along with {@link Response}. - */ - GovernanceAssignment getById(String id); - - /** - * Get a specific governanceAssignment for the requested scope by AssignmentKey. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governanceAssignment for the requested scope by AssignmentKey along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a GovernanceAssignment over a given scope. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new GovernanceAssignment resource. - * - * @param name resource name. - * @return the first stage of the new GovernanceAssignment definition. - */ - GovernanceAssignment.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentsList.java deleted file mode 100644 index e1d3c1e584e1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceAssignmentsList.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.resourcemanager.security.fluent.models.GovernanceAssignmentInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Page of a governance assignments list. */ -@Immutable -public final class GovernanceAssignmentsList { - /* - * Collection of governance assignments in this page - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of GovernanceAssignmentsList class. */ - public GovernanceAssignmentsList() { - } - - /** - * Get the value property: Collection of governance assignments in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceEmailNotification.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceEmailNotification.java deleted file mode 100644 index 78d051477224..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceEmailNotification.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The governance email weekly notification configuration. */ -@Fluent -public final class GovernanceEmailNotification { - /* - * Exclude manager from weekly email notification. - */ - @JsonProperty(value = "disableManagerEmailNotification") - private Boolean disableManagerEmailNotification; - - /* - * Exclude owner from weekly email notification. - */ - @JsonProperty(value = "disableOwnerEmailNotification") - private Boolean disableOwnerEmailNotification; - - /** Creates an instance of GovernanceEmailNotification class. */ - public GovernanceEmailNotification() { - } - - /** - * Get the disableManagerEmailNotification property: Exclude manager from weekly email notification. - * - * @return the disableManagerEmailNotification value. - */ - public Boolean disableManagerEmailNotification() { - return this.disableManagerEmailNotification; - } - - /** - * Set the disableManagerEmailNotification property: Exclude manager from weekly email notification. - * - * @param disableManagerEmailNotification the disableManagerEmailNotification value to set. - * @return the GovernanceEmailNotification object itself. - */ - public GovernanceEmailNotification withDisableManagerEmailNotification(Boolean disableManagerEmailNotification) { - this.disableManagerEmailNotification = disableManagerEmailNotification; - return this; - } - - /** - * Get the disableOwnerEmailNotification property: Exclude owner from weekly email notification. - * - * @return the disableOwnerEmailNotification value. - */ - public Boolean disableOwnerEmailNotification() { - return this.disableOwnerEmailNotification; - } - - /** - * Set the disableOwnerEmailNotification property: Exclude owner from weekly email notification. - * - * @param disableOwnerEmailNotification the disableOwnerEmailNotification value to set. - * @return the GovernanceEmailNotification object itself. - */ - public GovernanceEmailNotification withDisableOwnerEmailNotification(Boolean disableOwnerEmailNotification) { - this.disableOwnerEmailNotification = disableOwnerEmailNotification; - 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/GovernanceRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRule.java deleted file mode 100644 index 29fee19b4c66..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRule.java +++ /dev/null @@ -1,588 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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.GovernanceRuleInner; -import java.util.List; - -/** An immutable client-side representation of GovernanceRule. */ -public interface GovernanceRule { - /** - * 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 tenantId property: The tenantId (GUID). - * - * @return the tenantId value. - */ - String tenantId(); - - /** - * Gets the displayName property: Display name of the governance rule. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the description property: Description of the governance rule. - * - * @return the description value. - */ - String description(); - - /** - * Gets the remediationTimeframe property: Governance rule remediation timeframe - this is the time that will affect - * on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @return the remediationTimeframe value. - */ - String remediationTimeframe(); - - /** - * Gets the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @return the isGracePeriod value. - */ - Boolean isGracePeriod(); - - /** - * Gets the rulePriority property: The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * - * @return the rulePriority value. - */ - int rulePriority(); - - /** - * Gets the isDisabled property: Defines whether the rule is active/inactive. - * - * @return the isDisabled value. - */ - Boolean isDisabled(); - - /** - * Gets the ruleType property: The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * - * @return the ruleType value. - */ - GovernanceRuleType ruleType(); - - /** - * Gets the sourceResourceType property: The governance rule source, what the rule affects, e.g. Assessments. - * - * @return the sourceResourceType value. - */ - GovernanceRuleSourceResourceType sourceResourceType(); - - /** - * Gets the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on management - * scopes). - * - * @return the excludedScopes value. - */ - List excludedScopes(); - - /** - * Gets the conditionSets property: The governance rule conditionSets - see examples. - * - * @return the conditionSets value. - */ - List conditionSets(); - - /** - * Gets the includeMemberScopes property: Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * - * @return the includeMemberScopes value. - */ - Boolean includeMemberScopes(); - - /** - * Gets the ownerSource property: The owner source for the governance rule - e.g. Manually by user@contoso.com - see - * example. - * - * @return the ownerSource value. - */ - GovernanceRuleOwnerSource ownerSource(); - - /** - * Gets the governanceEmailNotification property: The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * - * @return the governanceEmailNotification value. - */ - GovernanceRuleEmailNotification governanceEmailNotification(); - - /** - * Gets the metadata property: The governance rule metadata. - * - * @return the metadata value. - */ - GovernanceRuleMetadata metadata(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner object. - * - * @return the inner object. - */ - GovernanceRuleInner innerModel(); - - /** The entirety of the GovernanceRule definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - /** The GovernanceRule definition stages. */ - interface DefinitionStages { - /** The first stage of the GovernanceRule definition. */ - interface Blank extends WithScope { - } - /** The stage of the GovernanceRule definition allowing to specify parent resource. */ - interface WithScope { - /** - * Specifies scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @return the next definition stage. - */ - WithCreate withExistingScope(String scope); - } - /** - * The stage of the GovernanceRule definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithDisplayName, - DefinitionStages.WithDescription, - DefinitionStages.WithRemediationTimeframe, - DefinitionStages.WithIsGracePeriod, - DefinitionStages.WithRulePriority, - DefinitionStages.WithIsDisabled, - DefinitionStages.WithRuleType, - DefinitionStages.WithSourceResourceType, - DefinitionStages.WithExcludedScopes, - DefinitionStages.WithConditionSets, - DefinitionStages.WithIncludeMemberScopes, - DefinitionStages.WithOwnerSource, - DefinitionStages.WithGovernanceEmailNotification, - DefinitionStages.WithMetadata { - /** - * Executes the create request. - * - * @return the created resource. - */ - GovernanceRule create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - GovernanceRule create(Context context); - } - /** The stage of the GovernanceRule definition allowing to specify displayName. */ - interface WithDisplayName { - /** - * Specifies the displayName property: Display name of the governance rule. - * - * @param displayName Display name of the governance rule. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - /** The stage of the GovernanceRule definition allowing to specify description. */ - interface WithDescription { - /** - * Specifies the description property: Description of the governance rule. - * - * @param description Description of the governance rule. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - /** The stage of the GovernanceRule definition allowing to specify remediationTimeframe. */ - interface WithRemediationTimeframe { - /** - * Specifies the remediationTimeframe property: Governance rule remediation timeframe - this is the time - * that will affect on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @param remediationTimeframe Governance rule remediation timeframe - this is the time that will affect on - * the grace-period duration e.g. 7.00:00:00 - means 7 days. - * @return the next definition stage. - */ - WithCreate withRemediationTimeframe(String remediationTimeframe); - } - /** The stage of the GovernanceRule definition allowing to specify isGracePeriod. */ - interface WithIsGracePeriod { - /** - * Specifies the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @param isGracePeriod Defines whether there is a grace period on the governance rule. - * @return the next definition stage. - */ - WithCreate withIsGracePeriod(Boolean isGracePeriod); - } - /** The stage of the GovernanceRule definition allowing to specify rulePriority. */ - interface WithRulePriority { - /** - * Specifies the rulePriority property: The governance rule priority, priority to the lower number. Rules - * with the same priority on the same scope will not be allowed. - * - * @param rulePriority The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * @return the next definition stage. - */ - WithCreate withRulePriority(int rulePriority); - } - /** The stage of the GovernanceRule definition allowing to specify isDisabled. */ - interface WithIsDisabled { - /** - * Specifies the isDisabled property: Defines whether the rule is active/inactive. - * - * @param isDisabled Defines whether the rule is active/inactive. - * @return the next definition stage. - */ - WithCreate withIsDisabled(Boolean isDisabled); - } - /** The stage of the GovernanceRule definition allowing to specify ruleType. */ - interface WithRuleType { - /** - * Specifies the ruleType property: The rule type of the governance rule, defines the source of the rule - * e.g. Integrated. - * - * @param ruleType The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * @return the next definition stage. - */ - WithCreate withRuleType(GovernanceRuleType ruleType); - } - /** The stage of the GovernanceRule definition allowing to specify sourceResourceType. */ - interface WithSourceResourceType { - /** - * Specifies the sourceResourceType property: The governance rule source, what the rule affects, e.g. - * Assessments. - * - * @param sourceResourceType The governance rule source, what the rule affects, e.g. Assessments. - * @return the next definition stage. - */ - WithCreate withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType); - } - /** The stage of the GovernanceRule definition allowing to specify excludedScopes. */ - interface WithExcludedScopes { - /** - * Specifies the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on - * management scopes). - * - * @param excludedScopes Excluded scopes, filter out the descendants of the scope (on management scopes). - * @return the next definition stage. - */ - WithCreate withExcludedScopes(List excludedScopes); - } - /** The stage of the GovernanceRule definition allowing to specify conditionSets. */ - interface WithConditionSets { - /** - * Specifies the conditionSets property: The governance rule conditionSets - see examples. - * - * @param conditionSets The governance rule conditionSets - see examples. - * @return the next definition stage. - */ - WithCreate withConditionSets(List conditionSets); - } - /** The stage of the GovernanceRule definition allowing to specify includeMemberScopes. */ - interface WithIncludeMemberScopes { - /** - * Specifies the includeMemberScopes property: Defines whether the rule is management scope rule (master - * connector as a single scope or management scope). - * - * @param includeMemberScopes Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * @return the next definition stage. - */ - WithCreate withIncludeMemberScopes(Boolean includeMemberScopes); - } - /** The stage of the GovernanceRule definition allowing to specify ownerSource. */ - interface WithOwnerSource { - /** - * Specifies the ownerSource property: The owner source for the governance rule - e.g. Manually by - * user@contoso.com - see example. - * - * @param ownerSource The owner source for the governance rule - e.g. Manually by user@contoso.com - see - * example. - * @return the next definition stage. - */ - WithCreate withOwnerSource(GovernanceRuleOwnerSource ownerSource); - } - /** The stage of the GovernanceRule definition allowing to specify governanceEmailNotification. */ - interface WithGovernanceEmailNotification { - /** - * Specifies the governanceEmailNotification property: The email notifications settings for the governance - * rule, states whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * @return the next definition stage. - */ - WithCreate withGovernanceEmailNotification(GovernanceRuleEmailNotification governanceEmailNotification); - } - /** The stage of the GovernanceRule definition allowing to specify metadata. */ - interface WithMetadata { - /** - * Specifies the metadata property: The governance rule metadata. - * - * @param metadata The governance rule metadata. - * @return the next definition stage. - */ - WithCreate withMetadata(GovernanceRuleMetadata metadata); - } - } - /** - * Begins update for the GovernanceRule resource. - * - * @return the stage of resource update. - */ - GovernanceRule.Update update(); - - /** The template for GovernanceRule update. */ - interface Update - extends UpdateStages.WithDisplayName, - UpdateStages.WithDescription, - UpdateStages.WithRemediationTimeframe, - UpdateStages.WithIsGracePeriod, - UpdateStages.WithRulePriority, - UpdateStages.WithIsDisabled, - UpdateStages.WithRuleType, - UpdateStages.WithSourceResourceType, - UpdateStages.WithExcludedScopes, - UpdateStages.WithConditionSets, - UpdateStages.WithIncludeMemberScopes, - UpdateStages.WithOwnerSource, - UpdateStages.WithGovernanceEmailNotification, - UpdateStages.WithMetadata { - /** - * Executes the update request. - * - * @return the updated resource. - */ - GovernanceRule apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - GovernanceRule apply(Context context); - } - /** The GovernanceRule update stages. */ - interface UpdateStages { - /** The stage of the GovernanceRule update allowing to specify displayName. */ - interface WithDisplayName { - /** - * Specifies the displayName property: Display name of the governance rule. - * - * @param displayName Display name of the governance rule. - * @return the next definition stage. - */ - Update withDisplayName(String displayName); - } - /** The stage of the GovernanceRule update allowing to specify description. */ - interface WithDescription { - /** - * Specifies the description property: Description of the governance rule. - * - * @param description Description of the governance rule. - * @return the next definition stage. - */ - Update withDescription(String description); - } - /** The stage of the GovernanceRule update allowing to specify remediationTimeframe. */ - interface WithRemediationTimeframe { - /** - * Specifies the remediationTimeframe property: Governance rule remediation timeframe - this is the time - * that will affect on the grace-period duration e.g. 7.00:00:00 - means 7 days. - * - * @param remediationTimeframe Governance rule remediation timeframe - this is the time that will affect on - * the grace-period duration e.g. 7.00:00:00 - means 7 days. - * @return the next definition stage. - */ - Update withRemediationTimeframe(String remediationTimeframe); - } - /** The stage of the GovernanceRule update allowing to specify isGracePeriod. */ - interface WithIsGracePeriod { - /** - * Specifies the isGracePeriod property: Defines whether there is a grace period on the governance rule. - * - * @param isGracePeriod Defines whether there is a grace period on the governance rule. - * @return the next definition stage. - */ - Update withIsGracePeriod(Boolean isGracePeriod); - } - /** The stage of the GovernanceRule update allowing to specify rulePriority. */ - interface WithRulePriority { - /** - * Specifies the rulePriority property: The governance rule priority, priority to the lower number. Rules - * with the same priority on the same scope will not be allowed. - * - * @param rulePriority The governance rule priority, priority to the lower number. Rules with the same - * priority on the same scope will not be allowed. - * @return the next definition stage. - */ - Update withRulePriority(int rulePriority); - } - /** The stage of the GovernanceRule update allowing to specify isDisabled. */ - interface WithIsDisabled { - /** - * Specifies the isDisabled property: Defines whether the rule is active/inactive. - * - * @param isDisabled Defines whether the rule is active/inactive. - * @return the next definition stage. - */ - Update withIsDisabled(Boolean isDisabled); - } - /** The stage of the GovernanceRule update allowing to specify ruleType. */ - interface WithRuleType { - /** - * Specifies the ruleType property: The rule type of the governance rule, defines the source of the rule - * e.g. Integrated. - * - * @param ruleType The rule type of the governance rule, defines the source of the rule e.g. Integrated. - * @return the next definition stage. - */ - Update withRuleType(GovernanceRuleType ruleType); - } - /** The stage of the GovernanceRule update allowing to specify sourceResourceType. */ - interface WithSourceResourceType { - /** - * Specifies the sourceResourceType property: The governance rule source, what the rule affects, e.g. - * Assessments. - * - * @param sourceResourceType The governance rule source, what the rule affects, e.g. Assessments. - * @return the next definition stage. - */ - Update withSourceResourceType(GovernanceRuleSourceResourceType sourceResourceType); - } - /** The stage of the GovernanceRule update allowing to specify excludedScopes. */ - interface WithExcludedScopes { - /** - * Specifies the excludedScopes property: Excluded scopes, filter out the descendants of the scope (on - * management scopes). - * - * @param excludedScopes Excluded scopes, filter out the descendants of the scope (on management scopes). - * @return the next definition stage. - */ - Update withExcludedScopes(List excludedScopes); - } - /** The stage of the GovernanceRule update allowing to specify conditionSets. */ - interface WithConditionSets { - /** - * Specifies the conditionSets property: The governance rule conditionSets - see examples. - * - * @param conditionSets The governance rule conditionSets - see examples. - * @return the next definition stage. - */ - Update withConditionSets(List conditionSets); - } - /** The stage of the GovernanceRule update allowing to specify includeMemberScopes. */ - interface WithIncludeMemberScopes { - /** - * Specifies the includeMemberScopes property: Defines whether the rule is management scope rule (master - * connector as a single scope or management scope). - * - * @param includeMemberScopes Defines whether the rule is management scope rule (master connector as a - * single scope or management scope). - * @return the next definition stage. - */ - Update withIncludeMemberScopes(Boolean includeMemberScopes); - } - /** The stage of the GovernanceRule update allowing to specify ownerSource. */ - interface WithOwnerSource { - /** - * Specifies the ownerSource property: The owner source for the governance rule - e.g. Manually by - * user@contoso.com - see example. - * - * @param ownerSource The owner source for the governance rule - e.g. Manually by user@contoso.com - see - * example. - * @return the next definition stage. - */ - Update withOwnerSource(GovernanceRuleOwnerSource ownerSource); - } - /** The stage of the GovernanceRule update allowing to specify governanceEmailNotification. */ - interface WithGovernanceEmailNotification { - /** - * Specifies the governanceEmailNotification property: The email notifications settings for the governance - * rule, states whether to disable notifications for mangers and owners. - * - * @param governanceEmailNotification The email notifications settings for the governance rule, states - * whether to disable notifications for mangers and owners. - * @return the next definition stage. - */ - Update withGovernanceEmailNotification(GovernanceRuleEmailNotification governanceEmailNotification); - } - /** The stage of the GovernanceRule update allowing to specify metadata. */ - interface WithMetadata { - /** - * Specifies the metadata property: The governance rule metadata. - * - * @param metadata The governance rule metadata. - * @return the next definition stage. - */ - Update withMetadata(GovernanceRuleMetadata metadata); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - GovernanceRule refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - GovernanceRule refresh(Context context); - - /** - * Execute a governance rule. - * - * @throws com.azure.core.management.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 execute(); - - /** - * Execute a governance rule. - * - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void execute(ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleEmailNotification.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleEmailNotification.java deleted file mode 100644 index e8dce71f1fb1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleEmailNotification.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The governance email weekly notification configuration. */ -@Fluent -public final class GovernanceRuleEmailNotification { - /* - * Defines whether manager email notifications are disabled - */ - @JsonProperty(value = "disableManagerEmailNotification") - private Boolean disableManagerEmailNotification; - - /* - * Defines whether owner email notifications are disabled - */ - @JsonProperty(value = "disableOwnerEmailNotification") - private Boolean disableOwnerEmailNotification; - - /** Creates an instance of GovernanceRuleEmailNotification class. */ - public GovernanceRuleEmailNotification() { - } - - /** - * Get the disableManagerEmailNotification property: Defines whether manager email notifications are disabled. - * - * @return the disableManagerEmailNotification value. - */ - public Boolean disableManagerEmailNotification() { - return this.disableManagerEmailNotification; - } - - /** - * Set the disableManagerEmailNotification property: Defines whether manager email notifications are disabled. - * - * @param disableManagerEmailNotification the disableManagerEmailNotification value to set. - * @return the GovernanceRuleEmailNotification object itself. - */ - public GovernanceRuleEmailNotification withDisableManagerEmailNotification( - Boolean disableManagerEmailNotification) { - this.disableManagerEmailNotification = disableManagerEmailNotification; - return this; - } - - /** - * Get the disableOwnerEmailNotification property: Defines whether owner email notifications are disabled. - * - * @return the disableOwnerEmailNotification value. - */ - public Boolean disableOwnerEmailNotification() { - return this.disableOwnerEmailNotification; - } - - /** - * Set the disableOwnerEmailNotification property: Defines whether owner email notifications are disabled. - * - * @param disableOwnerEmailNotification the disableOwnerEmailNotification value to set. - * @return the GovernanceRuleEmailNotification object itself. - */ - public GovernanceRuleEmailNotification withDisableOwnerEmailNotification(Boolean disableOwnerEmailNotification) { - this.disableOwnerEmailNotification = disableOwnerEmailNotification; - 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/GovernanceRuleList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleList.java deleted file mode 100644 index f8ba5f28cd65..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleList.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.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Page of a governance rules list. */ -@Immutable -public final class GovernanceRuleList { - /* - * Collection of governance rules in this page - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of GovernanceRuleList class. */ - public GovernanceRuleList() { - } - - /** - * Get the value property: Collection of governance rules in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleMetadata.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleMetadata.java deleted file mode 100644 index 8c6b0dd86ef9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleMetadata.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The governance rule metadata. */ -@Immutable -public final class GovernanceRuleMetadata { - /* - * Governance rule Created by object id (GUID) - */ - @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY) - private String createdBy; - - /* - * Governance rule creation date - */ - @JsonProperty(value = "createdOn", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdOn; - - /* - * Governance rule last updated by object id (GUID) - */ - @JsonProperty(value = "updatedBy", access = JsonProperty.Access.WRITE_ONLY) - private String updatedBy; - - /* - * Governance rule last update date - */ - @JsonProperty(value = "updatedOn", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime updatedOn; - - /** Creates an instance of GovernanceRuleMetadata class. */ - public GovernanceRuleMetadata() { - } - - /** - * Get the createdBy property: Governance rule Created by object id (GUID). - * - * @return the createdBy value. - */ - public String createdBy() { - return this.createdBy; - } - - /** - * Get the createdOn property: Governance rule creation date. - * - * @return the createdOn value. - */ - public OffsetDateTime createdOn() { - return this.createdOn; - } - - /** - * Get the updatedBy property: Governance rule last updated by object id (GUID). - * - * @return the updatedBy value. - */ - public String updatedBy() { - return this.updatedBy; - } - - /** - * Get the updatedOn property: Governance rule last update date. - * - * @return the updatedOn value. - */ - public OffsetDateTime updatedOn() { - return this.updatedOn; - } - - /** - * 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/GovernanceRuleOwnerSource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleOwnerSource.java deleted file mode 100644 index 25f0716fbcf4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleOwnerSource.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describe the owner source of governance rule. */ -@Fluent -public final class GovernanceRuleOwnerSource { - /* - * The owner type for the governance rule owner source - */ - @JsonProperty(value = "type") - private GovernanceRuleOwnerSourceType type; - - /* - * The source value e.g. tag key like owner name or email address - */ - @JsonProperty(value = "value") - private String value; - - /** Creates an instance of GovernanceRuleOwnerSource class. */ - public GovernanceRuleOwnerSource() { - } - - /** - * Get the type property: The owner type for the governance rule owner source. - * - * @return the type value. - */ - public GovernanceRuleOwnerSourceType type() { - return this.type; - } - - /** - * Set the type property: The owner type for the governance rule owner source. - * - * @param type the type value to set. - * @return the GovernanceRuleOwnerSource object itself. - */ - public GovernanceRuleOwnerSource withType(GovernanceRuleOwnerSourceType type) { - this.type = type; - return this; - } - - /** - * Get the value property: The source value e.g. tag key like owner name or email address. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The source value e.g. tag key like owner name or email address. - * - * @param value the value value to set. - * @return the GovernanceRuleOwnerSource object itself. - */ - public GovernanceRuleOwnerSource withValue(String value) { - this.value = value; - 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/GovernanceRuleOwnerSourceType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleOwnerSourceType.java deleted file mode 100644 index 4af9cd6367bd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleOwnerSourceType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The owner type for the governance rule owner source. */ -public final class GovernanceRuleOwnerSourceType extends ExpandableStringEnum { - /** Static value ByTag for GovernanceRuleOwnerSourceType. */ - public static final GovernanceRuleOwnerSourceType BY_TAG = fromString("ByTag"); - - /** Static value Manually for GovernanceRuleOwnerSourceType. */ - public static final GovernanceRuleOwnerSourceType MANUALLY = fromString("Manually"); - - /** - * Creates a new instance of GovernanceRuleOwnerSourceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public GovernanceRuleOwnerSourceType() { - } - - /** - * Creates or finds a GovernanceRuleOwnerSourceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding GovernanceRuleOwnerSourceType. - */ - @JsonCreator - public static GovernanceRuleOwnerSourceType fromString(String name) { - return fromString(name, GovernanceRuleOwnerSourceType.class); - } - - /** - * Gets known GovernanceRuleOwnerSourceType values. - * - * @return known GovernanceRuleOwnerSourceType values. - */ - public static Collection values() { - return values(GovernanceRuleOwnerSourceType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleSourceResourceType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleSourceResourceType.java deleted file mode 100644 index 8b648b5c4680..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleSourceResourceType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The governance rule source, what the rule affects, e.g. Assessments. */ -public final class GovernanceRuleSourceResourceType extends ExpandableStringEnum { - /** Static value Assessments for GovernanceRuleSourceResourceType. */ - public static final GovernanceRuleSourceResourceType ASSESSMENTS = fromString("Assessments"); - - /** - * Creates a new instance of GovernanceRuleSourceResourceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public GovernanceRuleSourceResourceType() { - } - - /** - * Creates or finds a GovernanceRuleSourceResourceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding GovernanceRuleSourceResourceType. - */ - @JsonCreator - public static GovernanceRuleSourceResourceType fromString(String name) { - return fromString(name, GovernanceRuleSourceResourceType.class); - } - - /** - * Gets known GovernanceRuleSourceResourceType values. - * - * @return known GovernanceRuleSourceResourceType values. - */ - public static Collection values() { - return values(GovernanceRuleSourceResourceType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleType.java deleted file mode 100644 index 9683ae0ef5ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRuleType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The rule type of the governance rule, defines the source of the rule e.g. Integrated. */ -public final class GovernanceRuleType extends ExpandableStringEnum { - /** Static value Integrated for GovernanceRuleType. */ - public static final GovernanceRuleType INTEGRATED = fromString("Integrated"); - - /** Static value ServiceNow for GovernanceRuleType. */ - public static final GovernanceRuleType SERVICE_NOW = fromString("ServiceNow"); - - /** - * Creates a new instance of GovernanceRuleType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public GovernanceRuleType() { - } - - /** - * Creates or finds a GovernanceRuleType from its string representation. - * - * @param name a name to look for. - * @return the corresponding GovernanceRuleType. - */ - @JsonCreator - public static GovernanceRuleType fromString(String name) { - return fromString(name, GovernanceRuleType.class); - } - - /** - * Gets known GovernanceRuleType values. - * - * @return known GovernanceRuleType values. - */ - public static Collection values() { - return values(GovernanceRuleType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRules.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRules.java deleted file mode 100644 index 2bf501875f28..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRules.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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 GovernanceRules. */ -public interface GovernanceRules { - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope); - - /** - * Get a list of all relevant governance rules over a scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant governance rules over a scope as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope, Context context); - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. - */ - Response getWithResponse(String scope, String ruleId, Context context); - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governance rule for the requested scope by ruleId. - */ - GovernanceRule get(String scope, String ruleId); - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.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 ruleId); - - /** - * Delete a Governance rule over a given scope. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String scope, String ruleId, Context context); - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void execute(String scope, String ruleId); - - /** - * Execute a governance rule. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param executeGovernanceRuleParams Execute governance rule over a given scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void execute(String scope, String ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams, Context context); - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId. - */ - Response operationResultsWithResponse( - String scope, String ruleId, String operationId, Context context); - - /** - * Get governance rules long run operation result for the requested scope by ruleId and operationId. - * - * @param scope The scope of the Governance rules. Valid scopes are: management group (format: - * 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * @param ruleId The governance rule key - unique key for the standard governance rule (GUID). - * @param operationId The governance rule long running operation unique key. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return governance rules long run operation result for the requested scope by ruleId and operationId. - */ - OperationResultAutoGenerated operationResults(String scope, String ruleId, String operationId); - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. - */ - GovernanceRule getById(String id); - - /** - * Get a specific governance rule for the requested scope by ruleId. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific governance rule for the requested scope by ruleId along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a Governance rule over a given scope. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a Governance rule over a given scope. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new GovernanceRule resource. - * - * @param name resource name. - * @return the first stage of the new GovernanceRule definition. - */ - GovernanceRule.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperationResultsHeaders.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperationResultsHeaders.java deleted file mode 100644 index 64ccd176ad4a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperationResultsHeaders.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The GovernanceRulesOperationResultsHeaders model. */ -@Fluent -public final class GovernanceRulesOperationResultsHeaders { - /* - * The location property. - */ - @JsonProperty(value = "location") - private String location; - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of GovernanceRulesOperationResultsHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public GovernanceRulesOperationResultsHeaders(HttpHeaders rawHeaders) { - this.location = rawHeaders.getValue(HttpHeaderName.LOCATION); - } - - /** - * Get the location property: The location property. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: The location property. - * - * @param location the location value to set. - * @return the GovernanceRulesOperationResultsHeaders object itself. - */ - public GovernanceRulesOperationResultsHeaders withLocation(String location) { - this.location = location; - 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/GovernanceRulesOperationResultsResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperationResultsResponse.java deleted file mode 100644 index d7a5527e6b97..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GovernanceRulesOperationResultsResponse.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; - -/** Contains all response data for the operationResults operation. */ -public final class GovernanceRulesOperationResultsResponse - extends ResponseBase { - /** - * Creates an instance of GovernanceRulesOperationResultsResponse. - * - * @param request the request which resulted in this GovernanceRulesOperationResultsResponse. - * @param statusCode the status code of the HTTP response. - * @param rawHeaders the raw headers of the HTTP response. - * @param value the deserialized value of the HTTP response. - * @param headers the deserialized headers of the HTTP response. - */ - public GovernanceRulesOperationResultsResponse( - HttpRequest request, - int statusCode, - HttpHeaders rawHeaders, - OperationResultAutoGeneratedInner value, - GovernanceRulesOperationResultsHeaders headers) { - super(request, statusCode, rawHeaders, value, headers); - } - - /** - * Gets the deserialized response body. - * - * @return the deserialized response body. - */ - @Override - public OperationResultAutoGeneratedInner getValue() { - return super.getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthDataClassification.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthDataClassification.java deleted file mode 100644 index 9be26ae2b0db..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthDataClassification.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The classification of the health report. */ -@Fluent -public final class HealthDataClassification { - /* - * The component describes the name of the agent/service that scans the issue - */ - @JsonProperty(value = "component") - private String component; - - /* - * The scenario describes the health scenario issue of the component - */ - @JsonProperty(value = "scenario") - private String scenario; - - /* - * The resource scope of the health report - */ - @JsonProperty(value = "scope") - private ScopeName scope; - - /** Creates an instance of HealthDataClassification class. */ - public HealthDataClassification() { - } - - /** - * Get the component property: The component describes the name of the agent/service that scans the issue. - * - * @return the component value. - */ - public String component() { - return this.component; - } - - /** - * Set the component property: The component describes the name of the agent/service that scans the issue. - * - * @param component the component value to set. - * @return the HealthDataClassification object itself. - */ - public HealthDataClassification withComponent(String component) { - this.component = component; - return this; - } - - /** - * Get the scenario property: The scenario describes the health scenario issue of the component. - * - * @return the scenario value. - */ - public String scenario() { - return this.scenario; - } - - /** - * Set the scenario property: The scenario describes the health scenario issue of the component. - * - * @param scenario the scenario value to set. - * @return the HealthDataClassification object itself. - */ - public HealthDataClassification withScenario(String scenario) { - this.scenario = scenario; - return this; - } - - /** - * Get the scope property: The resource scope of the health report. - * - * @return the scope value. - */ - public ScopeName scope() { - return this.scope; - } - - /** - * Set the scope property: The resource scope of the health report. - * - * @param scope the scope value to set. - * @return the HealthDataClassification object itself. - */ - public HealthDataClassification withScope(ScopeName scope) { - this.scope = scope; - 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/HealthReport.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReport.java deleted file mode 100644 index da93fa084412..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReport.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.HealthReportInner; -import java.util.List; - -/** An immutable client-side representation of HealthReport. */ -public interface HealthReport { - /** - * 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: The resource details of the health report. - * - * @return the resourceDetails value. - */ - ResourceDetailsAutoGenerated resourceDetails(); - - /** - * Gets the environmentDetails property: The environment details of the resource. - * - * @return the environmentDetails value. - */ - EnvironmentDetails environmentDetails(); - - /** - * Gets the healthDataClassification property: The classification of the health report. - * - * @return the healthDataClassification value. - */ - HealthDataClassification healthDataClassification(); - - /** - * Gets the status property: The status of the health report. - * - * @return the status value. - */ - StatusAutoGenerated status(); - - /** - * Gets the affectedDefendersPlans property: The affected defenders plans by unhealthy report. - * - * @return the affectedDefendersPlans value. - */ - List affectedDefendersPlans(); - - /** - * Gets the issues property: A collection of the issues in the report. - * - * @return the issues value. - */ - List issues(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.HealthReportInner object. - * - * @return the inner object. - */ - HealthReportInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportOperations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportOperations.java deleted file mode 100644 index df0dbf9b29fe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportOperations.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 HealthReportOperations. */ -public interface HealthReportOperations { - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource along with {@link Response}. - */ - Response getWithResponse(String resourceId, String healthReportName, Context context); - - /** - * Get health report of resource. - * - * @param resourceId The identifier of the resource. - * @param healthReportName The health report Key - Unique key for the health report type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return health report of resource. - */ - HealthReport get(String resourceId, String healthReportName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReports.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReports.java deleted file mode 100644 index 8765b15539e7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReports.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 HealthReports. */ -public interface HealthReports { - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope); - - /** - * Get a list of all health reports inside a scope. Valid scopes are: subscription (format: - * 'subscriptions/{subscriptionId}'), or security connector (format: - * 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'. - * - * @param scope The scope at which the operation is performed. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all health reports inside a scope as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportsList.java deleted file mode 100644 index 0d3cc1e6a747..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HealthReportsList.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.resourcemanager.security.fluent.models.HealthReportInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Page of health reports list. */ -@Immutable -public final class HealthReportsList { - /* - * Collection of health reports in this page - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of HealthReportsList class. */ - public HealthReportsList() { - } - - /** - * Get the value property: Collection of health reports in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HttpC2DMessagesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HttpC2DMessagesNotInAllowedRange.java deleted file mode 100644 index e7d42f332e0d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HttpC2DMessagesNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of cloud to device messages (HTTP protocol) is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("HttpC2DMessagesNotInAllowedRange") -@Fluent -public final class HttpC2DMessagesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of HttpC2DMessagesNotInAllowedRange class. */ - public HttpC2DMessagesNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public HttpC2DMessagesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public HttpC2DMessagesNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public HttpC2DMessagesNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public HttpC2DMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/HttpC2DRejectedMessagesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HttpC2DRejectedMessagesNotInAllowedRange.java deleted file mode 100644 index 49c6b26e1c01..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HttpC2DRejectedMessagesNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of rejected cloud to device messages (HTTP protocol) is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("HttpC2DRejectedMessagesNotInAllowedRange") -@Fluent -public final class HttpC2DRejectedMessagesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of HttpC2DRejectedMessagesNotInAllowedRange class. */ - public HttpC2DRejectedMessagesNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public HttpC2DRejectedMessagesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public HttpC2DRejectedMessagesNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public HttpC2DRejectedMessagesNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public HttpC2DRejectedMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/HttpD2CMessagesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HttpD2CMessagesNotInAllowedRange.java deleted file mode 100644 index 72e3529c7ee4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HttpD2CMessagesNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of device to cloud messages (HTTP protocol) is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("HttpD2CMessagesNotInAllowedRange") -@Fluent -public final class HttpD2CMessagesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of HttpD2CMessagesNotInAllowedRange class. */ - public HttpD2CMessagesNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public HttpD2CMessagesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public HttpD2CMessagesNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public HttpD2CMessagesNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public HttpD2CMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/HybridComputeProvisioningState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HybridComputeProvisioningState.java deleted file mode 100644 index f938034d5fe2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HybridComputeProvisioningState.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** State of the service principal and its secret. */ -public final class HybridComputeProvisioningState extends ExpandableStringEnum { - /** Static value Valid for HybridComputeProvisioningState. */ - public static final HybridComputeProvisioningState VALID = fromString("Valid"); - - /** Static value Invalid for HybridComputeProvisioningState. */ - public static final HybridComputeProvisioningState INVALID = fromString("Invalid"); - - /** Static value Expired for HybridComputeProvisioningState. */ - public static final HybridComputeProvisioningState EXPIRED = fromString("Expired"); - - /** - * Creates a new instance of HybridComputeProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public HybridComputeProvisioningState() { - } - - /** - * Creates or finds a HybridComputeProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding HybridComputeProvisioningState. - */ - @JsonCreator - public static HybridComputeProvisioningState fromString(String name) { - return fromString(name, HybridComputeProvisioningState.class); - } - - /** - * Gets known HybridComputeProvisioningState values. - * - * @return known HybridComputeProvisioningState values. - */ - public static Collection values() { - return values(HybridComputeProvisioningState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HybridComputeSettingsProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HybridComputeSettingsProperties.java deleted file mode 100644 index 3c3591136994..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/HybridComputeSettingsProperties.java +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Settings for hybrid compute management. */ -@Fluent -public final class HybridComputeSettingsProperties { - /* - * State of the service principal and its secret - */ - @JsonProperty(value = "hybridComputeProvisioningState", access = JsonProperty.Access.WRITE_ONLY) - private HybridComputeProvisioningState hybridComputeProvisioningState; - - /* - * Whether or not to automatically install Azure Arc (hybrid compute) agents on machines - */ - @JsonProperty(value = "autoProvision", required = true) - private AutoProvision autoProvision; - - /* - * The name of the resource group where Arc (Hybrid Compute) connectors are connected. - */ - @JsonProperty(value = "resourceGroupName") - private String resourceGroupName; - - /* - * The location where the metadata of machines will be stored - */ - @JsonProperty(value = "region") - private String region; - - /* - * For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the - * non-Azure machine can use. - */ - @JsonProperty(value = "proxyServer") - private ProxyServerProperties proxyServer; - - /* - * An object to access resources that are secured by an Azure AD tenant. - */ - @JsonProperty(value = "servicePrincipal") - private ServicePrincipalProperties servicePrincipal; - - /** Creates an instance of HybridComputeSettingsProperties class. */ - public HybridComputeSettingsProperties() { - } - - /** - * Get the hybridComputeProvisioningState property: State of the service principal and its secret. - * - * @return the hybridComputeProvisioningState value. - */ - public HybridComputeProvisioningState hybridComputeProvisioningState() { - return this.hybridComputeProvisioningState; - } - - /** - * Get the autoProvision property: Whether or not to automatically install Azure Arc (hybrid compute) agents on - * machines. - * - * @return the autoProvision value. - */ - public AutoProvision autoProvision() { - return this.autoProvision; - } - - /** - * Set the autoProvision property: Whether or not to automatically install Azure Arc (hybrid compute) agents on - * machines. - * - * @param autoProvision the autoProvision value to set. - * @return the HybridComputeSettingsProperties object itself. - */ - public HybridComputeSettingsProperties withAutoProvision(AutoProvision autoProvision) { - this.autoProvision = autoProvision; - return this; - } - - /** - * Get the resourceGroupName property: The name of the resource group where Arc (Hybrid Compute) connectors are - * connected. - * - * @return the resourceGroupName value. - */ - public String resourceGroupName() { - return this.resourceGroupName; - } - - /** - * Set the resourceGroupName property: The name of the resource group where Arc (Hybrid Compute) connectors are - * connected. - * - * @param resourceGroupName the resourceGroupName value to set. - * @return the HybridComputeSettingsProperties object itself. - */ - public HybridComputeSettingsProperties withResourceGroupName(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - /** - * Get the region property: The location where the metadata of machines will be stored. - * - * @return the region value. - */ - public String region() { - return this.region; - } - - /** - * Set the region property: The location where the metadata of machines will be stored. - * - * @param region the region value to set. - * @return the HybridComputeSettingsProperties object itself. - */ - public HybridComputeSettingsProperties withRegion(String region) { - this.region = region; - return this; - } - - /** - * Get the proxyServer property: For a non-Azure machine that is not connected directly to the internet, specify a - * proxy server that the non-Azure machine can use. - * - * @return the proxyServer value. - */ - public ProxyServerProperties proxyServer() { - return this.proxyServer; - } - - /** - * Set the proxyServer property: For a non-Azure machine that is not connected directly to the internet, specify a - * proxy server that the non-Azure machine can use. - * - * @param proxyServer the proxyServer value to set. - * @return the HybridComputeSettingsProperties object itself. - */ - public HybridComputeSettingsProperties withProxyServer(ProxyServerProperties proxyServer) { - this.proxyServer = proxyServer; - return this; - } - - /** - * Get the servicePrincipal property: An object to access resources that are secured by an Azure AD tenant. - * - * @return the servicePrincipal value. - */ - public ServicePrincipalProperties servicePrincipal() { - return this.servicePrincipal; - } - - /** - * Set the servicePrincipal property: An object to access resources that are secured by an Azure AD tenant. - * - * @param servicePrincipal the servicePrincipal value to set. - * @return the HybridComputeSettingsProperties object itself. - */ - public HybridComputeSettingsProperties withServicePrincipal(ServicePrincipalProperties servicePrincipal) { - this.servicePrincipal = servicePrincipal; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (autoProvision() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property autoProvision in model HybridComputeSettingsProperties")); - } - if (proxyServer() != null) { - proxyServer().validate(); - } - if (servicePrincipal() != null) { - servicePrincipal().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(HybridComputeSettingsProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Identity.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Identity.java deleted file mode 100644 index dd91ed5e0a1a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Identity.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Identity for the resource. */ -@Fluent -public final class Identity { - /* - * The principal ID of resource identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * The tenant ID of resource. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /* - * The identity type. - */ - @JsonProperty(value = "type") - private ResourceIdentityType type; - - /** Creates an instance of Identity class. */ - public Identity() { - } - - /** - * Get the principalId property: The principal ID of resource identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: The tenant ID of resource. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the type property: The identity type. - * - * @return the type value. - */ - public ResourceIdentityType type() { - return this.type; - } - - /** - * Set the type property: The identity type. - * - * @param type the type value to set. - * @return the Identity object itself. - */ - public Identity withType(ResourceIdentityType type) { - this.type = type; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ImplementationEffort.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ImplementationEffort.java deleted file mode 100644 index 4427a87ac263..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ImplementationEffort.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The implementation effort required to remediate this assessment. */ -public final class ImplementationEffort extends ExpandableStringEnum { - /** Static value Low for ImplementationEffort. */ - public static final ImplementationEffort LOW = fromString("Low"); - - /** Static value Moderate for ImplementationEffort. */ - public static final ImplementationEffort MODERATE = fromString("Moderate"); - - /** Static value High for ImplementationEffort. */ - public static final ImplementationEffort HIGH = fromString("High"); - - /** - * Creates a new instance of ImplementationEffort value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ImplementationEffort() { - } - - /** - * Creates or finds a ImplementationEffort from its string representation. - * - * @param name a name to look for. - * @return the corresponding ImplementationEffort. - */ - @JsonCreator - public static ImplementationEffort fromString(String name) { - return fromString(name, ImplementationEffort.class); - } - - /** - * Gets known ImplementationEffort values. - * - * @return known ImplementationEffort values. - */ - public static Collection values() { - return values(ImplementationEffort.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionAwsOffering.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionAwsOffering.java deleted file mode 100644 index bcd3d3d18a55..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionAwsOffering.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** The information protection for AWS offering. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "offeringType") -@JsonTypeName("InformationProtectionAws") -@Fluent -public final class InformationProtectionAwsOffering extends CloudOffering { - /* - * The native cloud connection configuration - */ - @JsonProperty(value = "informationProtection") - private InformationProtectionAwsOfferingInformationProtection informationProtection; - - /** Creates an instance of InformationProtectionAwsOffering class. */ - public InformationProtectionAwsOffering() { - } - - /** - * Get the informationProtection property: The native cloud connection configuration. - * - * @return the informationProtection value. - */ - public InformationProtectionAwsOfferingInformationProtection informationProtection() { - return this.informationProtection; - } - - /** - * Set the informationProtection property: The native cloud connection configuration. - * - * @param informationProtection the informationProtection value to set. - * @return the InformationProtectionAwsOffering object itself. - */ - public InformationProtectionAwsOffering withInformationProtection( - InformationProtectionAwsOfferingInformationProtection informationProtection) { - this.informationProtection = informationProtection; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (informationProtection() != null) { - informationProtection().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionAwsOfferingInformationProtection.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionAwsOfferingInformationProtection.java deleted file mode 100644 index 8953e588cc07..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionAwsOfferingInformationProtection.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The native cloud connection configuration. */ -@Fluent -public final class InformationProtectionAwsOfferingInformationProtection { - /* - * The cloud role ARN in AWS for this feature - */ - @JsonProperty(value = "cloudRoleArn") - private String cloudRoleArn; - - /** Creates an instance of InformationProtectionAwsOfferingInformationProtection class. */ - public InformationProtectionAwsOfferingInformationProtection() { - } - - /** - * Get the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @return the cloudRoleArn value. - */ - public String cloudRoleArn() { - return this.cloudRoleArn; - } - - /** - * Set the cloudRoleArn property: The cloud role ARN in AWS for this feature. - * - * @param cloudRoleArn the cloudRoleArn value to set. - * @return the InformationProtectionAwsOfferingInformationProtection object itself. - */ - public InformationProtectionAwsOfferingInformationProtection withCloudRoleArn(String cloudRoleArn) { - this.cloudRoleArn = cloudRoleArn; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionKeyword.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionKeyword.java deleted file mode 100644 index 9f057b60c11d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionKeyword.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The information type keyword. */ -@Fluent -public final class InformationProtectionKeyword { - /* - * The keyword pattern. - */ - @JsonProperty(value = "pattern") - private String pattern; - - /* - * Indicates whether the keyword is custom or not. - */ - @JsonProperty(value = "custom") - private Boolean custom; - - /* - * Indicates whether the keyword can be applied on numeric types or not. - */ - @JsonProperty(value = "canBeNumeric") - private Boolean canBeNumeric; - - /* - * Indicates whether the keyword is excluded or not. - */ - @JsonProperty(value = "excluded") - private Boolean excluded; - - /** Creates an instance of InformationProtectionKeyword class. */ - public InformationProtectionKeyword() { - } - - /** - * Get the pattern property: The keyword pattern. - * - * @return the pattern value. - */ - public String pattern() { - return this.pattern; - } - - /** - * Set the pattern property: The keyword pattern. - * - * @param pattern the pattern value to set. - * @return the InformationProtectionKeyword object itself. - */ - public InformationProtectionKeyword withPattern(String pattern) { - this.pattern = pattern; - return this; - } - - /** - * Get the custom property: Indicates whether the keyword is custom or not. - * - * @return the custom value. - */ - public Boolean custom() { - return this.custom; - } - - /** - * Set the custom property: Indicates whether the keyword is custom or not. - * - * @param custom the custom value to set. - * @return the InformationProtectionKeyword object itself. - */ - public InformationProtectionKeyword withCustom(Boolean custom) { - this.custom = custom; - return this; - } - - /** - * Get the canBeNumeric property: Indicates whether the keyword can be applied on numeric types or not. - * - * @return the canBeNumeric value. - */ - public Boolean canBeNumeric() { - return this.canBeNumeric; - } - - /** - * Set the canBeNumeric property: Indicates whether the keyword can be applied on numeric types or not. - * - * @param canBeNumeric the canBeNumeric value to set. - * @return the InformationProtectionKeyword object itself. - */ - public InformationProtectionKeyword withCanBeNumeric(Boolean canBeNumeric) { - this.canBeNumeric = canBeNumeric; - return this; - } - - /** - * Get the excluded property: Indicates whether the keyword is excluded or not. - * - * @return the excluded value. - */ - public Boolean excluded() { - return this.excluded; - } - - /** - * Set the excluded property: Indicates whether the keyword is excluded or not. - * - * @param excluded the excluded value to set. - * @return the InformationProtectionKeyword object itself. - */ - public InformationProtectionKeyword withExcluded(Boolean excluded) { - this.excluded = excluded; - 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/InformationProtectionPolicies.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicies.java deleted file mode 100644 index 410b3ead7cc4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicies.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of InformationProtectionPolicies. */ -public interface InformationProtectionPolicies { - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy along with {@link Response}. - */ - Response getWithResponse( - String scope, InformationProtectionPolicyName informationProtectionPolicyName, Context context); - - /** - * Details of the information protection policy. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param informationProtectionPolicyName Name of the information protection policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policy. - */ - InformationProtectionPolicy get(String scope, InformationProtectionPolicyName informationProtectionPolicyName); - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policies response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope); - - /** - * Information protection policies of a specific management group. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return information protection policies response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String scope, Context context); - - /** - * Details of the information protection policy. - * - * @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 information protection policy along with {@link Response}. - */ - InformationProtectionPolicy getById(String id); - - /** - * Details of the information protection policy. - * - * @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 information protection policy along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new InformationProtectionPolicy resource. - * - * @param name resource name. - * @return the first stage of the new InformationProtectionPolicy definition. - */ - InformationProtectionPolicy.DefinitionStages.Blank define(InformationProtectionPolicyName name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicy.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicy.java deleted file mode 100644 index b145ac417d4b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicy.java +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import java.time.OffsetDateTime; -import java.util.Map; - -/** An immutable client-side representation of InformationProtectionPolicy. */ -public interface InformationProtectionPolicy { - /** - * 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 lastModifiedUtc property: Describes the last UTC time the policy was modified. - * - * @return the lastModifiedUtc value. - */ - OffsetDateTime lastModifiedUtc(); - - /** - * Gets the version property: Describes the version of the policy. - * - * @return the version value. - */ - String version(); - - /** - * Gets the labels property: Dictionary of sensitivity labels. - * - * @return the labels value. - */ - Map labels(); - - /** - * Gets the informationTypes property: The sensitivity information types. - * - * @return the informationTypes value. - */ - Map informationTypes(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner object. - * - * @return the inner object. - */ - InformationProtectionPolicyInner innerModel(); - - /** The entirety of the InformationProtectionPolicy definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - /** The InformationProtectionPolicy definition stages. */ - interface DefinitionStages { - /** The first stage of the InformationProtectionPolicy definition. */ - interface Blank extends WithScope { - } - /** The stage of the InformationProtectionPolicy definition allowing to specify parent resource. */ - interface WithScope { - /** - * Specifies scope. - * - * @param scope Scope of the query, can be subscription - * (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group - * (/providers/Microsoft.Management/managementGroups/mgName). - * @return the next definition stage. - */ - WithCreate withExistingScope(String scope); - } - /** - * The stage of the InformationProtectionPolicy definition which contains all the minimum required properties - * for the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithLabels, DefinitionStages.WithInformationTypes { - /** - * Executes the create request. - * - * @return the created resource. - */ - InformationProtectionPolicy create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - InformationProtectionPolicy create(Context context); - } - /** The stage of the InformationProtectionPolicy definition allowing to specify labels. */ - interface WithLabels { - /** - * Specifies the labels property: Dictionary of sensitivity labels.. - * - * @param labels Dictionary of sensitivity labels. - * @return the next definition stage. - */ - WithCreate withLabels(Map labels); - } - /** The stage of the InformationProtectionPolicy definition allowing to specify informationTypes. */ - interface WithInformationTypes { - /** - * Specifies the informationTypes property: The sensitivity information types.. - * - * @param informationTypes The sensitivity information types. - * @return the next definition stage. - */ - WithCreate withInformationTypes(Map informationTypes); - } - } - /** - * Begins update for the InformationProtectionPolicy resource. - * - * @return the stage of resource update. - */ - InformationProtectionPolicy.Update update(); - - /** The template for InformationProtectionPolicy update. */ - interface Update extends UpdateStages.WithLabels, UpdateStages.WithInformationTypes { - /** - * Executes the update request. - * - * @return the updated resource. - */ - InformationProtectionPolicy apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - InformationProtectionPolicy apply(Context context); - } - /** The InformationProtectionPolicy update stages. */ - interface UpdateStages { - /** The stage of the InformationProtectionPolicy update allowing to specify labels. */ - interface WithLabels { - /** - * Specifies the labels property: Dictionary of sensitivity labels.. - * - * @param labels Dictionary of sensitivity labels. - * @return the next definition stage. - */ - Update withLabels(Map labels); - } - /** The stage of the InformationProtectionPolicy update allowing to specify informationTypes. */ - interface WithInformationTypes { - /** - * Specifies the informationTypes property: The sensitivity information types.. - * - * @param informationTypes The sensitivity information types. - * @return the next definition stage. - */ - Update withInformationTypes(Map informationTypes); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - InformationProtectionPolicy refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - InformationProtectionPolicy refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicyList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicyList.java deleted file mode 100644 index c69c92449f4b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicyList.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Information protection policies response. */ -@Fluent -public final class InformationProtectionPolicyList { - /* - * List of information protection policies. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of InformationProtectionPolicyList class. */ - public InformationProtectionPolicyList() { - } - - /** - * Get the value property: List of information protection policies. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of information protection policies. - * - * @param value the value value to set. - * @return the InformationProtectionPolicyList object itself. - */ - public InformationProtectionPolicyList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicyName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicyName.java deleted file mode 100644 index aa2c7cdb44e2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationProtectionPolicyName.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for InformationProtectionPolicyName. */ -public final class InformationProtectionPolicyName extends ExpandableStringEnum { - /** Static value effective for InformationProtectionPolicyName. */ - public static final InformationProtectionPolicyName EFFECTIVE = fromString("effective"); - - /** Static value custom for InformationProtectionPolicyName. */ - public static final InformationProtectionPolicyName CUSTOM = fromString("custom"); - - /** - * Creates a new instance of InformationProtectionPolicyName value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public InformationProtectionPolicyName() { - } - - /** - * Creates or finds a InformationProtectionPolicyName from its string representation. - * - * @param name a name to look for. - * @return the corresponding InformationProtectionPolicyName. - */ - @JsonCreator - public static InformationProtectionPolicyName fromString(String name) { - return fromString(name, InformationProtectionPolicyName.class); - } - - /** - * Gets known InformationProtectionPolicyName values. - * - * @return known InformationProtectionPolicyName values. - */ - public static Collection values() { - return values(InformationProtectionPolicyName.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationType.java deleted file mode 100644 index 0b6a324196bc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/InformationType.java +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.UUID; - -/** The information type. */ -@Fluent -public final class InformationType { - /* - * The name of the information type. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The description of the information type. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The order of the information type. - */ - @JsonProperty(value = "order") - private Integer order; - - /* - * The recommended label id to be associated with this information type. - */ - @JsonProperty(value = "recommendedLabelId") - private UUID recommendedLabelId; - - /* - * Indicates whether the information type is enabled or not. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /* - * Indicates whether the information type is custom or not. - */ - @JsonProperty(value = "custom") - private Boolean custom; - - /* - * The information type keywords. - */ - @JsonProperty(value = "keywords") - private List keywords; - - /** Creates an instance of InformationType class. */ - public InformationType() { - } - - /** - * Get the displayName property: The name of the information type. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The name of the information type. - * - * @param displayName the displayName value to set. - * @return the InformationType object itself. - */ - public InformationType withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: The description of the information type. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description of the information type. - * - * @param description the description value to set. - * @return the InformationType object itself. - */ - public InformationType withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the order property: The order of the information type. - * - * @return the order value. - */ - public Integer order() { - return this.order; - } - - /** - * Set the order property: The order of the information type. - * - * @param order the order value to set. - * @return the InformationType object itself. - */ - public InformationType withOrder(Integer order) { - this.order = order; - return this; - } - - /** - * Get the recommendedLabelId property: The recommended label id to be associated with this information type. - * - * @return the recommendedLabelId value. - */ - public UUID recommendedLabelId() { - return this.recommendedLabelId; - } - - /** - * Set the recommendedLabelId property: The recommended label id to be associated with this information type. - * - * @param recommendedLabelId the recommendedLabelId value to set. - * @return the InformationType object itself. - */ - public InformationType withRecommendedLabelId(UUID recommendedLabelId) { - this.recommendedLabelId = recommendedLabelId; - return this; - } - - /** - * Get the enabled property: Indicates whether the information type is enabled or not. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Indicates whether the information type is enabled or not. - * - * @param enabled the enabled value to set. - * @return the InformationType object itself. - */ - public InformationType withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Get the custom property: Indicates whether the information type is custom or not. - * - * @return the custom value. - */ - public Boolean custom() { - return this.custom; - } - - /** - * Set the custom property: Indicates whether the information type is custom or not. - * - * @param custom the custom value to set. - * @return the InformationType object itself. - */ - public InformationType withCustom(Boolean custom) { - this.custom = custom; - return this; - } - - /** - * Get the keywords property: The information type keywords. - * - * @return the keywords value. - */ - public List keywords() { - return this.keywords; - } - - /** - * Set the keywords property: The information type keywords. - * - * @param keywords the keywords value to set. - * @return the InformationType object itself. - */ - public InformationType withKeywords(List keywords) { - this.keywords = keywords; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keywords() != null) { - keywords().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionConnectionString.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionConnectionString.java deleted file mode 100644 index a21e6e058cd1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionConnectionString.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Connection string for ingesting security data and logs. */ -@Immutable -public final class IngestionConnectionString { - /* - * The region where ingested logs and data resides - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /* - * Connection string value - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private String value; - - /** Creates an instance of IngestionConnectionString class. */ - public IngestionConnectionString() { - } - - /** - * Get the location property: The region where ingested logs and data resides. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the value property: Connection string value. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSetting.java deleted file mode 100644 index 6183e755a761..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSetting.java +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; - -/** An immutable client-side representation of IngestionSetting. */ -public interface IngestionSetting { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the properties property: Ingestion setting data. - * - * @return the properties value. - */ - Object properties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IngestionSettingInner object. - * - * @return the inner object. - */ - IngestionSettingInner innerModel(); - - /** The entirety of the IngestionSetting definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - /** The IngestionSetting definition stages. */ - interface DefinitionStages { - /** The first stage of the IngestionSetting definition. */ - interface Blank extends WithCreate { - } - /** - * The stage of the IngestionSetting definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithProperties { - /** - * Executes the create request. - * - * @return the created resource. - */ - IngestionSetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - IngestionSetting create(Context context); - } - /** The stage of the IngestionSetting definition allowing to specify properties. */ - interface WithProperties { - /** - * Specifies the properties property: Ingestion setting data. - * - * @param properties Ingestion setting data. - * @return the next definition stage. - */ - WithCreate withProperties(Object properties); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - IngestionSetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - IngestionSetting refresh(Context context); - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - Response listTokensWithResponse(Context context); - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - IngestionSettingToken listTokens(); - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs along with {@link Response}. - */ - Response listConnectionStringsWithResponse(Context context); - - /** - * Connection strings for ingesting security scan logs and data. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs. - */ - ConnectionStrings listConnectionStrings(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettingList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettingList.java deleted file mode 100644 index 4824d85ba158..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettingList.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.resourcemanager.security.fluent.models.IngestionSettingInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of ingestion settings. */ -@Immutable -public final class IngestionSettingList { - /* - * List of ingestion settings - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of IngestionSettingList class. */ - public IngestionSettingList() { - } - - /** - * Get the value property: List of ingestion settings. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettingToken.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettingToken.java deleted file mode 100644 index 2d82c0090921..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettingToken.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner; - -/** An immutable client-side representation of IngestionSettingToken. */ -public interface IngestionSettingToken { - /** - * Gets the token property: The token is used for correlating security data and logs with the resources in the - * subscription. - * - * @return the token value. - */ - String token(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IngestionSettingTokenInner object. - * - * @return the inner object. - */ - IngestionSettingTokenInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettings.java deleted file mode 100644 index 0f3c1c9af4a9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IngestionSettings.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of IngestionSettings. */ -public interface IngestionSettings { - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of ingestion settings as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - Response getWithResponse(String ingestionSettingName, Context context); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - IngestionSetting get(String ingestionSettingName); - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String ingestionSettingName, Context context); - - /** - * Deletes the ingestion settings for this subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String ingestionSettingName); - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - Response listTokensWithResponse(String ingestionSettingName, Context context); - - /** - * Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription. - */ - IngestionSettingToken listTokens(String ingestionSettingName); - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs along with {@link Response}. - */ - Response listConnectionStringsWithResponse(String ingestionSettingName, Context context); - - /** - * Connection strings for ingesting security scan logs and data. - * - * @param ingestionSettingName Name of the ingestion setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return connection string for ingesting security data and logs. - */ - ConnectionStrings listConnectionStrings(String ingestionSettingName); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - IngestionSetting getById(String id); - - /** - * Settings for ingesting security data and logs to correlate with resources associated with the subscription. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures how to correlate scan data and logs with resources associated with the subscription along with - * {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the ingestion settings for this subscription. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes the ingestion settings for this subscription. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new IngestionSetting resource. - * - * @param name resource name. - * @return the first stage of the new IngestionSetting definition. - */ - IngestionSetting.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Intent.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Intent.java deleted file mode 100644 index f20744c90a69..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Intent.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * The kill chain related intent behind the alert. For list of supported values, and explanations of Azure Security - * Center's supported kill chain intents. - */ -public final class Intent extends ExpandableStringEnum { - /** Static value Unknown for Intent. */ - public static final Intent UNKNOWN = fromString("Unknown"); - - /** Static value PreAttack for Intent. */ - public static final Intent PRE_ATTACK = fromString("PreAttack"); - - /** Static value InitialAccess for Intent. */ - public static final Intent INITIAL_ACCESS = fromString("InitialAccess"); - - /** Static value Persistence for Intent. */ - public static final Intent PERSISTENCE = fromString("Persistence"); - - /** Static value PrivilegeEscalation for Intent. */ - public static final Intent PRIVILEGE_ESCALATION = fromString("PrivilegeEscalation"); - - /** Static value DefenseEvasion for Intent. */ - public static final Intent DEFENSE_EVASION = fromString("DefenseEvasion"); - - /** Static value CredentialAccess for Intent. */ - public static final Intent CREDENTIAL_ACCESS = fromString("CredentialAccess"); - - /** Static value Discovery for Intent. */ - public static final Intent DISCOVERY = fromString("Discovery"); - - /** Static value LateralMovement for Intent. */ - public static final Intent LATERAL_MOVEMENT = fromString("LateralMovement"); - - /** Static value Execution for Intent. */ - public static final Intent EXECUTION = fromString("Execution"); - - /** Static value Collection for Intent. */ - public static final Intent COLLECTION = fromString("Collection"); - - /** Static value Exfiltration for Intent. */ - public static final Intent EXFILTRATION = fromString("Exfiltration"); - - /** Static value CommandAndControl for Intent. */ - public static final Intent COMMAND_AND_CONTROL = fromString("CommandAndControl"); - - /** Static value Impact for Intent. */ - public static final Intent IMPACT = fromString("Impact"); - - /** Static value Probing for Intent. */ - public static final Intent PROBING = fromString("Probing"); - - /** Static value Exploitation for Intent. */ - public static final Intent EXPLOITATION = fromString("Exploitation"); - - /** - * Creates a new instance of Intent value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Intent() { - } - - /** - * Creates or finds a Intent from its string representation. - * - * @param name a name to look for. - * @return the corresponding Intent. - */ - @JsonCreator - public static Intent fromString(String name) { - return fromString(name, Intent.class); - } - - /** - * Gets known Intent values. - * - * @return known Intent values. - */ - public static Collection values() { - return values(Intent.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedAlert.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedAlert.java deleted file mode 100644 index d449235f7c91..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedAlert.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All 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.IoTSecurityAggregatedAlertInner; -import java.time.LocalDate; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of IoTSecurityAggregatedAlert. */ -public interface IoTSecurityAggregatedAlert { - /** - * 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 tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the alertType property: Name of the alert type. - * - * @return the alertType value. - */ - String alertType(); - - /** - * Gets the alertDisplayName property: Display name of the alert type. - * - * @return the alertDisplayName value. - */ - String alertDisplayName(); - - /** - * Gets the aggregatedDateUtc property: Date of detection. - * - * @return the aggregatedDateUtc value. - */ - LocalDate aggregatedDateUtc(); - - /** - * Gets the vendorName property: Name of the organization that raised the alert. - * - * @return the vendorName value. - */ - String vendorName(); - - /** - * Gets the reportedSeverity property: Assessed alert severity. - * - * @return the reportedSeverity value. - */ - ReportedSeverity reportedSeverity(); - - /** - * Gets the remediationSteps property: Recommended steps for remediation. - * - * @return the remediationSteps value. - */ - String remediationSteps(); - - /** - * Gets the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - String description(); - - /** - * Gets the count property: Number of alerts occurrences within the aggregated time window. - * - * @return the count value. - */ - Long count(); - - /** - * Gets the effectedResourceType property: Azure resource ID of the resource that received the alerts. - * - * @return the effectedResourceType value. - */ - String effectedResourceType(); - - /** - * Gets the systemSource property: The type of the alerted resource (Azure, Non-Azure). - * - * @return the systemSource value. - */ - String systemSource(); - - /** - * Gets the actionTaken property: IoT Security solution alert response. - * - * @return the actionTaken value. - */ - String actionTaken(); - - /** - * Gets the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. - * - * @return the logAnalyticsQuery value. - */ - String logAnalyticsQuery(); - - /** - * Gets the topDevicesList property: 10 devices with the highest number of occurrences of this alert type, on this - * day. - * - * @return the topDevicesList value. - */ - List topDevicesList(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner object. - * - * @return the inner object. - */ - IoTSecurityAggregatedAlertInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedAlertList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedAlertList.java deleted file mode 100644 index 5b8c4abed000..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedAlertList.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of IoT Security solution aggregated alert data. */ -@Fluent -public final class IoTSecurityAggregatedAlertList { - /* - * List of aggregated alerts data. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * When there is too much alert data for one page, use this URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of IoTSecurityAggregatedAlertList class. */ - public IoTSecurityAggregatedAlertList() { - } - - /** - * Get the value property: List of aggregated alerts data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of aggregated alerts data. - * - * @param value the value value to set. - * @return the IoTSecurityAggregatedAlertList object itself. - */ - public IoTSecurityAggregatedAlertList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: When there is too much alert data 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 IoTSecurityAggregatedAlertList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IoTSecurityAggregatedAlertList.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.java deleted file mode 100644 index cfc3fa93f573..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.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.fasterxml.jackson.annotation.JsonProperty; - -/** The IoTSecurityAggregatedAlertPropertiesTopDevicesListItem model. */ -@Immutable -public final class IoTSecurityAggregatedAlertPropertiesTopDevicesListItem { - /* - * Name of the device. - */ - @JsonProperty(value = "deviceId", access = JsonProperty.Access.WRITE_ONLY) - private String deviceId; - - /* - * Number of alerts raised for this device. - */ - @JsonProperty(value = "alertsCount", access = JsonProperty.Access.WRITE_ONLY) - private Long alertsCount; - - /* - * Most recent time this alert was raised for this device, on this day. - */ - @JsonProperty(value = "lastOccurrence", access = JsonProperty.Access.WRITE_ONLY) - private String lastOccurrence; - - /** Creates an instance of IoTSecurityAggregatedAlertPropertiesTopDevicesListItem class. */ - public IoTSecurityAggregatedAlertPropertiesTopDevicesListItem() { - } - - /** - * Get the deviceId property: Name of the device. - * - * @return the deviceId value. - */ - public String deviceId() { - return this.deviceId; - } - - /** - * Get the alertsCount property: Number of alerts raised for this device. - * - * @return the alertsCount value. - */ - public Long alertsCount() { - return this.alertsCount; - } - - /** - * Get the lastOccurrence property: Most recent time this alert was raised for this device, on this day. - * - * @return the lastOccurrence value. - */ - public String lastOccurrence() { - return this.lastOccurrence; - } - - /** - * 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/IoTSecurityAggregatedRecommendation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedRecommendation.java deleted file mode 100644 index 225b2f7a2ea9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedRecommendation.java +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner; -import java.util.Map; - -/** An immutable client-side representation of IoTSecurityAggregatedRecommendation. */ -public interface IoTSecurityAggregatedRecommendation { - /** - * 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 tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the recommendationName property: Name of the recommendation. - * - * @return the recommendationName value. - */ - String recommendationName(); - - /** - * Gets the recommendationDisplayName property: Display name of the recommendation type. - * - * @return the recommendationDisplayName value. - */ - String recommendationDisplayName(); - - /** - * Gets the description property: Description of the suspected vulnerability and meaning. - * - * @return the description value. - */ - String description(); - - /** - * Gets the recommendationTypeId property: Recommendation-type GUID. - * - * @return the recommendationTypeId value. - */ - String recommendationTypeId(); - - /** - * Gets the detectedBy property: Name of the organization that made the recommendation. - * - * @return the detectedBy value. - */ - String detectedBy(); - - /** - * Gets the remediationSteps property: Recommended steps for remediation. - * - * @return the remediationSteps value. - */ - String remediationSteps(); - - /** - * Gets the reportedSeverity property: Assessed recommendation severity. - * - * @return the reportedSeverity value. - */ - ReportedSeverity reportedSeverity(); - - /** - * Gets the healthyDevices property: Number of healthy devices within the IoT Security solution. - * - * @return the healthyDevices value. - */ - Long healthyDevices(); - - /** - * Gets the unhealthyDeviceCount property: Number of unhealthy devices within the IoT Security solution. - * - * @return the unhealthyDeviceCount value. - */ - Long unhealthyDeviceCount(); - - /** - * Gets the logAnalyticsQuery property: Log analytics query for getting the list of affected devices/alerts. - * - * @return the logAnalyticsQuery value. - */ - String logAnalyticsQuery(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner object. - * - * @return the inner object. - */ - IoTSecurityAggregatedRecommendationInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedRecommendationList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedRecommendationList.java deleted file mode 100644 index a017f3493611..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAggregatedRecommendationList.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of IoT Security solution aggregated recommendations. */ -@Fluent -public final class IoTSecurityAggregatedRecommendationList { - /* - * List of aggregated recommendations data. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * When there is too much alert data for one page, use this URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of IoTSecurityAggregatedRecommendationList class. */ - public IoTSecurityAggregatedRecommendationList() { - } - - /** - * Get the value property: List of aggregated recommendations data. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of aggregated recommendations data. - * - * @param value the value value to set. - * @return the IoTSecurityAggregatedRecommendationList object itself. - */ - public IoTSecurityAggregatedRecommendationList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: When there is too much alert data 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 IoTSecurityAggregatedRecommendationList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IoTSecurityAggregatedRecommendationList.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAlertedDevice.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAlertedDevice.java deleted file mode 100644 index 8a0d2d7d4ee9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityAlertedDevice.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Statistical information about the number of alerts per device during last set number of days. */ -@Immutable -public final class IoTSecurityAlertedDevice { - /* - * Device identifier. - */ - @JsonProperty(value = "deviceId", access = JsonProperty.Access.WRITE_ONLY) - private String deviceId; - - /* - * Number of alerts raised for this device. - */ - @JsonProperty(value = "alertsCount", access = JsonProperty.Access.WRITE_ONLY) - private Long alertsCount; - - /** Creates an instance of IoTSecurityAlertedDevice class. */ - public IoTSecurityAlertedDevice() { - } - - /** - * Get the deviceId property: Device identifier. - * - * @return the deviceId value. - */ - public String deviceId() { - return this.deviceId; - } - - /** - * Get the alertsCount property: Number of alerts raised for this device. - * - * @return the alertsCount value. - */ - public Long alertsCount() { - return this.alertsCount; - } - - /** - * 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/IoTSecurityDeviceAlert.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityDeviceAlert.java deleted file mode 100644 index 0f1e128cb283..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityDeviceAlert.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.fasterxml.jackson.annotation.JsonProperty; - -/** Statistical information about the number of alerts per alert type during last set number of days. */ -@Immutable -public final class IoTSecurityDeviceAlert { - /* - * Display name of the alert - */ - @JsonProperty(value = "alertDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String alertDisplayName; - - /* - * Assessed Alert severity. - */ - @JsonProperty(value = "reportedSeverity", access = JsonProperty.Access.WRITE_ONLY) - private ReportedSeverity reportedSeverity; - - /* - * Number of alerts raised for this alert type. - */ - @JsonProperty(value = "alertsCount", access = JsonProperty.Access.WRITE_ONLY) - private Long alertsCount; - - /** Creates an instance of IoTSecurityDeviceAlert class. */ - public IoTSecurityDeviceAlert() { - } - - /** - * Get the alertDisplayName property: Display name of the alert. - * - * @return the alertDisplayName value. - */ - public String alertDisplayName() { - return this.alertDisplayName; - } - - /** - * Get the reportedSeverity property: Assessed Alert severity. - * - * @return the reportedSeverity value. - */ - public ReportedSeverity reportedSeverity() { - return this.reportedSeverity; - } - - /** - * Get the alertsCount property: Number of alerts raised for this alert type. - * - * @return the alertsCount value. - */ - public Long alertsCount() { - return this.alertsCount; - } - - /** - * 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/IoTSecurityDeviceRecommendation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityDeviceRecommendation.java deleted file mode 100644 index a6ffb1279932..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecurityDeviceRecommendation.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.fasterxml.jackson.annotation.JsonProperty; - -/** Statistical information about the number of recommendations per device, per recommendation type. */ -@Immutable -public final class IoTSecurityDeviceRecommendation { - /* - * Display name of the recommendation. - */ - @JsonProperty(value = "recommendationDisplayName", access = JsonProperty.Access.WRITE_ONLY) - private String recommendationDisplayName; - - /* - * Assessed recommendation severity. - */ - @JsonProperty(value = "reportedSeverity", access = JsonProperty.Access.WRITE_ONLY) - private ReportedSeverity reportedSeverity; - - /* - * Number of devices with this recommendation. - */ - @JsonProperty(value = "devicesCount", access = JsonProperty.Access.WRITE_ONLY) - private Long devicesCount; - - /** Creates an instance of IoTSecurityDeviceRecommendation class. */ - public IoTSecurityDeviceRecommendation() { - } - - /** - * Get the recommendationDisplayName property: Display name of the recommendation. - * - * @return the recommendationDisplayName value. - */ - public String recommendationDisplayName() { - return this.recommendationDisplayName; - } - - /** - * Get the reportedSeverity property: Assessed recommendation severity. - * - * @return the reportedSeverity value. - */ - public ReportedSeverity reportedSeverity() { - return this.reportedSeverity; - } - - /** - * Get the devicesCount property: Number of devices with this recommendation. - * - * @return the devicesCount value. - */ - public Long devicesCount() { - return this.devicesCount; - } - - /** - * 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/IoTSecuritySolutionAnalyticsModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionAnalyticsModel.java deleted file mode 100644 index e0bd62d8d918..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionAnalyticsModel.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner; -import java.util.List; - -/** An immutable client-side representation of IoTSecuritySolutionAnalyticsModel. */ -public interface IoTSecuritySolutionAnalyticsModel { - /** - * 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 metrics property: Security analytics of your IoT Security solution. - * - * @return the metrics value. - */ - IoTSeverityMetrics metrics(); - - /** - * Gets the unhealthyDeviceCount property: Number of unhealthy devices within your IoT Security solution. - * - * @return the unhealthyDeviceCount value. - */ - Long unhealthyDeviceCount(); - - /** - * Gets the devicesMetrics property: List of device metrics by the aggregation date. - * - * @return the devicesMetrics value. - */ - List devicesMetrics(); - - /** - * Gets the topAlertedDevices property: List of the 3 devices with the most alerts. - * - * @return the topAlertedDevices value. - */ - List topAlertedDevices(); - - /** - * Gets the mostPrevalentDeviceAlerts property: List of the 3 most prevalent device alerts. - * - * @return the mostPrevalentDeviceAlerts value. - */ - List mostPrevalentDeviceAlerts(); - - /** - * Gets the mostPrevalentDeviceRecommendations property: List of the 3 most prevalent device recommendations. - * - * @return the mostPrevalentDeviceRecommendations value. - */ - List mostPrevalentDeviceRecommendations(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner object. - * - * @return the inner object. - */ - IoTSecuritySolutionAnalyticsModelInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionAnalyticsModelList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionAnalyticsModelList.java deleted file mode 100644 index 8e98aa8fd4e6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionAnalyticsModelList.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelListInner; -import java.util.List; - -/** An immutable client-side representation of IoTSecuritySolutionAnalyticsModelList. */ -public interface IoTSecuritySolutionAnalyticsModelList { - /** - * Gets the value property: List of Security analytics of your IoT Security solution. - * - * @return the value value. - */ - List value(); - - /** - * Gets the nextLink property: When there is too much alert data for one page, use this URI to fetch the next page. - * - * @return the nextLink value. - */ - String nextLink(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelListInner - * object. - * - * @return the inner object. - */ - IoTSecuritySolutionAnalyticsModelListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem.java deleted file mode 100644 index c0f6ae3a6e97..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem model. */ -@Fluent -public final class IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem { - /* - * Aggregation of IoT Security solution device alert metrics by date. - */ - @JsonProperty(value = "date") - private OffsetDateTime date; - - /* - * Device alert count by severity. - */ - @JsonProperty(value = "devicesMetrics") - private IoTSeverityMetrics devicesMetrics; - - /** Creates an instance of IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem class. */ - public IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem() { - } - - /** - * Get the date property: Aggregation of IoT Security solution device alert metrics by date. - * - * @return the date value. - */ - public OffsetDateTime date() { - return this.date; - } - - /** - * Set the date property: Aggregation of IoT Security solution device alert metrics by date. - * - * @param date the date value to set. - * @return the IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem object itself. - */ - public IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem withDate(OffsetDateTime date) { - this.date = date; - return this; - } - - /** - * Get the devicesMetrics property: Device alert count by severity. - * - * @return the devicesMetrics value. - */ - public IoTSeverityMetrics devicesMetrics() { - return this.devicesMetrics; - } - - /** - * Set the devicesMetrics property: Device alert count by severity. - * - * @param devicesMetrics the devicesMetrics value to set. - * @return the IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem object itself. - */ - public IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem withDevicesMetrics( - IoTSeverityMetrics devicesMetrics) { - this.devicesMetrics = devicesMetrics; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (devicesMetrics() != null) { - devicesMetrics().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionModel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionModel.java deleted file mode 100644 index bfab666b43c9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionModel.java +++ /dev/null @@ -1,427 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of IoTSecuritySolutionModel. */ -public interface IoTSecuritySolutionModel { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: The resource location. - * - * @return the location value. - */ - String location(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the workspace property: Workspace resource ID. - * - * @return the workspace value. - */ - String workspace(); - - /** - * Gets the displayName property: Resource display name. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the status property: Status of the IoT Security solution. - * - * @return the status value. - */ - SecuritySolutionStatus status(); - - /** - * Gets the export property: List of additional options for exporting to workspace data. - * - * @return the export value. - */ - List export(); - - /** - * Gets the disabledDataSources property: Disabled data sources. Disabling these data sources compromises the - * system. - * - * @return the disabledDataSources value. - */ - List disabledDataSources(); - - /** - * Gets the iotHubs property: IoT Hub resource IDs. - * - * @return the iotHubs value. - */ - List iotHubs(); - - /** - * Gets the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @return the userDefinedResources value. - */ - UserDefinedResourcesProperties userDefinedResources(); - - /** - * Gets the autoDiscoveredResources property: List of resources that were automatically discovered as relevant to - * the security solution. - * - * @return the autoDiscoveredResources value. - */ - List autoDiscoveredResources(); - - /** - * Gets the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @return the recommendationsConfiguration value. - */ - List recommendationsConfiguration(); - - /** - * Gets the unmaskedIpLoggingStatus property: Unmasked IP address logging status. - * - * @return the unmaskedIpLoggingStatus value. - */ - UnmaskedIpLoggingStatus unmaskedIpLoggingStatus(); - - /** - * Gets the additionalWorkspaces property: List of additional workspaces. - * - * @return the additionalWorkspaces value. - */ - List additionalWorkspaces(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner object. - * - * @return the inner object. - */ - IoTSecuritySolutionModelInner innerModel(); - - /** The entirety of the IoTSecuritySolutionModel definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { - } - /** The IoTSecuritySolutionModel definition stages. */ - interface DefinitionStages { - /** The first stage of the IoTSecuritySolutionModel definition. */ - interface Blank extends WithResourceGroup { - } - /** The stage of the IoTSecuritySolutionModel definition allowing to specify parent resource. */ - interface WithResourceGroup { - /** - * 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 IoTSecuritySolutionModel definition which contains all the minimum required properties for - * the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithLocation, - DefinitionStages.WithTags, - DefinitionStages.WithWorkspace, - DefinitionStages.WithDisplayName, - DefinitionStages.WithStatus, - DefinitionStages.WithExport, - DefinitionStages.WithDisabledDataSources, - DefinitionStages.WithIotHubs, - DefinitionStages.WithUserDefinedResources, - DefinitionStages.WithRecommendationsConfiguration, - DefinitionStages.WithUnmaskedIpLoggingStatus, - DefinitionStages.WithAdditionalWorkspaces { - /** - * Executes the create request. - * - * @return the created resource. - */ - IoTSecuritySolutionModel create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - IoTSecuritySolutionModel create(Context context); - } - /** The stage of the IoTSecuritySolutionModel definition allowing to specify location. */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The resource location. - * @return the next definition stage. - */ - WithCreate withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The resource location. - * @return the next definition stage. - */ - WithCreate withRegion(String location); - } - /** The stage of the IoTSecuritySolutionModel definition allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - /** The stage of the IoTSecuritySolutionModel definition allowing to specify workspace. */ - interface WithWorkspace { - /** - * Specifies the workspace property: Workspace resource ID. - * - * @param workspace Workspace resource ID. - * @return the next definition stage. - */ - WithCreate withWorkspace(String workspace); - } - /** The stage of the IoTSecuritySolutionModel definition allowing to specify displayName. */ - interface WithDisplayName { - /** - * Specifies the displayName property: Resource display name.. - * - * @param displayName Resource display name. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - /** The stage of the IoTSecuritySolutionModel definition allowing to specify status. */ - interface WithStatus { - /** - * Specifies the status property: Status of the IoT Security solution.. - * - * @param status Status of the IoT Security solution. - * @return the next definition stage. - */ - WithCreate withStatus(SecuritySolutionStatus status); - } - /** The stage of the IoTSecuritySolutionModel definition allowing to specify export. */ - interface WithExport { - /** - * Specifies the export property: List of additional options for exporting to workspace data.. - * - * @param export List of additional options for exporting to workspace data. - * @return the next definition stage. - */ - WithCreate withExport(List export); - } - /** The stage of the IoTSecuritySolutionModel definition allowing to specify disabledDataSources. */ - interface WithDisabledDataSources { - /** - * Specifies the disabledDataSources property: Disabled data sources. Disabling these data sources - * compromises the system.. - * - * @param disabledDataSources Disabled data sources. Disabling these data sources compromises the system. - * @return the next definition stage. - */ - WithCreate withDisabledDataSources(List disabledDataSources); - } - /** The stage of the IoTSecuritySolutionModel definition allowing to specify iotHubs. */ - interface WithIotHubs { - /** - * Specifies the iotHubs property: IoT Hub resource IDs. - * - * @param iotHubs IoT Hub resource IDs. - * @return the next definition stage. - */ - WithCreate withIotHubs(List iotHubs); - } - /** The stage of the IoTSecuritySolutionModel definition allowing to specify userDefinedResources. */ - interface WithUserDefinedResources { - /** - * Specifies the userDefinedResources property: Properties of the IoT Security solution's user defined - * resources.. - * - * @param userDefinedResources Properties of the IoT Security solution's user defined resources. - * @return the next definition stage. - */ - WithCreate withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources); - } - /** The stage of the IoTSecuritySolutionModel definition allowing to specify recommendationsConfiguration. */ - interface WithRecommendationsConfiguration { - /** - * Specifies the recommendationsConfiguration property: List of the configuration status for each - * recommendation type.. - * - * @param recommendationsConfiguration List of the configuration status for each recommendation type. - * @return the next definition stage. - */ - WithCreate withRecommendationsConfiguration( - List recommendationsConfiguration); - } - /** The stage of the IoTSecuritySolutionModel definition allowing to specify unmaskedIpLoggingStatus. */ - interface WithUnmaskedIpLoggingStatus { - /** - * Specifies the unmaskedIpLoggingStatus property: Unmasked IP address logging status. - * - * @param unmaskedIpLoggingStatus Unmasked IP address logging status. - * @return the next definition stage. - */ - WithCreate withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus unmaskedIpLoggingStatus); - } - /** The stage of the IoTSecuritySolutionModel definition allowing to specify additionalWorkspaces. */ - interface WithAdditionalWorkspaces { - /** - * Specifies the additionalWorkspaces property: List of additional workspaces. - * - * @param additionalWorkspaces List of additional workspaces. - * @return the next definition stage. - */ - WithCreate withAdditionalWorkspaces(List additionalWorkspaces); - } - } - /** - * Begins update for the IoTSecuritySolutionModel resource. - * - * @return the stage of resource update. - */ - IoTSecuritySolutionModel.Update update(); - - /** The template for IoTSecuritySolutionModel update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithUserDefinedResources, - UpdateStages.WithRecommendationsConfiguration { - /** - * Executes the update request. - * - * @return the updated resource. - */ - IoTSecuritySolutionModel apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - IoTSecuritySolutionModel apply(Context context); - } - /** The IoTSecuritySolutionModel update stages. */ - interface UpdateStages { - /** The stage of the IoTSecuritySolutionModel update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - /** The stage of the IoTSecuritySolutionModel update allowing to specify userDefinedResources. */ - interface WithUserDefinedResources { - /** - * Specifies the userDefinedResources property: Properties of the IoT Security solution's user defined - * resources.. - * - * @param userDefinedResources Properties of the IoT Security solution's user defined resources. - * @return the next definition stage. - */ - Update withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources); - } - /** The stage of the IoTSecuritySolutionModel update allowing to specify recommendationsConfiguration. */ - interface WithRecommendationsConfiguration { - /** - * Specifies the recommendationsConfiguration property: List of the configuration status for each - * recommendation type.. - * - * @param recommendationsConfiguration List of the configuration status for each recommendation type. - * @return the next definition stage. - */ - Update withRecommendationsConfiguration( - List recommendationsConfiguration); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - IoTSecuritySolutionModel refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - IoTSecuritySolutionModel refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionsList.java deleted file mode 100644 index d78336fc315a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSecuritySolutionsList.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of IoT Security solutions. */ -@Fluent -public final class IoTSecuritySolutionsList { - /* - * List of IoT Security solutions - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of IoTSecuritySolutionsList class. */ - public IoTSecuritySolutionsList() { - } - - /** - * Get the value property: List of IoT Security solutions. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of IoT Security solutions. - * - * @param value the value value to set. - * @return the IoTSecuritySolutionsList object itself. - */ - public IoTSecuritySolutionsList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model IoTSecuritySolutionsList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(IoTSecuritySolutionsList.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSeverityMetrics.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSeverityMetrics.java deleted file mode 100644 index 2b9d02e9d385..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IoTSeverityMetrics.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** IoT Security solution analytics severity metrics. */ -@Fluent -public final class IoTSeverityMetrics { - /* - * Count of high severity alerts/recommendations. - */ - @JsonProperty(value = "high") - private Long high; - - /* - * Count of medium severity alerts/recommendations. - */ - @JsonProperty(value = "medium") - private Long medium; - - /* - * Count of low severity alerts/recommendations. - */ - @JsonProperty(value = "low") - private Long low; - - /** Creates an instance of IoTSeverityMetrics class. */ - public IoTSeverityMetrics() { - } - - /** - * Get the high property: Count of high severity alerts/recommendations. - * - * @return the high value. - */ - public Long high() { - return this.high; - } - - /** - * Set the high property: Count of high severity alerts/recommendations. - * - * @param high the high value to set. - * @return the IoTSeverityMetrics object itself. - */ - public IoTSeverityMetrics withHigh(Long high) { - this.high = high; - return this; - } - - /** - * Get the medium property: Count of medium severity alerts/recommendations. - * - * @return the medium value. - */ - public Long medium() { - return this.medium; - } - - /** - * Set the medium property: Count of medium severity alerts/recommendations. - * - * @param medium the medium value to set. - * @return the IoTSeverityMetrics object itself. - */ - public IoTSeverityMetrics withMedium(Long medium) { - this.medium = medium; - return this; - } - - /** - * Get the low property: Count of low severity alerts/recommendations. - * - * @return the low value. - */ - public Long low() { - return this.low; - } - - /** - * Set the low property: Count of low severity alerts/recommendations. - * - * @param low the low value to set. - * @return the IoTSeverityMetrics object itself. - */ - public IoTSeverityMetrics withLow(Long low) { - this.low = low; - 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/IotSecuritySolutionAnalytics.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutionAnalytics.java deleted file mode 100644 index 046b0e813aa7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutionAnalytics.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of IotSecuritySolutionAnalytics. */ -public interface IotSecuritySolutionAnalytics { - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution along with {@link Response}. - */ - Response listWithResponse( - String resourceGroupName, String solutionName, Context context); - - /** - * Use this method to get IoT security Analytics metrics in an array. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of Security analytics of your IoT Security solution. - */ - IoTSecuritySolutionAnalyticsModelList list(String resourceGroupName, String solutionName); - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 analytics of your IoT Security solution along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String solutionName, Context context); - - /** - * Use this method to get IoT Security Analytics metrics. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 analytics of your IoT Security solution. - */ - IoTSecuritySolutionAnalyticsModel get(String resourceGroupName, String solutionName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutions.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutions.java deleted file mode 100644 index 88de488665d8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutions.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.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 IotSecuritySolutions. */ -public interface IotSecuritySolutions { - /** - * Use this method to get the list of IoT Security solutions by 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 IoT Security solutions as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Use this method to get the list of IoT Security solutions by subscription. - * - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 Security solutions as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String filter, Context context); - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of IoT Security solutions as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Use this method to get the list IoT Security solutions organized by resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param filter Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 Security solutions as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup( - String resourceGroupName, String filter, Context context); - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Security solution configuration and resource information along with {@link Response}. - */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String solutionName, Context context); - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Security solution configuration and resource information. - */ - IoTSecuritySolutionModel getByResourceGroup(String resourceGroupName, String solutionName); - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByResourceGroupWithResponse(String resourceGroupName, String solutionName, Context context); - - /** - * Use this method to delete yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String solutionName); - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @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 Security solution configuration and resource information along with {@link Response}. - */ - IoTSecuritySolutionModel getById(String id); - - /** - * User this method to get details of a specific IoT Security solution based on solution name. - * - * @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 Security solution configuration and resource information along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Use this method to delete yours IoT Security solution. - * - * @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); - - /** - * Use this method to delete yours IoT Security solution. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new IoTSecuritySolutionModel resource. - * - * @param name resource name. - * @return the first stage of the new IoTSecuritySolutionModel definition. - */ - IoTSecuritySolutionModel.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutionsAnalyticsAggregatedAlerts.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutionsAnalyticsAggregatedAlerts.java deleted file mode 100644 index f49eb2da4989..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutionsAnalyticsAggregatedAlerts.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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 IotSecuritySolutionsAnalyticsAggregatedAlerts. */ -public interface IotSecuritySolutionsAnalyticsAggregatedAlerts { - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 Security solution aggregated alert data as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String solutionName); - - /** - * Use this method to get the aggregated alert list of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 Security solution aggregated alert data as paginated response with {@link PagedIterable}. - */ - PagedIterable list( - String resourceGroupName, String solutionName, Integer top, Context context); - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 security Solution Aggregated Alert information along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String solutionName, String aggregatedAlertName, Context context); - - /** - * Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 security Solution Aggregated Alert information. - */ - IoTSecurityAggregatedAlert get(String resourceGroupName, String solutionName, String aggregatedAlertName); - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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 the {@link Response}. - */ - Response dismissWithResponse( - String resourceGroupName, String solutionName, String aggregatedAlertName, Context context); - - /** - * Use this method to dismiss an aggregated IoT Security Solution Alert. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedAlertName Identifier of the aggregated 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. - */ - void dismiss(String resourceGroupName, String solutionName, String aggregatedAlertName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutionsAnalyticsRecommendations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutionsAnalyticsRecommendations.java deleted file mode 100644 index 6648f6a16781..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSecuritySolutionsAnalyticsRecommendations.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.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of IotSecuritySolutionsAnalyticsRecommendations. */ -public interface IotSecuritySolutionsAnalyticsRecommendations { - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Security solution recommendation information along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String solutionName, String aggregatedRecommendationName, Context context); - - /** - * Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This - * aggregation is performed by recommendation name. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param aggregatedRecommendationName Name of the recommendation aggregated for this query. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Security solution recommendation information. - */ - IoTSecurityAggregatedRecommendation get( - String resourceGroupName, String solutionName, String aggregatedRecommendationName); - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 Security solution aggregated recommendations as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String solutionName); - - /** - * Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param solutionName The name of the IoT Security solution. - * @param top Number of results to retrieve. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown 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 Security solution aggregated recommendations as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list( - String resourceGroupName, String solutionName, Integer top, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IsEnabled.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IsEnabled.java deleted file mode 100644 index ac17c1b7f94d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IsEnabled.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Indicates whether the extension is enabled. */ -public final class IsEnabled extends ExpandableStringEnum { - /** Static value True for IsEnabled. */ - public static final IsEnabled TRUE = fromString("True"); - - /** Static value False for IsEnabled. */ - public static final IsEnabled FALSE = fromString("False"); - - /** - * Creates a new instance of IsEnabled value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IsEnabled() { - } - - /** - * Creates or finds a IsEnabled from its string representation. - * - * @param name a name to look for. - * @return the corresponding IsEnabled. - */ - @JsonCreator - public static IsEnabled fromString(String name) { - return fromString(name, IsEnabled.class); - } - - /** - * Gets known IsEnabled values. - * - * @return known IsEnabled values. - */ - public static Collection values() { - return values(IsEnabled.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Issue.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Issue.java deleted file mode 100644 index f35226ffafe2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Issue.java +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The issue that caused the resource to by unhealthy. */ -@Fluent -public final class Issue { - /* - * The unique issue key - */ - @JsonProperty(value = "issueKey", required = true) - private String issueKey; - - /* - * The issue name - */ - @JsonProperty(value = "issueName") - private String issueName; - - /* - * The affected security values that MDC offers that will be affected by the issue, for example: recommendations, - * alerts, etc - */ - @JsonProperty(value = "securityValues") - private List securityValues; - - /* - * The issue description - */ - @JsonProperty(value = "issueDescription") - private String issueDescription; - - /* - * Human readable description of what you should do to mitigate this health issue - */ - @JsonProperty(value = "remediationSteps") - private String remediationSteps; - - /* - * The remediation script to solve this issue - */ - @JsonProperty(value = "remediationScript") - private String remediationScript; - - /* - * Additional data for the given issue. The additional data depends on the issue type - */ - @JsonProperty(value = "issueAdditionalData") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map issueAdditionalData; - - /** Creates an instance of Issue class. */ - public Issue() { - } - - /** - * Get the issueKey property: The unique issue key. - * - * @return the issueKey value. - */ - public String issueKey() { - return this.issueKey; - } - - /** - * Set the issueKey property: The unique issue key. - * - * @param issueKey the issueKey value to set. - * @return the Issue object itself. - */ - public Issue withIssueKey(String issueKey) { - this.issueKey = issueKey; - return this; - } - - /** - * Get the issueName property: The issue name. - * - * @return the issueName value. - */ - public String issueName() { - return this.issueName; - } - - /** - * Set the issueName property: The issue name. - * - * @param issueName the issueName value to set. - * @return the Issue object itself. - */ - public Issue withIssueName(String issueName) { - this.issueName = issueName; - return this; - } - - /** - * Get the securityValues property: The affected security values that MDC offers that will be affected by the issue, - * for example: recommendations, alerts, etc. - * - * @return the securityValues value. - */ - public List securityValues() { - return this.securityValues; - } - - /** - * Set the securityValues property: The affected security values that MDC offers that will be affected by the issue, - * for example: recommendations, alerts, etc. - * - * @param securityValues the securityValues value to set. - * @return the Issue object itself. - */ - public Issue withSecurityValues(List securityValues) { - this.securityValues = securityValues; - return this; - } - - /** - * Get the issueDescription property: The issue description. - * - * @return the issueDescription value. - */ - public String issueDescription() { - return this.issueDescription; - } - - /** - * Set the issueDescription property: The issue description. - * - * @param issueDescription the issueDescription value to set. - * @return the Issue object itself. - */ - public Issue withIssueDescription(String issueDescription) { - this.issueDescription = issueDescription; - return this; - } - - /** - * Get the remediationSteps property: Human readable description of what you should do to mitigate this health - * issue. - * - * @return the remediationSteps value. - */ - public String remediationSteps() { - return this.remediationSteps; - } - - /** - * Set the remediationSteps property: Human readable description of what you should do to mitigate this health - * issue. - * - * @param remediationSteps the remediationSteps value to set. - * @return the Issue object itself. - */ - public Issue withRemediationSteps(String remediationSteps) { - this.remediationSteps = remediationSteps; - return this; - } - - /** - * Get the remediationScript property: The remediation script to solve this issue. - * - * @return the remediationScript value. - */ - public String remediationScript() { - return this.remediationScript; - } - - /** - * Set the remediationScript property: The remediation script to solve this issue. - * - * @param remediationScript the remediationScript value to set. - * @return the Issue object itself. - */ - public Issue withRemediationScript(String remediationScript) { - this.remediationScript = remediationScript; - return this; - } - - /** - * Get the issueAdditionalData property: Additional data for the given issue. The additional data depends on the - * issue type. - * - * @return the issueAdditionalData value. - */ - public Map issueAdditionalData() { - return this.issueAdditionalData; - } - - /** - * Set the issueAdditionalData property: Additional data for the given issue. The additional data depends on the - * issue type. - * - * @param issueAdditionalData the issueAdditionalData value to set. - * @return the Issue object itself. - */ - public Issue withIssueAdditionalData(Map issueAdditionalData) { - this.issueAdditionalData = issueAdditionalData; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (issueKey() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property issueKey in model Issue")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Issue.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicies.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicies.java deleted file mode 100644 index 92e516a6d1d5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicies.java +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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 JitNetworkAccessPolicies. */ -public interface JitNetworkAccessPolicies { - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Policies for protecting resources using Just-in-Time access control. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - PagedIterable listByRegion(String ascLocation); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - PagedIterable listByRegion(String ascLocation, Context context); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 the paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroupAndRegion(String resourceGroupName, String ascLocation); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroupAndRegion( - String resourceGroupName, String ascLocation, Context context); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - JitNetworkAccessPolicy get(String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName); - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse( - String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName, Context context); - - /** - * Delete a Just-in-Time access control policy. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String ascLocation, String jitNetworkAccessPolicyName); - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - Response initiateWithResponse( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest body, - Context context); - - /** - * Initiate a JIT access from a specific Just-in-Time policy configuration. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param jitNetworkAccessPolicyName Name of a Just-in-Time access configuration policy. - * @param body The body parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - JitNetworkAccessRequest initiate( - String resourceGroupName, - String ascLocation, - String jitNetworkAccessPolicyName, - JitNetworkAccessPolicyInitiateRequest body); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 body along with {@link Response}. - */ - JitNetworkAccessPolicy getById(String id); - - /** - * Policies for protecting resources using Just-in-Time access control for the subscription, location. - * - * @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 body along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a Just-in-Time access control policy. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete a Just-in-Time access control policy. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new JitNetworkAccessPolicy resource. - * - * @param name resource name. - * @return the first stage of the new JitNetworkAccessPolicy definition. - */ - JitNetworkAccessPolicy.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPoliciesList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPoliciesList.java deleted file mode 100644 index 61d94c76c6dc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPoliciesList.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The JitNetworkAccessPoliciesList model. */ -@Fluent -public final class JitNetworkAccessPoliciesList { - /* - * The value property. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of JitNetworkAccessPoliciesList class. */ - public JitNetworkAccessPoliciesList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the JitNetworkAccessPoliciesList object itself. - */ - public JitNetworkAccessPoliciesList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicy.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicy.java deleted file mode 100644 index ae1a0b0a7eef..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicy.java +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.Region; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import java.util.List; - -/** An immutable client-side representation of JitNetworkAccessPolicy. */ -public interface JitNetworkAccessPolicy { - /** - * 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 kind property: Kind of the resource. - * - * @return the kind value. - */ - String kind(); - - /** - * Gets the location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - - /** - * Gets the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource type. - * - * @return the virtualMachines value. - */ - List virtualMachines(); - - /** - * Gets the requests property: The requests property. - * - * @return the requests value. - */ - List requests(); - - /** - * Gets the provisioningState property: Gets the provisioning state of the Just-in-Time policy. - * - * @return the provisioningState value. - */ - String provisioningState(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner object. - * - * @return the inner object. - */ - JitNetworkAccessPolicyInner innerModel(); - - /** The entirety of the JitNetworkAccessPolicy definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithParentResource, - DefinitionStages.WithVirtualMachines, - DefinitionStages.WithCreate { - } - /** The JitNetworkAccessPolicy definition stages. */ - interface DefinitionStages { - /** The first stage of the JitNetworkAccessPolicy definition. */ - interface Blank extends WithParentResource { - } - /** The stage of the JitNetworkAccessPolicy definition allowing to specify parent resource. */ - interface WithParentResource { - /** - * Specifies resourceGroupName, ascLocation. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @return the next definition stage. - */ - WithVirtualMachines withExistingLocation(String resourceGroupName, String ascLocation); - } - /** The stage of the JitNetworkAccessPolicy definition allowing to specify virtualMachines. */ - interface WithVirtualMachines { - /** - * Specifies the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource - * type.. - * - * @param virtualMachines Configurations for Microsoft.Compute/virtualMachines resource type. - * @return the next definition stage. - */ - WithCreate withVirtualMachines(List virtualMachines); - } - /** - * The stage of the JitNetworkAccessPolicy definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithKind, DefinitionStages.WithRequests { - /** - * Executes the create request. - * - * @return the created resource. - */ - JitNetworkAccessPolicy create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - JitNetworkAccessPolicy create(Context context); - } - /** The stage of the JitNetworkAccessPolicy definition allowing to specify kind. */ - interface WithKind { - /** - * Specifies the kind property: Kind of the resource. - * - * @param kind Kind of the resource. - * @return the next definition stage. - */ - WithCreate withKind(String kind); - } - /** The stage of the JitNetworkAccessPolicy definition allowing to specify requests. */ - interface WithRequests { - /** - * Specifies the requests property: The requests property.. - * - * @param requests The requests property. - * @return the next definition stage. - */ - WithCreate withRequests(List requests); - } - } - /** - * Begins update for the JitNetworkAccessPolicy resource. - * - * @return the stage of resource update. - */ - JitNetworkAccessPolicy.Update update(); - - /** The template for JitNetworkAccessPolicy update. */ - interface Update extends UpdateStages.WithKind, UpdateStages.WithVirtualMachines, UpdateStages.WithRequests { - /** - * Executes the update request. - * - * @return the updated resource. - */ - JitNetworkAccessPolicy apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - JitNetworkAccessPolicy apply(Context context); - } - /** The JitNetworkAccessPolicy update stages. */ - interface UpdateStages { - /** The stage of the JitNetworkAccessPolicy update allowing to specify kind. */ - interface WithKind { - /** - * Specifies the kind property: Kind of the resource. - * - * @param kind Kind of the resource. - * @return the next definition stage. - */ - Update withKind(String kind); - } - /** The stage of the JitNetworkAccessPolicy update allowing to specify virtualMachines. */ - interface WithVirtualMachines { - /** - * Specifies the virtualMachines property: Configurations for Microsoft.Compute/virtualMachines resource - * type.. - * - * @param virtualMachines Configurations for Microsoft.Compute/virtualMachines resource type. - * @return the next definition stage. - */ - Update withVirtualMachines(List virtualMachines); - } - /** The stage of the JitNetworkAccessPolicy update allowing to specify requests. */ - interface WithRequests { - /** - * Specifies the requests property: The requests property.. - * - * @param requests The requests property. - * @return the next definition stage. - */ - Update withRequests(List requests); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - JitNetworkAccessPolicy refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - JitNetworkAccessPolicy refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyInitiatePort.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyInitiatePort.java deleted file mode 100644 index ba83fa723e4a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyInitiatePort.java +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The JitNetworkAccessPolicyInitiatePort model. */ -@Fluent -public final class JitNetworkAccessPolicyInitiatePort { - /* - * The number property. - */ - @JsonProperty(value = "number", required = true) - private int number; - - /* - * Source of the allowed traffic. If omitted, the request will be for the source IP address of the initiate - * request. - */ - @JsonProperty(value = "allowedSourceAddressPrefix") - private String allowedSourceAddressPrefix; - - /* - * The time to close the request in UTC - */ - @JsonProperty(value = "endTimeUtc", required = true) - private OffsetDateTime endTimeUtc; - - /** Creates an instance of JitNetworkAccessPolicyInitiatePort class. */ - public JitNetworkAccessPolicyInitiatePort() { - } - - /** - * Get the number property: The number property. - * - * @return the number value. - */ - public int number() { - return this.number; - } - - /** - * Set the number property: The number property. - * - * @param number the number value to set. - * @return the JitNetworkAccessPolicyInitiatePort object itself. - */ - public JitNetworkAccessPolicyInitiatePort withNumber(int number) { - this.number = number; - return this; - } - - /** - * Get the allowedSourceAddressPrefix property: Source of the allowed traffic. If omitted, the request will be for - * the source IP address of the initiate request. - * - * @return the allowedSourceAddressPrefix value. - */ - public String allowedSourceAddressPrefix() { - return this.allowedSourceAddressPrefix; - } - - /** - * Set the allowedSourceAddressPrefix property: Source of the allowed traffic. If omitted, the request will be for - * the source IP address of the initiate request. - * - * @param allowedSourceAddressPrefix the allowedSourceAddressPrefix value to set. - * @return the JitNetworkAccessPolicyInitiatePort object itself. - */ - public JitNetworkAccessPolicyInitiatePort withAllowedSourceAddressPrefix(String allowedSourceAddressPrefix) { - this.allowedSourceAddressPrefix = allowedSourceAddressPrefix; - return this; - } - - /** - * Get the endTimeUtc property: The time to close the request in UTC. - * - * @return the endTimeUtc value. - */ - public OffsetDateTime endTimeUtc() { - return this.endTimeUtc; - } - - /** - * Set the endTimeUtc property: The time to close the request in UTC. - * - * @param endTimeUtc the endTimeUtc value to set. - * @return the JitNetworkAccessPolicyInitiatePort object itself. - */ - public JitNetworkAccessPolicyInitiatePort withEndTimeUtc(OffsetDateTime endTimeUtc) { - this.endTimeUtc = endTimeUtc; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (endTimeUtc() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property endTimeUtc in model JitNetworkAccessPolicyInitiatePort")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessPolicyInitiatePort.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyInitiateRequest.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyInitiateRequest.java deleted file mode 100644 index cc2b48c70338..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyInitiateRequest.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The JitNetworkAccessPolicyInitiateRequest model. */ -@Fluent -public final class JitNetworkAccessPolicyInitiateRequest { - /* - * A list of virtual machines & ports to open access for - */ - @JsonProperty(value = "virtualMachines", required = true) - private List virtualMachines; - - /* - * The justification for making the initiate request - */ - @JsonProperty(value = "justification") - private String justification; - - /** Creates an instance of JitNetworkAccessPolicyInitiateRequest class. */ - public JitNetworkAccessPolicyInitiateRequest() { - } - - /** - * Get the virtualMachines property: A list of virtual machines & ports to open access for. - * - * @return the virtualMachines value. - */ - public List virtualMachines() { - return this.virtualMachines; - } - - /** - * Set the virtualMachines property: A list of virtual machines & ports to open access for. - * - * @param virtualMachines the virtualMachines value to set. - * @return the JitNetworkAccessPolicyInitiateRequest object itself. - */ - public JitNetworkAccessPolicyInitiateRequest withVirtualMachines( - List virtualMachines) { - this.virtualMachines = virtualMachines; - return this; - } - - /** - * Get the justification property: The justification for making the initiate request. - * - * @return the justification value. - */ - public String justification() { - return this.justification; - } - - /** - * Set the justification property: The justification for making the initiate request. - * - * @param justification the justification value to set. - * @return the JitNetworkAccessPolicyInitiateRequest object itself. - */ - public JitNetworkAccessPolicyInitiateRequest withJustification(String justification) { - this.justification = justification; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (virtualMachines() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property virtualMachines in model JitNetworkAccessPolicyInitiateRequest")); - } else { - virtualMachines().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessPolicyInitiateRequest.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyInitiateVirtualMachine.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyInitiateVirtualMachine.java deleted file mode 100644 index b2d94e882c09..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyInitiateVirtualMachine.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The JitNetworkAccessPolicyInitiateVirtualMachine model. */ -@Fluent -public final class JitNetworkAccessPolicyInitiateVirtualMachine { - /* - * Resource ID of the virtual machine that is linked to this policy - */ - @JsonProperty(value = "id", required = true) - private String id; - - /* - * The ports to open for the resource with the `id` - */ - @JsonProperty(value = "ports", required = true) - private List ports; - - /** Creates an instance of JitNetworkAccessPolicyInitiateVirtualMachine class. */ - public JitNetworkAccessPolicyInitiateVirtualMachine() { - } - - /** - * Get the id property: Resource ID of the virtual machine that is linked to this policy. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID of the virtual machine that is linked to this policy. - * - * @param id the id value to set. - * @return the JitNetworkAccessPolicyInitiateVirtualMachine object itself. - */ - public JitNetworkAccessPolicyInitiateVirtualMachine withId(String id) { - this.id = id; - return this; - } - - /** - * Get the ports property: The ports to open for the resource with the `id`. - * - * @return the ports value. - */ - public List ports() { - return this.ports; - } - - /** - * Set the ports property: The ports to open for the resource with the `id`. - * - * @param ports the ports value to set. - * @return the JitNetworkAccessPolicyInitiateVirtualMachine object itself. - */ - public JitNetworkAccessPolicyInitiateVirtualMachine withPorts(List ports) { - this.ports = ports; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (id() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property id in model JitNetworkAccessPolicyInitiateVirtualMachine")); - } - if (ports() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ports in model JitNetworkAccessPolicyInitiateVirtualMachine")); - } else { - ports().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessPolicyInitiateVirtualMachine.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyVirtualMachine.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyVirtualMachine.java deleted file mode 100644 index dc96c3012fbe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPolicyVirtualMachine.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.JsonProperty; -import java.util.List; - -/** The JitNetworkAccessPolicyVirtualMachine model. */ -@Fluent -public final class JitNetworkAccessPolicyVirtualMachine { - /* - * Resource ID of the virtual machine that is linked to this policy - */ - @JsonProperty(value = "id", required = true) - private String id; - - /* - * Port configurations for the virtual machine - */ - @JsonProperty(value = "ports", required = true) - private List ports; - - /* - * Public IP address of the Azure Firewall that is linked to this policy, if applicable - */ - @JsonProperty(value = "publicIpAddress") - private String publicIpAddress; - - /** Creates an instance of JitNetworkAccessPolicyVirtualMachine class. */ - public JitNetworkAccessPolicyVirtualMachine() { - } - - /** - * Get the id property: Resource ID of the virtual machine that is linked to this policy. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID of the virtual machine that is linked to this policy. - * - * @param id the id value to set. - * @return the JitNetworkAccessPolicyVirtualMachine object itself. - */ - public JitNetworkAccessPolicyVirtualMachine withId(String id) { - this.id = id; - return this; - } - - /** - * Get the ports property: Port configurations for the virtual machine. - * - * @return the ports value. - */ - public List ports() { - return this.ports; - } - - /** - * Set the ports property: Port configurations for the virtual machine. - * - * @param ports the ports value to set. - * @return the JitNetworkAccessPolicyVirtualMachine object itself. - */ - public JitNetworkAccessPolicyVirtualMachine withPorts(List ports) { - this.ports = ports; - return this; - } - - /** - * Get the publicIpAddress property: Public IP address of the Azure Firewall that is linked to this policy, if - * applicable. - * - * @return the publicIpAddress value. - */ - public String publicIpAddress() { - return this.publicIpAddress; - } - - /** - * Set the publicIpAddress property: Public IP address of the Azure Firewall that is linked to this policy, if - * applicable. - * - * @param publicIpAddress the publicIpAddress value to set. - * @return the JitNetworkAccessPolicyVirtualMachine object itself. - */ - public JitNetworkAccessPolicyVirtualMachine withPublicIpAddress(String publicIpAddress) { - this.publicIpAddress = publicIpAddress; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (id() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property id in model JitNetworkAccessPolicyVirtualMachine")); - } - if (ports() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ports in model JitNetworkAccessPolicyVirtualMachine")); - } else { - ports().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessPolicyVirtualMachine.class); -} 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 deleted file mode 100644 index 7c05517e6835..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessPortRule.java +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The JitNetworkAccessPortRule model. */ -@Fluent -public final class JitNetworkAccessPortRule { - /* - * The number property. - */ - @JsonProperty(value = "number", required = true) - private int number; - - /* - * The protocol property. - */ - @JsonProperty(value = "protocol", required = true) - private Protocol protocol; - - /* - * Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, for - * example "192.168.0.3" or "192.168.0.0/16". - */ - @JsonProperty(value = "allowedSourceAddressPrefix") - private String allowedSourceAddressPrefix; - - /* - * Mutually exclusive with the "allowedSourceAddressPrefix" parameter. - */ - @JsonProperty(value = "allowedSourceAddressPrefixes") - private List allowedSourceAddressPrefixes; - - /* - * Maximum duration requests can be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day - */ - @JsonProperty(value = "maxRequestAccessDuration", required = true) - private String maxRequestAccessDuration; - - /** Creates an instance of JitNetworkAccessPortRule class. */ - public JitNetworkAccessPortRule() { - } - - /** - * Get the number property: The number property. - * - * @return the number value. - */ - public int number() { - return this.number; - } - - /** - * Set the number property: The number property. - * - * @param number the number value to set. - * @return the JitNetworkAccessPortRule object itself. - */ - public JitNetworkAccessPortRule withNumber(int number) { - this.number = number; - return this; - } - - /** - * Get the protocol property: The protocol property. - * - * @return the protocol value. - */ - public Protocol protocol() { - return this.protocol; - } - - /** - * Set the protocol property: The protocol property. - * - * @param protocol the protocol value to set. - * @return the JitNetworkAccessPortRule object itself. - */ - public JitNetworkAccessPortRule withProtocol(Protocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * Get the allowedSourceAddressPrefix property: Mutually exclusive with the "allowedSourceAddressPrefixes" - * parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". - * - * @return the allowedSourceAddressPrefix value. - */ - public String allowedSourceAddressPrefix() { - return this.allowedSourceAddressPrefix; - } - - /** - * Set the allowedSourceAddressPrefix property: Mutually exclusive with the "allowedSourceAddressPrefixes" - * parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". - * - * @param allowedSourceAddressPrefix the allowedSourceAddressPrefix value to set. - * @return the JitNetworkAccessPortRule object itself. - */ - public JitNetworkAccessPortRule withAllowedSourceAddressPrefix(String allowedSourceAddressPrefix) { - this.allowedSourceAddressPrefix = allowedSourceAddressPrefix; - return this; - } - - /** - * Get the allowedSourceAddressPrefixes property: Mutually exclusive with the "allowedSourceAddressPrefix" - * parameter. - * - * @return the allowedSourceAddressPrefixes value. - */ - public List allowedSourceAddressPrefixes() { - return this.allowedSourceAddressPrefixes; - } - - /** - * Set the allowedSourceAddressPrefixes property: Mutually exclusive with the "allowedSourceAddressPrefix" - * parameter. - * - * @param allowedSourceAddressPrefixes the allowedSourceAddressPrefixes value to set. - * @return the JitNetworkAccessPortRule object itself. - */ - public JitNetworkAccessPortRule withAllowedSourceAddressPrefixes(List allowedSourceAddressPrefixes) { - this.allowedSourceAddressPrefixes = allowedSourceAddressPrefixes; - return this; - } - - /** - * Get the maxRequestAccessDuration property: Maximum duration requests can be made for. In ISO 8601 duration - * format. Minimum 5 minutes, maximum 1 day. - * - * @return the maxRequestAccessDuration value. - */ - public String maxRequestAccessDuration() { - return this.maxRequestAccessDuration; - } - - /** - * Set the maxRequestAccessDuration property: Maximum duration requests can be made for. In ISO 8601 duration - * format. Minimum 5 minutes, maximum 1 day. - * - * @param maxRequestAccessDuration the maxRequestAccessDuration value to set. - * @return the JitNetworkAccessPortRule object itself. - */ - public JitNetworkAccessPortRule withMaxRequestAccessDuration(String maxRequestAccessDuration) { - this.maxRequestAccessDuration = maxRequestAccessDuration; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (protocol() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property protocol in model JitNetworkAccessPortRule")); - } - if (maxRequestAccessDuration() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property maxRequestAccessDuration in model JitNetworkAccessPortRule")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessPortRule.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessRequest.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessRequest.java deleted file mode 100644 index 21ec47f493ac..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessRequest.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of JitNetworkAccessRequest. */ -public interface JitNetworkAccessRequest { - /** - * Gets the virtualMachines property: The virtualMachines property. - * - * @return the virtualMachines value. - */ - List virtualMachines(); - - /** - * Gets the startTimeUtc property: The start time of the request in UTC. - * - * @return the startTimeUtc value. - */ - OffsetDateTime startTimeUtc(); - - /** - * Gets the requestor property: The identity of the person who made the request. - * - * @return the requestor value. - */ - String requestor(); - - /** - * Gets the justification property: The justification for making the initiate request. - * - * @return the justification value. - */ - String justification(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner object. - * - * @return the inner object. - */ - JitNetworkAccessRequestInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessRequestPort.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessRequestPort.java deleted file mode 100644 index c954e191ef6b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessRequestPort.java +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** The JitNetworkAccessRequestPort model. */ -@Fluent -public final class JitNetworkAccessRequestPort { - /* - * The number property. - */ - @JsonProperty(value = "number", required = true) - private int number; - - /* - * Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, for - * example "192.168.0.3" or "192.168.0.0/16". - */ - @JsonProperty(value = "allowedSourceAddressPrefix") - private String allowedSourceAddressPrefix; - - /* - * Mutually exclusive with the "allowedSourceAddressPrefix" parameter. - */ - @JsonProperty(value = "allowedSourceAddressPrefixes") - private List allowedSourceAddressPrefixes; - - /* - * The date & time at which the request ends in UTC - */ - @JsonProperty(value = "endTimeUtc", required = true) - private OffsetDateTime endTimeUtc; - - /* - * The status of the port - */ - @JsonProperty(value = "status", required = true) - private Status status; - - /* - * A description of why the `status` has its value - */ - @JsonProperty(value = "statusReason", required = true) - private StatusReason statusReason; - - /* - * The port which is mapped to this port's `number` in the Azure Firewall, if applicable - */ - @JsonProperty(value = "mappedPort") - private Integer mappedPort; - - /** Creates an instance of JitNetworkAccessRequestPort class. */ - public JitNetworkAccessRequestPort() { - } - - /** - * Get the number property: The number property. - * - * @return the number value. - */ - public int number() { - return this.number; - } - - /** - * Set the number property: The number property. - * - * @param number the number value to set. - * @return the JitNetworkAccessRequestPort object itself. - */ - public JitNetworkAccessRequestPort withNumber(int number) { - this.number = number; - return this; - } - - /** - * Get the allowedSourceAddressPrefix property: Mutually exclusive with the "allowedSourceAddressPrefixes" - * parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". - * - * @return the allowedSourceAddressPrefix value. - */ - public String allowedSourceAddressPrefix() { - return this.allowedSourceAddressPrefix; - } - - /** - * Set the allowedSourceAddressPrefix property: Mutually exclusive with the "allowedSourceAddressPrefixes" - * parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". - * - * @param allowedSourceAddressPrefix the allowedSourceAddressPrefix value to set. - * @return the JitNetworkAccessRequestPort object itself. - */ - public JitNetworkAccessRequestPort withAllowedSourceAddressPrefix(String allowedSourceAddressPrefix) { - this.allowedSourceAddressPrefix = allowedSourceAddressPrefix; - return this; - } - - /** - * Get the allowedSourceAddressPrefixes property: Mutually exclusive with the "allowedSourceAddressPrefix" - * parameter. - * - * @return the allowedSourceAddressPrefixes value. - */ - public List allowedSourceAddressPrefixes() { - return this.allowedSourceAddressPrefixes; - } - - /** - * Set the allowedSourceAddressPrefixes property: Mutually exclusive with the "allowedSourceAddressPrefix" - * parameter. - * - * @param allowedSourceAddressPrefixes the allowedSourceAddressPrefixes value to set. - * @return the JitNetworkAccessRequestPort object itself. - */ - public JitNetworkAccessRequestPort withAllowedSourceAddressPrefixes(List allowedSourceAddressPrefixes) { - this.allowedSourceAddressPrefixes = allowedSourceAddressPrefixes; - return this; - } - - /** - * Get the endTimeUtc property: The date & time at which the request ends in UTC. - * - * @return the endTimeUtc value. - */ - public OffsetDateTime endTimeUtc() { - return this.endTimeUtc; - } - - /** - * Set the endTimeUtc property: The date & time at which the request ends in UTC. - * - * @param endTimeUtc the endTimeUtc value to set. - * @return the JitNetworkAccessRequestPort object itself. - */ - public JitNetworkAccessRequestPort withEndTimeUtc(OffsetDateTime endTimeUtc) { - this.endTimeUtc = endTimeUtc; - return this; - } - - /** - * Get the status property: The status of the port. - * - * @return the status value. - */ - public Status status() { - return this.status; - } - - /** - * Set the status property: The status of the port. - * - * @param status the status value to set. - * @return the JitNetworkAccessRequestPort object itself. - */ - public JitNetworkAccessRequestPort withStatus(Status status) { - this.status = status; - return this; - } - - /** - * Get the statusReason property: A description of why the `status` has its value. - * - * @return the statusReason value. - */ - public StatusReason statusReason() { - return this.statusReason; - } - - /** - * Set the statusReason property: A description of why the `status` has its value. - * - * @param statusReason the statusReason value to set. - * @return the JitNetworkAccessRequestPort object itself. - */ - public JitNetworkAccessRequestPort withStatusReason(StatusReason statusReason) { - this.statusReason = statusReason; - return this; - } - - /** - * Get the mappedPort property: The port which is mapped to this port's `number` in the Azure Firewall, if - * applicable. - * - * @return the mappedPort value. - */ - public Integer mappedPort() { - return this.mappedPort; - } - - /** - * Set the mappedPort property: The port which is mapped to this port's `number` in the Azure Firewall, if - * applicable. - * - * @param mappedPort the mappedPort value to set. - * @return the JitNetworkAccessRequestPort object itself. - */ - public JitNetworkAccessRequestPort withMappedPort(Integer mappedPort) { - this.mappedPort = mappedPort; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (endTimeUtc() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property endTimeUtc in model JitNetworkAccessRequestPort")); - } - if (status() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property status in model JitNetworkAccessRequestPort")); - } - if (statusReason() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property statusReason in model JitNetworkAccessRequestPort")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessRequestPort.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessRequestVirtualMachine.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessRequestVirtualMachine.java deleted file mode 100644 index a71907e96817..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/JitNetworkAccessRequestVirtualMachine.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The JitNetworkAccessRequestVirtualMachine model. */ -@Fluent -public final class JitNetworkAccessRequestVirtualMachine { - /* - * Resource ID of the virtual machine that is linked to this policy - */ - @JsonProperty(value = "id", required = true) - private String id; - - /* - * The ports that were opened for the virtual machine - */ - @JsonProperty(value = "ports", required = true) - private List ports; - - /** Creates an instance of JitNetworkAccessRequestVirtualMachine class. */ - public JitNetworkAccessRequestVirtualMachine() { - } - - /** - * Get the id property: Resource ID of the virtual machine that is linked to this policy. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Resource ID of the virtual machine that is linked to this policy. - * - * @param id the id value to set. - * @return the JitNetworkAccessRequestVirtualMachine object itself. - */ - public JitNetworkAccessRequestVirtualMachine withId(String id) { - this.id = id; - return this; - } - - /** - * Get the ports property: The ports that were opened for the virtual machine. - * - * @return the ports value. - */ - public List ports() { - return this.ports; - } - - /** - * Set the ports property: The ports that were opened for the virtual machine. - * - * @param ports the ports value to set. - * @return the JitNetworkAccessRequestVirtualMachine object itself. - */ - public JitNetworkAccessRequestVirtualMachine withPorts(List ports) { - this.ports = ports; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (id() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property id in model JitNetworkAccessRequestVirtualMachine")); - } - if (ports() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property ports in model JitNetworkAccessRequestVirtualMachine")); - } else { - ports().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(JitNetworkAccessRequestVirtualMachine.class); -} 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 deleted file mode 100644 index 3b6c0c059d31..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Kind.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The kind of alert simulation. */ -public final class Kind extends ExpandableStringEnum { - /** Static value Bundles for Kind. */ - public static final Kind BUNDLES = fromString("Bundles"); - - /** - * Creates a new instance of Kind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Kind() { - } - - /** - * Creates or finds a Kind from its string representation. - * - * @param name a name to look for. - * @return the corresponding Kind. - */ - @JsonCreator - public static Kind fromString(String name) { - return fromString(name, Kind.class); - } - - /** - * Gets known Kind values. - * - * @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/KindAutoGenerated.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindAutoGenerated.java deleted file mode 100644 index 58c82a454014..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/KindAutoGenerated.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes an Azure resource with kind. */ -@Fluent -public class KindAutoGenerated { - /* - * Kind of the resource - */ - @JsonProperty(value = "kind") - private String kind; - - /** Creates an instance of KindAutoGenerated class. */ - public KindAutoGenerated() { - } - - /** - * Get the kind property: Kind of the resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of the resource. - * - * @param kind the kind value to set. - * @return the KindAutoGenerated object itself. - */ - public KindAutoGenerated withKind(String kind) { - this.kind = kind; - 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/ListCustomAlertRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ListCustomAlertRule.java deleted file mode 100644 index 8d1243a560a1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ListCustomAlertRule.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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** A List custom alert rule. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "ruleType", - defaultImpl = ListCustomAlertRule.class) -@JsonTypeName("ListCustomAlertRule") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AllowlistCustomAlertRule", value = AllowlistCustomAlertRule.class), - @JsonSubTypes.Type(name = "DenylistCustomAlertRule", value = DenylistCustomAlertRule.class) -}) -@Fluent -public class ListCustomAlertRule extends CustomAlertRule { - /* - * The value type of the items in the list. - */ - @JsonProperty(value = "valueType", access = JsonProperty.Access.WRITE_ONLY) - private ValueType valueType; - - /** Creates an instance of ListCustomAlertRule class. */ - public ListCustomAlertRule() { - } - - /** - * Get the valueType property: The value type of the items in the list. - * - * @return the valueType value. - */ - public ValueType valueType() { - return this.valueType; - } - - /** {@inheritDoc} */ - @Override - public ListCustomAlertRule withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/LocalUserNotAllowed.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/LocalUserNotAllowed.java deleted file mode 100644 index 519315f88cce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/LocalUserNotAllowed.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Login by a local user that isn't allowed. Allow list consists of login names to allow. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("LocalUserNotAllowed") -@Fluent -public final class LocalUserNotAllowed extends AllowlistCustomAlertRule { - /** Creates an instance of LocalUserNotAllowed class. */ - public LocalUserNotAllowed() { - } - - /** {@inheritDoc} */ - @Override - public LocalUserNotAllowed withAllowlistValues(List allowlistValues) { - super.withAllowlistValues(allowlistValues); - return this; - } - - /** {@inheritDoc} */ - @Override - public LocalUserNotAllowed withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/Location.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Location.java deleted file mode 100644 index 96b08b9dec94..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Location.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.fasterxml.jackson.annotation.JsonProperty; - -/** Describes an Azure resource with location. */ -@Immutable -public class Location { - /* - * Location where the resource is stored - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /** Creates an instance of Location class. */ - public Location() { - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Locations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Locations.java deleted file mode 100644 index c6ab571c1b40..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Locations.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.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Locations. */ -public interface Locations { - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * The location of the responsible ASC of the specific subscription (home region). For each subscription there is - * only one responsible location. The location in the response should be used to read or write other resources in - * ASC according to their ID. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of locations where ASC saves your data as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field along with {@link Response}. - */ - Response getWithResponse(String ascLocation, Context context); - - /** - * Details of a specific location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the ASC location of the subscription is in the "name" field. - */ - AscLocation get(String ascLocation); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/LogAnalyticsIdentifier.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/LogAnalyticsIdentifier.java deleted file mode 100644 index 8fc67f68f793..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/LogAnalyticsIdentifier.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Represents a Log Analytics workspace scope identifier. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("LogAnalytics") -@Immutable -public final class LogAnalyticsIdentifier extends ResourceIdentifier { - /* - * The LogAnalytics workspace id that stores this alert. - */ - @JsonProperty(value = "workspaceId", access = JsonProperty.Access.WRITE_ONLY) - private String workspaceId; - - /* - * The azure subscription id for the LogAnalytics workspace storing this alert. - */ - @JsonProperty(value = "workspaceSubscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private String workspaceSubscriptionId; - - /* - * The azure resource group for the LogAnalytics workspace storing this alert - */ - @JsonProperty(value = "workspaceResourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String workspaceResourceGroup; - - /* - * (optional) The LogAnalytics agent id reporting the event that this alert is based on. - */ - @JsonProperty(value = "agentId", access = JsonProperty.Access.WRITE_ONLY) - private String agentId; - - /** Creates an instance of LogAnalyticsIdentifier class. */ - public LogAnalyticsIdentifier() { - } - - /** - * Get the workspaceId property: The LogAnalytics workspace id that stores this alert. - * - * @return the workspaceId value. - */ - public String workspaceId() { - return this.workspaceId; - } - - /** - * Get the workspaceSubscriptionId property: The azure subscription id for the LogAnalytics workspace storing this - * alert. - * - * @return the workspaceSubscriptionId value. - */ - public String workspaceSubscriptionId() { - return this.workspaceSubscriptionId; - } - - /** - * Get the workspaceResourceGroup property: The azure resource group for the LogAnalytics workspace storing this - * alert. - * - * @return the workspaceResourceGroup value. - */ - public String workspaceResourceGroup() { - return this.workspaceResourceGroup; - } - - /** - * Get the agentId property: (optional) The LogAnalytics agent id reporting the event that this alert is based on. - * - * @return the agentId value. - */ - public String agentId() { - return this.agentId; - } - - /** - * 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/MdeOnboardingData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingData.java deleted file mode 100644 index aaf2ad806a5d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingData.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.resourcemanager.security.fluent.models.MdeOnboardingDataInner; - -/** An immutable client-side representation of MdeOnboardingData. */ -public interface MdeOnboardingData { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the onboardingPackageWindows property: The onboarding package used to onboard Windows machines to MDE, coded - * in base64. This can also be used for onboarding using the dedicated VM Extension. - * - * @return the onboardingPackageWindows value. - */ - byte[] onboardingPackageWindows(); - - /** - * Gets the onboardingPackageLinux property: The onboarding package used to onboard Linux machines to MDE, coded in - * base64. This can also be used for onboarding using the dedicated VM Extension. - * - * @return the onboardingPackageLinux value. - */ - byte[] onboardingPackageLinux(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner object. - * - * @return the inner object. - */ - MdeOnboardingDataInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingDataList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingDataList.java deleted file mode 100644 index 63e838ea6d16..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardingDataList.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.MdeOnboardingDataListInner; -import java.util.List; - -/** An immutable client-side representation of MdeOnboardingDataList. */ -public interface MdeOnboardingDataList { - /** - * Gets the value property: List of the resources of the configuration or data needed to onboard the machine to MDE. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner object. - * - * @return the inner object. - */ - MdeOnboardingDataListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardings.java deleted file mode 100644 index 121961f1fb02..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MdeOnboardings.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of MdeOnboardings. */ -public interface MdeOnboardings { - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources along with {@link Response}. - */ - Response listWithResponse(Context context); - - /** - * The configuration or data needed to onboard the machine to MDE. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all MDE onboarding data resources. - */ - MdeOnboardingDataList list(); - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE along with {@link - * Response}. - */ - Response getWithResponse(Context context); - - /** - * The default configuration or data needed to onboard the machine to MDE. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the resource of the configuration or data needed to onboard the machine to MDE. - */ - MdeOnboardingData get(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MinimalSeverity.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MinimalSeverity.java deleted file mode 100644 index 6121cd0dad32..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MinimalSeverity.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines the minimal alert severity which will be sent as email notifications. */ -public final class MinimalSeverity extends ExpandableStringEnum { - /** Static value High for MinimalSeverity. */ - public static final MinimalSeverity HIGH = fromString("High"); - - /** Static value Medium for MinimalSeverity. */ - public static final MinimalSeverity MEDIUM = fromString("Medium"); - - /** Static value Low for MinimalSeverity. */ - public static final MinimalSeverity LOW = fromString("Low"); - - /** - * Creates a new instance of MinimalSeverity value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public MinimalSeverity() { - } - - /** - * Creates or finds a MinimalSeverity from its string representation. - * - * @param name a name to look for. - * @return the corresponding MinimalSeverity. - */ - @JsonCreator - public static MinimalSeverity fromString(String name) { - return fromString(name, MinimalSeverity.class); - } - - /** - * Gets known MinimalSeverity values. - * - * @return known MinimalSeverity values. - */ - public static Collection values() { - return values(MinimalSeverity.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MqttC2DMessagesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MqttC2DMessagesNotInAllowedRange.java deleted file mode 100644 index ace4c3ab00ef..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MqttC2DMessagesNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of cloud to device messages (MQTT protocol) is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("MqttC2DMessagesNotInAllowedRange") -@Fluent -public final class MqttC2DMessagesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of MqttC2DMessagesNotInAllowedRange class. */ - public MqttC2DMessagesNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public MqttC2DMessagesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public MqttC2DMessagesNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public MqttC2DMessagesNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public MqttC2DMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/MqttC2DRejectedMessagesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MqttC2DRejectedMessagesNotInAllowedRange.java deleted file mode 100644 index c3112f9811a4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MqttC2DRejectedMessagesNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of rejected cloud to device messages (MQTT protocol) is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("MqttC2DRejectedMessagesNotInAllowedRange") -@Fluent -public final class MqttC2DRejectedMessagesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of MqttC2DRejectedMessagesNotInAllowedRange class. */ - public MqttC2DRejectedMessagesNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public MqttC2DRejectedMessagesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public MqttC2DRejectedMessagesNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public MqttC2DRejectedMessagesNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public MqttC2DRejectedMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/MqttD2CMessagesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MqttD2CMessagesNotInAllowedRange.java deleted file mode 100644 index 7d409250629d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/MqttD2CMessagesNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of device to cloud messages (MQTT protocol) is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("MqttD2CMessagesNotInAllowedRange") -@Fluent -public final class MqttD2CMessagesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of MqttD2CMessagesNotInAllowedRange class. */ - public MqttD2CMessagesNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public MqttD2CMessagesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public MqttD2CMessagesNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public MqttD2CMessagesNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public MqttD2CMessagesNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/OfferingType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OfferingType.java deleted file mode 100644 index 5f81cfb875f7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OfferingType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The type of the security offering. */ -public final class OfferingType extends ExpandableStringEnum { - /** Static value CspmMonitorAws for OfferingType. */ - public static final OfferingType CSPM_MONITOR_AWS = fromString("CspmMonitorAws"); - - /** Static value DefenderForContainersAws for OfferingType. */ - public static final OfferingType DEFENDER_FOR_CONTAINERS_AWS = fromString("DefenderForContainersAws"); - - /** Static value DefenderForServersAws for OfferingType. */ - public static final OfferingType DEFENDER_FOR_SERVERS_AWS = fromString("DefenderForServersAws"); - - /** Static value DefenderForDatabasesAws for OfferingType. */ - public static final OfferingType DEFENDER_FOR_DATABASES_AWS = fromString("DefenderForDatabasesAws"); - - /** Static value InformationProtectionAws for OfferingType. */ - public static final OfferingType INFORMATION_PROTECTION_AWS = fromString("InformationProtectionAws"); - - /** Static value CspmMonitorGcp for OfferingType. */ - public static final OfferingType CSPM_MONITOR_GCP = fromString("CspmMonitorGcp"); - - /** Static value CspmMonitorGithub for OfferingType. */ - public static final OfferingType CSPM_MONITOR_GITHUB = fromString("CspmMonitorGithub"); - - /** Static value CspmMonitorAzureDevOps for OfferingType. */ - public static final OfferingType CSPM_MONITOR_AZURE_DEV_OPS = fromString("CspmMonitorAzureDevOps"); - - /** Static value DefenderForServersGcp for OfferingType. */ - public static final OfferingType DEFENDER_FOR_SERVERS_GCP = fromString("DefenderForServersGcp"); - - /** Static value DefenderForContainersGcp for OfferingType. */ - public static final OfferingType DEFENDER_FOR_CONTAINERS_GCP = fromString("DefenderForContainersGcp"); - - /** Static value DefenderForDatabasesGcp for OfferingType. */ - public static final OfferingType DEFENDER_FOR_DATABASES_GCP = fromString("DefenderForDatabasesGcp"); - - /** Static value DefenderCspmAws for OfferingType. */ - public static final OfferingType DEFENDER_CSPM_AWS = fromString("DefenderCspmAws"); - - /** Static value DefenderCspmGcp for OfferingType. */ - public static final OfferingType DEFENDER_CSPM_GCP = fromString("DefenderCspmGcp"); - - /** Static value DefenderForDevOpsGithub for OfferingType. */ - public static final OfferingType DEFENDER_FOR_DEV_OPS_GITHUB = fromString("DefenderForDevOpsGithub"); - - /** Static value DefenderForDevOpsAzureDevOps for OfferingType. */ - public static final OfferingType DEFENDER_FOR_DEV_OPS_AZURE_DEV_OPS = fromString("DefenderForDevOpsAzureDevOps"); - - /** Static value CspmMonitorGitLab for OfferingType. */ - public static final OfferingType CSPM_MONITOR_GIT_LAB = fromString("CspmMonitorGitLab"); - - /** Static value DefenderForDevOpsGitLab for OfferingType. */ - public static final OfferingType DEFENDER_FOR_DEV_OPS_GIT_LAB = fromString("DefenderForDevOpsGitLab"); - - /** - * Creates a new instance of OfferingType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public OfferingType() { - } - - /** - * Creates or finds a OfferingType from its string representation. - * - * @param name a name to look for. - * @return the corresponding OfferingType. - */ - @JsonCreator - public static OfferingType fromString(String name) { - return fromString(name, OfferingType.class); - } - - /** - * Gets known OfferingType values. - * - * @return known OfferingType values. - */ - public static Collection values() { - return values(OfferingType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseResourceDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseResourceDetails.java deleted file mode 100644 index 0fbc76523224..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseResourceDetails.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -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 { - /* - * 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; - - /** Creates an instance of OnPremiseResourceDetails class. */ - public OnPremiseResourceDetails() { - } - - /** - * 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")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OnPremiseResourceDetails.class); -} 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 cdf5dcd7ea51..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OnPremiseSqlResourceDetails.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -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 { - /* - * 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; - - /** Creates an instance of OnPremiseSqlResourceDetails class. */ - public OnPremiseSqlResourceDetails() { - } - - /** - * 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")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(OnPremiseSqlResourceDetails.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operation.java deleted file mode 100644 index 1b42f07bf3e5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operation.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.resourcemanager.security.fluent.models.OperationInner; - -/** An immutable client-side representation of Operation. */ -public interface Operation { - /** - * Gets the name property: Name of the operation. - * - * @return the name value. - */ - String name(); - - /** - * Gets the origin property: Where the operation is originated. - * - * @return the origin value. - */ - String origin(); - - /** - * Gets the display property: Security operation display. - * - * @return the display value. - */ - OperationDisplay display(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.OperationInner object. - * - * @return the inner object. - */ - OperationInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationDisplay.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationDisplay.java deleted file mode 100644 index 9cf93777953b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationDisplay.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Security operation display. */ -@Immutable -public final class OperationDisplay { - /* - * The resource provider for the operation. - */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) - private String provider; - - /* - * The display name of the resource the operation applies to. - */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) - private String resource; - - /* - * The display name of the security operation. - */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) - private String operation; - - /* - * The description of the operation. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /** Creates an instance of OperationDisplay class. */ - public OperationDisplay() { - } - - /** - * Get the provider property: The resource provider for the operation. - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Get the resource property: The display name of the resource the operation applies to. - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the operation property: The display name of the security operation. - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the description property: The description of the operation. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationList.java deleted file mode 100644 index 8d0852a40677..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationList.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of possible operations for Microsoft.Security resource provider. */ -@Fluent -public final class OperationList { - /* - * List of Security operations - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of OperationList class. */ - public OperationList() { - } - - /** - * Get the value property: List of Security operations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of Security operations. - * - * @param value the value value to set. - * @return the OperationList object itself. - */ - public OperationList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResult.java deleted file mode 100644 index 5e73d10eacb5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResult.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The status of the long run operation result of governance rule. */ -public final class OperationResult extends ExpandableStringEnum { - /** Static value Succeeded for OperationResult. */ - public static final OperationResult SUCCEEDED = fromString("Succeeded"); - - /** Static value Failed for OperationResult. */ - public static final OperationResult FAILED = fromString("Failed"); - - /** Static value Canceled for OperationResult. */ - public static final OperationResult CANCELED = fromString("Canceled"); - - /** - * Creates a new instance of OperationResult value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public OperationResult() { - } - - /** - * Creates or finds a OperationResult from its string representation. - * - * @param name a name to look for. - * @return the corresponding OperationResult. - */ - @JsonCreator - public static OperationResult fromString(String name) { - return fromString(name, OperationResult.class); - } - - /** - * Gets known OperationResult values. - * - * @return known OperationResult values. - */ - public static Collection values() { - return values(OperationResult.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResultAutoGenerated.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResultAutoGenerated.java deleted file mode 100644 index 94dce0ac8351..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationResultAutoGenerated.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.models; - -import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; - -/** An immutable client-side representation of OperationResultAutoGenerated. */ -public interface OperationResultAutoGenerated { - /** - * Gets the status property: The status of the long run operation result of governance rule. - * - * @return the status value. - */ - OperationResult status(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner object. - * - * @return the inner object. - */ - OperationResultAutoGeneratedInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatus.java deleted file mode 100644 index 1f1c9e6b0ad7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OperationStatus.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A status describing the success/failure of the extension's enablement/disablement operation. */ -@Fluent -public final class OperationStatus { - /* - * The operation status code. - */ - @JsonProperty(value = "code") - private Code code; - - /* - * Additional information regarding the success/failure of the operation. - */ - @JsonProperty(value = "message") - private String message; - - /** Creates an instance of OperationStatus class. */ - public OperationStatus() { - } - - /** - * Get the code property: The operation status code. - * - * @return the code value. - */ - public Code code() { - return this.code; - } - - /** - * Set the code property: The operation status code. - * - * @param code the code value to set. - * @return the OperationStatus object itself. - */ - public OperationStatus withCode(Code code) { - this.code = code; - return this; - } - - /** - * Get the message property: Additional information regarding the success/failure of the operation. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Set the message property: Additional information regarding the success/failure of the operation. - * - * @param message the message value to set. - * @return the OperationStatus object itself. - */ - public OperationStatus withMessage(String message) { - this.message = message; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operations.java deleted file mode 100644 index 58fe3146b8f3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operations.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of Operations. */ -public interface Operations { - /** - * Exposes all available operations for discovery purposes. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft.Security resource provider as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(); - - /** - * Exposes all available operations for discovery purposes. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of possible operations for Microsoft.Security resource provider as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operator.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operator.java deleted file mode 100644 index 82f67b205ac3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Operator.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType. */ -public final class Operator extends ExpandableStringEnum { - /** Static value Equals for Operator. */ - public static final Operator EQUALS = fromString("Equals"); - - /** Static value GreaterThan for Operator. */ - public static final Operator GREATER_THAN = fromString("GreaterThan"); - - /** Static value GreaterThanOrEqualTo for Operator. */ - public static final Operator GREATER_THAN_OR_EQUAL_TO = fromString("GreaterThanOrEqualTo"); - - /** Static value LesserThan for Operator. */ - public static final Operator LESSER_THAN = fromString("LesserThan"); - - /** Static value LesserThanOrEqualTo for Operator. */ - public static final Operator LESSER_THAN_OR_EQUAL_TO = fromString("LesserThanOrEqualTo"); - - /** Static value NotEquals for Operator. */ - public static final Operator NOT_EQUALS = fromString("NotEquals"); - - /** Static value Contains for Operator. */ - public static final Operator CONTAINS = fromString("Contains"); - - /** Static value StartsWith for Operator. */ - public static final Operator STARTS_WITH = fromString("StartsWith"); - - /** Static value EndsWith for Operator. */ - public static final Operator ENDS_WITH = fromString("EndsWith"); - - /** - * Creates a new instance of Operator value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Operator() { - } - - /** - * Creates or finds a Operator from its string representation. - * - * @param name a name to look for. - * @return the corresponding Operator. - */ - @JsonCreator - public static Operator fromString(String name) { - return fromString(name, Operator.class); - } - - /** - * Gets known Operator values. - * - * @return known Operator values. - */ - public static Collection values() { - return values(Operator.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OrganizationMembershipType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OrganizationMembershipType.java deleted file mode 100644 index a5ca7145f0f3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/OrganizationMembershipType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The multi cloud account's membership type in the organization. */ -public final class OrganizationMembershipType extends ExpandableStringEnum { - /** Static value Member for OrganizationMembershipType. */ - public static final OrganizationMembershipType MEMBER = fromString("Member"); - - /** Static value Organization for OrganizationMembershipType. */ - public static final OrganizationMembershipType ORGANIZATION = fromString("Organization"); - - /** - * Creates a new instance of OrganizationMembershipType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public OrganizationMembershipType() { - } - - /** - * Creates or finds a OrganizationMembershipType from its string representation. - * - * @param name a name to look for. - * @return the corresponding OrganizationMembershipType. - */ - @JsonCreator - public static OrganizationMembershipType fromString(String name) { - return fromString(name, OrganizationMembershipType.class); - } - - /** - * Gets known OrganizationMembershipType values. - * - * @return known OrganizationMembershipType values. - */ - public static Collection values() { - return values(OrganizationMembershipType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PathRecommendation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PathRecommendation.java deleted file mode 100644 index 5850e6bbe254..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PathRecommendation.java +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents a path that is recommended to be allowed and its properties. */ -@Fluent -public final class PathRecommendation { - /* - * The full path of the file, or an identifier of the application - */ - @JsonProperty(value = "path") - private String path; - - /* - * The recommendation action of the machine or rule - */ - @JsonProperty(value = "action") - private RecommendationAction action; - - /* - * The type of IoT Security recommendation. - */ - @JsonProperty(value = "type") - private RecommendationType type; - - /* - * Represents the publisher information of a process/rule - */ - @JsonProperty(value = "publisherInfo") - private PublisherInfo publisherInfo; - - /* - * Whether the application is commonly run on the machine - */ - @JsonProperty(value = "common") - private Boolean common; - - /* - * The userSids property. - */ - @JsonProperty(value = "userSids") - private List userSids; - - /* - * The usernames property. - */ - @JsonProperty(value = "usernames") - private List usernames; - - /* - * The type of the file (for Linux files - Executable is used) - */ - @JsonProperty(value = "fileType") - private FileType fileType; - - /* - * The configuration status of the machines group or machine or rule - */ - @JsonProperty(value = "configurationStatus") - private ConfigurationStatus configurationStatus; - - /** Creates an instance of PathRecommendation class. */ - public PathRecommendation() { - } - - /** - * Get the path property: The full path of the file, or an identifier of the application. - * - * @return the path value. - */ - public String path() { - return this.path; - } - - /** - * Set the path property: The full path of the file, or an identifier of the application. - * - * @param path the path value to set. - * @return the PathRecommendation object itself. - */ - public PathRecommendation withPath(String path) { - this.path = path; - return this; - } - - /** - * Get the action property: The recommendation action of the machine or rule. - * - * @return the action value. - */ - public RecommendationAction action() { - return this.action; - } - - /** - * Set the action property: The recommendation action of the machine or rule. - * - * @param action the action value to set. - * @return the PathRecommendation object itself. - */ - public PathRecommendation withAction(RecommendationAction action) { - this.action = action; - return this; - } - - /** - * Get the type property: The type of IoT Security recommendation. - * - * @return the type value. - */ - public RecommendationType type() { - return this.type; - } - - /** - * Set the type property: The type of IoT Security recommendation. - * - * @param type the type value to set. - * @return the PathRecommendation object itself. - */ - public PathRecommendation withType(RecommendationType type) { - this.type = type; - return this; - } - - /** - * Get the publisherInfo property: Represents the publisher information of a process/rule. - * - * @return the publisherInfo value. - */ - public PublisherInfo publisherInfo() { - return this.publisherInfo; - } - - /** - * Set the publisherInfo property: Represents the publisher information of a process/rule. - * - * @param publisherInfo the publisherInfo value to set. - * @return the PathRecommendation object itself. - */ - public PathRecommendation withPublisherInfo(PublisherInfo publisherInfo) { - this.publisherInfo = publisherInfo; - return this; - } - - /** - * Get the common property: Whether the application is commonly run on the machine. - * - * @return the common value. - */ - public Boolean common() { - return this.common; - } - - /** - * Set the common property: Whether the application is commonly run on the machine. - * - * @param common the common value to set. - * @return the PathRecommendation object itself. - */ - public PathRecommendation withCommon(Boolean common) { - this.common = common; - return this; - } - - /** - * Get the userSids property: The userSids property. - * - * @return the userSids value. - */ - public List userSids() { - return this.userSids; - } - - /** - * Set the userSids property: The userSids property. - * - * @param userSids the userSids value to set. - * @return the PathRecommendation object itself. - */ - public PathRecommendation withUserSids(List userSids) { - this.userSids = userSids; - return this; - } - - /** - * Get the usernames property: The usernames property. - * - * @return the usernames value. - */ - public List usernames() { - return this.usernames; - } - - /** - * Set the usernames property: The usernames property. - * - * @param usernames the usernames value to set. - * @return the PathRecommendation object itself. - */ - public PathRecommendation withUsernames(List usernames) { - this.usernames = usernames; - return this; - } - - /** - * Get the fileType property: The type of the file (for Linux files - Executable is used). - * - * @return the fileType value. - */ - public FileType fileType() { - return this.fileType; - } - - /** - * Set the fileType property: The type of the file (for Linux files - Executable is used). - * - * @param fileType the fileType value to set. - * @return the PathRecommendation object itself. - */ - public PathRecommendation withFileType(FileType fileType) { - this.fileType = fileType; - return this; - } - - /** - * Get the configurationStatus property: The configuration status of the machines group or machine or rule. - * - * @return the configurationStatus value. - */ - public ConfigurationStatus configurationStatus() { - return this.configurationStatus; - } - - /** - * Set the configurationStatus property: The configuration status of the machines group or machine or rule. - * - * @param configurationStatus the configurationStatus value to set. - * @return the PathRecommendation object itself. - */ - public PathRecommendation withConfigurationStatus(ConfigurationStatus configurationStatus) { - this.configurationStatus = configurationStatus; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (publisherInfo() != null) { - publisherInfo().validate(); - } - if (usernames() != null) { - usernames().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PermissionProperty.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PermissionProperty.java deleted file mode 100644 index 0cf19027c1b1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PermissionProperty.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** A permission detected in the cloud account. */ -public final class PermissionProperty extends ExpandableStringEnum { - /** Static value AWS::AWSSecurityHubReadOnlyAccess for PermissionProperty. */ - public static final PermissionProperty AWS_AWSSECURITY_HUB_READ_ONLY_ACCESS = - fromString("AWS::AWSSecurityHubReadOnlyAccess"); - - /** Static value AWS::SecurityAudit for PermissionProperty. */ - public static final PermissionProperty AWS_SECURITY_AUDIT = fromString("AWS::SecurityAudit"); - - /** Static value AWS::AmazonSSMAutomationRole for PermissionProperty. */ - public static final PermissionProperty AWS_AMAZON_SSMAUTOMATION_ROLE = fromString("AWS::AmazonSSMAutomationRole"); - - /** Static value GCP::Security Center Admin Viewer for PermissionProperty. */ - public static final PermissionProperty GCP_SECURITY_CENTER_ADMIN_VIEWER = - fromString("GCP::Security Center Admin Viewer"); - - /** - * Creates a new instance of PermissionProperty value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PermissionProperty() { - } - - /** - * Creates or finds a PermissionProperty from its string representation. - * - * @param name a name to look for. - * @return the corresponding PermissionProperty. - */ - @JsonCreator - public static PermissionProperty fromString(String name) { - return fromString(name, PermissionProperty.class); - } - - /** - * Gets known PermissionProperty values. - * - * @return known PermissionProperty values. - */ - public static Collection values() { - return values(PermissionProperty.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Pricing.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Pricing.java deleted file mode 100644 index a0fa3bb7d5fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Pricing.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.resourcemanager.security.fluent.models.PricingInner; -import java.time.Duration; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of Pricing. */ -public interface Pricing { - /** - * 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 pricingTier property: The pricing tier value. Microsoft Defender for Cloud is provided in two pricing - * tiers: free and standard. The standard tier offers advanced security capabilities, while the free tier offers - * basic security features. - * - * @return the pricingTier value. - */ - PricingTier pricingTier(); - - /** - * Gets the subPlan property: The sub-plan selected for a Standard pricing configuration, when more than one - * sub-plan is available. Each sub-plan enables a set of security features. When not specified, full plan is - * applied. - * - * @return the subPlan value. - */ - String subPlan(); - - /** - * Gets the freeTrialRemainingTime property: The duration left for the subscriptions free trial period - in ISO 8601 - * format (e.g. P3Y6M4DT12H30M5S). - * - * @return the freeTrialRemainingTime value. - */ - Duration freeTrialRemainingTime(); - - /** - * Gets the enablementTime property: Optional. If `pricingTier` is `Standard` then this property holds the date of - * the last time the `pricingTier` was set to `Standard`, when available (e.g 2023-03-01T12:42:42.1921106Z). - * - * @return the enablementTime value. - */ - OffsetDateTime enablementTime(); - - /** - * Gets the deprecated property: Optional. True if the plan is deprecated. If there are replacing plans they will - * appear in `replacedBy` property. - * - * @return the deprecated value. - */ - Boolean deprecated(); - - /** - * Gets the replacedBy property: Optional. List of plans that replace this plan. This property exists only if this - * plan is deprecated. - * - * @return the replacedBy value. - */ - List replacedBy(); - - /** - * Gets the extensions property: Optional. List of extensions offered under a plan. - * - * @return the extensions value. - */ - List extensions(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.PricingInner object. - * - * @return the inner object. - */ - PricingInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PricingList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PricingList.java deleted file mode 100644 index 70264fe70433..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PricingList.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.PricingListInner; -import java.util.List; - -/** An immutable client-side representation of PricingList. */ -public interface PricingList { - /** - * Gets the value property: List of pricing configurations. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.PricingListInner object. - * - * @return the inner object. - */ - PricingListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PricingTier.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PricingTier.java deleted file mode 100644 index 3c6477e503c4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PricingTier.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard. The - * standard tier offers advanced security capabilities, while the free tier offers basic security features. - */ -public final class PricingTier extends ExpandableStringEnum { - /** Static value Free for PricingTier. */ - public static final PricingTier FREE = fromString("Free"); - - /** Static value Standard for PricingTier. */ - public static final PricingTier STANDARD = fromString("Standard"); - - /** - * Creates a new instance of PricingTier value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PricingTier() { - } - - /** - * Creates or finds a PricingTier from its string representation. - * - * @param name a name to look for. - * @return the corresponding PricingTier. - */ - @JsonCreator - public static PricingTier fromString(String name) { - return fromString(name, PricingTier.class); - } - - /** - * Gets known PricingTier values. - * - * @return known PricingTier values. - */ - public static Collection values() { - return values(PricingTier.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Pricings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Pricings.java deleted file mode 100644 index 6942c5681305..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Pricings.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.PricingInner; - -/** Resource collection API of Pricings. */ -public interface Pricings { - /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of pricing configurations response along with {@link Response}. - */ - Response listWithResponse(Context context); - - /** - * Lists Microsoft Defender for Cloud pricing configurations in the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of pricing configurations response. - */ - PricingList list(); - - /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a provided Microsoft Defender for Cloud pricing configuration in the subscription along with {@link - * Response}. - */ - Response getWithResponse(String pricingName, Context context); - - /** - * Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a provided Microsoft Defender for Cloud pricing configuration in the subscription. - */ - Pricing get(String pricingName); - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard along with {@link - * Response}. - */ - Response updateWithResponse(String pricingName, PricingInner pricing, Context context); - - /** - * Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param pricing Pricing object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return microsoft Defender for Cloud is provided in two pricing tiers: free and standard. - */ - Pricing update(String pricingName, PricingInner pricing); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProcessNotAllowed.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProcessNotAllowed.java deleted file mode 100644 index 029d6ffdc398..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProcessNotAllowed.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Execution of a process that isn't allowed. Allow list consists of process names to allow. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("ProcessNotAllowed") -@Fluent -public final class ProcessNotAllowed extends AllowlistCustomAlertRule { - /** Creates an instance of ProcessNotAllowed class. */ - public ProcessNotAllowed() { - } - - /** {@inheritDoc} */ - @Override - public ProcessNotAllowed withAllowlistValues(List allowlistValues) { - super.withAllowlistValues(allowlistValues); - return this; - } - - /** {@inheritDoc} */ - @Override - public ProcessNotAllowed withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/PropertyType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PropertyType.java deleted file mode 100644 index 4ea08d7c1143..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PropertyType.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]. */ -public final class PropertyType extends ExpandableStringEnum { - /** Static value String for PropertyType. */ - public static final PropertyType STRING = fromString("String"); - - /** Static value Integer for PropertyType. */ - public static final PropertyType INTEGER = fromString("Integer"); - - /** Static value Number for PropertyType. */ - public static final PropertyType NUMBER = fromString("Number"); - - /** Static value Boolean for PropertyType. */ - public static final PropertyType BOOLEAN = fromString("Boolean"); - - /** - * Creates a new instance of PropertyType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public PropertyType() { - } - - /** - * Creates or finds a PropertyType from its string representation. - * - * @param name a name to look for. - * @return the corresponding PropertyType. - */ - @JsonCreator - public static PropertyType fromString(String name) { - return fromString(name, PropertyType.class); - } - - /** - * Gets known PropertyType values. - * - * @return known PropertyType values. - */ - public static Collection values() { - return values(PropertyType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProtectionMode.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProtectionMode.java deleted file mode 100644 index 91560dbbc4e5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProtectionMode.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for Linux. - */ -@Fluent -public final class ProtectionMode { - /* - * The application control policy enforcement/protection mode of the machine group - */ - @JsonProperty(value = "exe") - private EnforcementMode exe; - - /* - * The application control policy enforcement/protection mode of the machine group - */ - @JsonProperty(value = "msi") - private EnforcementMode msi; - - /* - * The application control policy enforcement/protection mode of the machine group - */ - @JsonProperty(value = "script") - private EnforcementMode script; - - /* - * The application control policy enforcement/protection mode of the machine group - */ - @JsonProperty(value = "executable") - private EnforcementMode executable; - - /** Creates an instance of ProtectionMode class. */ - public ProtectionMode() { - } - - /** - * Get the exe property: The application control policy enforcement/protection mode of the machine group. - * - * @return the exe value. - */ - public EnforcementMode exe() { - return this.exe; - } - - /** - * Set the exe property: The application control policy enforcement/protection mode of the machine group. - * - * @param exe the exe value to set. - * @return the ProtectionMode object itself. - */ - public ProtectionMode withExe(EnforcementMode exe) { - this.exe = exe; - return this; - } - - /** - * Get the msi property: The application control policy enforcement/protection mode of the machine group. - * - * @return the msi value. - */ - public EnforcementMode msi() { - return this.msi; - } - - /** - * Set the msi property: The application control policy enforcement/protection mode of the machine group. - * - * @param msi the msi value to set. - * @return the ProtectionMode object itself. - */ - public ProtectionMode withMsi(EnforcementMode msi) { - this.msi = msi; - return this; - } - - /** - * Get the script property: The application control policy enforcement/protection mode of the machine group. - * - * @return the script value. - */ - public EnforcementMode script() { - return this.script; - } - - /** - * Set the script property: The application control policy enforcement/protection mode of the machine group. - * - * @param script the script value to set. - * @return the ProtectionMode object itself. - */ - public ProtectionMode withScript(EnforcementMode script) { - this.script = script; - return this; - } - - /** - * Get the executable property: The application control policy enforcement/protection mode of the machine group. - * - * @return the executable value. - */ - public EnforcementMode executable() { - return this.executable; - } - - /** - * Set the executable property: The application control policy enforcement/protection mode of the machine group. - * - * @param executable the executable value to set. - * @return the ProtectionMode object itself. - */ - public ProtectionMode withExecutable(EnforcementMode executable) { - this.executable = executable; - 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/Protocol.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java deleted file mode 100644 index 820e6bed5a7e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Protocol.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Protocol. */ -public final class Protocol extends ExpandableStringEnum { - /** Static value TCP for Protocol. */ - public static final Protocol TCP = fromString("TCP"); - - /** Static value UDP for Protocol. */ - public static final Protocol UDP = fromString("UDP"); - - /** Static value * for Protocol. */ - public static final Protocol ASTERISK = fromString("*"); - - /** - * Creates a new instance of Protocol value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Protocol() { - } - - /** - * Creates or finds a Protocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding Protocol. - */ - @JsonCreator - public static Protocol fromString(String name) { - return fromString(name, Protocol.class); - } - - /** - * Gets known Protocol values. - * - * @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/ProvisioningState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProvisioningState.java deleted file mode 100644 index eb1a1e0b54a8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProvisioningState.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The security family provisioning State. */ -public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for ProvisioningState. */ - public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Failed for ProvisioningState. */ - public static final ProvisioningState FAILED = fromString("Failed"); - - /** Static value Updating for ProvisioningState. */ - public static final ProvisioningState UPDATING = fromString("Updating"); - - /** - * Creates a new instance of ProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ProvisioningState() { - } - - /** - * Creates or finds a ProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ProvisioningState. - */ - @JsonCreator - public static ProvisioningState fromString(String name) { - return fromString(name, ProvisioningState.class); - } - - /** - * Gets known ProvisioningState values. - * - * @return known ProvisioningState values. - */ - public static Collection values() { - return values(ProvisioningState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProxyServerProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProxyServerProperties.java deleted file mode 100644 index 6da28fbe7187..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ProxyServerProperties.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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure - * machine can use. - */ -@Fluent -public final class ProxyServerProperties { - /* - * Proxy server IP - */ - @JsonProperty(value = "ip") - private String ip; - - /* - * Proxy server port - */ - @JsonProperty(value = "port") - private String port; - - /** Creates an instance of ProxyServerProperties class. */ - public ProxyServerProperties() { - } - - /** - * Get the ip property: Proxy server IP. - * - * @return the ip value. - */ - public String ip() { - return this.ip; - } - - /** - * Set the ip property: Proxy server IP. - * - * @param ip the ip value to set. - * @return the ProxyServerProperties object itself. - */ - public ProxyServerProperties withIp(String ip) { - this.ip = ip; - return this; - } - - /** - * Get the port property: Proxy server port. - * - * @return the port value. - */ - public String port() { - return this.port; - } - - /** - * Set the port property: Proxy server port. - * - * @param port the port value to set. - * @return the ProxyServerProperties object itself. - */ - public ProxyServerProperties withPort(String port) { - this.port = port; - 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/PublisherInfo.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PublisherInfo.java deleted file mode 100644 index c1f2751a1b37..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/PublisherInfo.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents the publisher information of a process/rule. */ -@Fluent -public final class PublisherInfo { - /* - * The Subject field of the x.509 certificate used to sign the code, using the following fields - O = - * Organization, L = Locality, S = State or Province, and C = Country - */ - @JsonProperty(value = "publisherName") - private String publisherName; - - /* - * The product name taken from the file's version resource - */ - @JsonProperty(value = "productName") - private String productName; - - /* - * The "OriginalName" field taken from the file's version resource - */ - @JsonProperty(value = "binaryName") - private String binaryName; - - /* - * The binary file version taken from the file's version resource - */ - @JsonProperty(value = "version") - private String version; - - /** Creates an instance of PublisherInfo class. */ - public PublisherInfo() { - } - - /** - * Get the publisherName property: The Subject field of the x.509 certificate used to sign the code, using the - * following fields - O = Organization, L = Locality, S = State or Province, and C = Country. - * - * @return the publisherName value. - */ - public String publisherName() { - return this.publisherName; - } - - /** - * Set the publisherName property: The Subject field of the x.509 certificate used to sign the code, using the - * following fields - O = Organization, L = Locality, S = State or Province, and C = Country. - * - * @param publisherName the publisherName value to set. - * @return the PublisherInfo object itself. - */ - public PublisherInfo withPublisherName(String publisherName) { - this.publisherName = publisherName; - return this; - } - - /** - * Get the productName property: The product name taken from the file's version resource. - * - * @return the productName value. - */ - public String productName() { - return this.productName; - } - - /** - * Set the productName property: The product name taken from the file's version resource. - * - * @param productName the productName value to set. - * @return the PublisherInfo object itself. - */ - public PublisherInfo withProductName(String productName) { - this.productName = productName; - return this; - } - - /** - * Get the binaryName property: The "OriginalName" field taken from the file's version resource. - * - * @return the binaryName value. - */ - public String binaryName() { - return this.binaryName; - } - - /** - * Set the binaryName property: The "OriginalName" field taken from the file's version resource. - * - * @param binaryName the binaryName value to set. - * @return the PublisherInfo object itself. - */ - public PublisherInfo withBinaryName(String binaryName) { - this.binaryName = binaryName; - return this; - } - - /** - * Get the version property: The binary file version taken from the file's version resource. - * - * @return the version value. - */ - public String version() { - return this.version; - } - - /** - * Set the version property: The binary file version taken from the file's version resource. - * - * @param version the version value to set. - * @return the PublisherInfo object itself. - */ - public PublisherInfo withVersion(String version) { - this.version = version; - 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/QueryCheck.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/QueryCheck.java deleted file mode 100644 index 900c61203f88..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/QueryCheck.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The rule query details. */ -@Fluent -public final class QueryCheck { - /* - * The rule query. - */ - @JsonProperty(value = "query") - private String query; - - /* - * Expected result. - */ - @JsonProperty(value = "expectedResult") - private List> expectedResult; - - /* - * Column names of expected result. - */ - @JsonProperty(value = "columnNames") - private List columnNames; - - /** Creates an instance of QueryCheck class. */ - public QueryCheck() { - } - - /** - * Get the query property: The rule query. - * - * @return the query value. - */ - public String query() { - return this.query; - } - - /** - * Set the query property: The rule query. - * - * @param query the query value to set. - * @return the QueryCheck object itself. - */ - public QueryCheck withQuery(String query) { - this.query = query; - return this; - } - - /** - * Get the expectedResult property: Expected result. - * - * @return the expectedResult value. - */ - public List> expectedResult() { - return this.expectedResult; - } - - /** - * Set the expectedResult property: Expected result. - * - * @param expectedResult the expectedResult value to set. - * @return the QueryCheck object itself. - */ - public QueryCheck withExpectedResult(List> expectedResult) { - this.expectedResult = expectedResult; - return this; - } - - /** - * Get the columnNames property: Column names of expected result. - * - * @return the columnNames value. - */ - public List columnNames() { - return this.columnNames; - } - - /** - * Set the columnNames property: Column names of expected result. - * - * @param columnNames the columnNames value to set. - * @return the QueryCheck object itself. - */ - public QueryCheck withColumnNames(List columnNames) { - this.columnNames = columnNames; - 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/QueuePurgesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/QueuePurgesNotInAllowedRange.java deleted file mode 100644 index 15212b008c8c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/QueuePurgesNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of device queue purges is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("QueuePurgesNotInAllowedRange") -@Fluent -public final class QueuePurgesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of QueuePurgesNotInAllowedRange class. */ - public QueuePurgesNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public QueuePurgesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public QueuePurgesNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public QueuePurgesNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public QueuePurgesNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/Rank.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Rank.java deleted file mode 100644 index ae22a1b2f736..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Rank.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** The rank of the sensitivity label. */ -public enum Rank { - /** Enum value None. */ - NONE("None"), - - /** Enum value Low. */ - LOW("Low"), - - /** Enum value Medium. */ - MEDIUM("Medium"), - - /** Enum value High. */ - HIGH("High"), - - /** Enum value Critical. */ - CRITICAL("Critical"); - - /** The actual serialized value for a Rank instance. */ - private final String value; - - Rank(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a Rank instance. - * - * @param value the serialized value to parse. - * @return the parsed Rank object, or null if unable to parse. - */ - @JsonCreator - public static Rank fromString(String value) { - if (value == null) { - return null; - } - Rank[] items = Rank.values(); - for (Rank item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** {@inheritDoc} */ - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationAction.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationAction.java deleted file mode 100644 index ffc308d132ca..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationAction.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The recommendation action of the machine or rule. */ -public final class RecommendationAction extends ExpandableStringEnum { - /** Static value Recommended for RecommendationAction. */ - public static final RecommendationAction RECOMMENDED = fromString("Recommended"); - - /** Static value Add for RecommendationAction. */ - public static final RecommendationAction ADD = fromString("Add"); - - /** Static value Remove for RecommendationAction. */ - public static final RecommendationAction REMOVE = fromString("Remove"); - - /** - * Creates a new instance of RecommendationAction value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecommendationAction() { - } - - /** - * Creates or finds a RecommendationAction from its string representation. - * - * @param name a name to look for. - * @return the corresponding RecommendationAction. - */ - @JsonCreator - public static RecommendationAction fromString(String name) { - return fromString(name, RecommendationAction.class); - } - - /** - * Gets known RecommendationAction values. - * - * @return known RecommendationAction values. - */ - public static Collection values() { - return values(RecommendationAction.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationConfigStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationConfigStatus.java deleted file mode 100644 index 9ca230729c2c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationConfigStatus.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Recommendation status. When the recommendation status is disabled recommendations are not generated. */ -public final class RecommendationConfigStatus extends ExpandableStringEnum { - /** Static value Disabled for RecommendationConfigStatus. */ - public static final RecommendationConfigStatus DISABLED = fromString("Disabled"); - - /** Static value Enabled for RecommendationConfigStatus. */ - public static final RecommendationConfigStatus ENABLED = fromString("Enabled"); - - /** - * Creates a new instance of RecommendationConfigStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecommendationConfigStatus() { - } - - /** - * Creates or finds a RecommendationConfigStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding RecommendationConfigStatus. - */ - @JsonCreator - public static RecommendationConfigStatus fromString(String name) { - return fromString(name, RecommendationConfigStatus.class); - } - - /** - * Gets known RecommendationConfigStatus values. - * - * @return known RecommendationConfigStatus values. - */ - public static Collection values() { - return values(RecommendationConfigStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationConfigurationProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationConfigurationProperties.java deleted file mode 100644 index a341b65e2f06..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationConfigurationProperties.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The type of IoT Security recommendation. */ -@Fluent -public final class RecommendationConfigurationProperties { - /* - * The type of IoT Security recommendation. - */ - @JsonProperty(value = "recommendationType", required = true) - private RecommendationType recommendationType; - - /* - * The name property. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Recommendation status. When the recommendation status is disabled recommendations are not generated. - */ - @JsonProperty(value = "status", required = true) - private RecommendationConfigStatus status; - - /** Creates an instance of RecommendationConfigurationProperties class. */ - public RecommendationConfigurationProperties() { - } - - /** - * Get the recommendationType property: The type of IoT Security recommendation. - * - * @return the recommendationType value. - */ - public RecommendationType recommendationType() { - return this.recommendationType; - } - - /** - * Set the recommendationType property: The type of IoT Security recommendation. - * - * @param recommendationType the recommendationType value to set. - * @return the RecommendationConfigurationProperties object itself. - */ - public RecommendationConfigurationProperties withRecommendationType(RecommendationType recommendationType) { - this.recommendationType = recommendationType; - return this; - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the status property: Recommendation status. When the recommendation status is disabled recommendations are - * not generated. - * - * @return the status value. - */ - public RecommendationConfigStatus status() { - return this.status; - } - - /** - * Set the status property: Recommendation status. When the recommendation status is disabled recommendations are - * not generated. - * - * @param status the status value to set. - * @return the RecommendationConfigurationProperties object itself. - */ - public RecommendationConfigurationProperties withStatus(RecommendationConfigStatus status) { - this.status = status; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (recommendationType() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property recommendationType in model RecommendationConfigurationProperties")); - } - if (status() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property status in model RecommendationConfigurationProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RecommendationConfigurationProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationStatus.java deleted file mode 100644 index 55930b01562d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationStatus.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The initial recommendation status of the machine group or machine. */ -public final class RecommendationStatus extends ExpandableStringEnum { - /** Static value Recommended for RecommendationStatus. */ - public static final RecommendationStatus RECOMMENDED = fromString("Recommended"); - - /** Static value NotRecommended for RecommendationStatus. */ - public static final RecommendationStatus NOT_RECOMMENDED = fromString("NotRecommended"); - - /** Static value NotAvailable for RecommendationStatus. */ - public static final RecommendationStatus NOT_AVAILABLE = fromString("NotAvailable"); - - /** Static value NoStatus for RecommendationStatus. */ - public static final RecommendationStatus NO_STATUS = fromString("NoStatus"); - - /** - * Creates a new instance of RecommendationStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecommendationStatus() { - } - - /** - * Creates or finds a RecommendationStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding RecommendationStatus. - */ - @JsonCreator - public static RecommendationStatus fromString(String name) { - return fromString(name, RecommendationStatus.class); - } - - /** - * Gets known RecommendationStatus values. - * - * @return known RecommendationStatus values. - */ - public static Collection values() { - return values(RecommendationStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationType.java deleted file mode 100644 index 5cb372c3d456..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RecommendationType.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The type of IoT Security recommendation. */ -public final class RecommendationType extends ExpandableStringEnum { - /** Static value IoT_ACRAuthentication for RecommendationType. */ - public static final RecommendationType IO_T_ACRAUTHENTICATION = fromString("IoT_ACRAuthentication"); - - /** Static value IoT_AgentSendsUnutilizedMessages for RecommendationType. */ - public static final RecommendationType IO_T_AGENT_SENDS_UNUTILIZED_MESSAGES = - fromString("IoT_AgentSendsUnutilizedMessages"); - - /** Static value IoT_Baseline for RecommendationType. */ - public static final RecommendationType IO_T_BASELINE = fromString("IoT_Baseline"); - - /** Static value IoT_EdgeHubMemOptimize for RecommendationType. */ - public static final RecommendationType IO_T_EDGE_HUB_MEM_OPTIMIZE = fromString("IoT_EdgeHubMemOptimize"); - - /** Static value IoT_EdgeLoggingOptions for RecommendationType. */ - public static final RecommendationType IO_T_EDGE_LOGGING_OPTIONS = fromString("IoT_EdgeLoggingOptions"); - - /** Static value IoT_InconsistentModuleSettings for RecommendationType. */ - public static final RecommendationType IO_T_INCONSISTENT_MODULE_SETTINGS = - fromString("IoT_InconsistentModuleSettings"); - - /** Static value IoT_InstallAgent for RecommendationType. */ - public static final RecommendationType IO_T_INSTALL_AGENT = fromString("IoT_InstallAgent"); - - /** Static value IoT_IPFilter_DenyAll for RecommendationType. */ - public static final RecommendationType IO_T_IPFILTER_DENY_ALL = fromString("IoT_IPFilter_DenyAll"); - - /** Static value IoT_IPFilter_PermissiveRule for RecommendationType. */ - public static final RecommendationType IO_T_IPFILTER_PERMISSIVE_RULE = fromString("IoT_IPFilter_PermissiveRule"); - - /** Static value IoT_OpenPorts for RecommendationType. */ - public static final RecommendationType IO_T_OPEN_PORTS = fromString("IoT_OpenPorts"); - - /** Static value IoT_PermissiveFirewallPolicy for RecommendationType. */ - public static final RecommendationType IO_T_PERMISSIVE_FIREWALL_POLICY = fromString("IoT_PermissiveFirewallPolicy"); - - /** Static value IoT_PermissiveInputFirewallRules for RecommendationType. */ - public static final RecommendationType IO_T_PERMISSIVE_INPUT_FIREWALL_RULES = - fromString("IoT_PermissiveInputFirewallRules"); - - /** Static value IoT_PermissiveOutputFirewallRules for RecommendationType. */ - public static final RecommendationType IO_T_PERMISSIVE_OUTPUT_FIREWALL_RULES = - fromString("IoT_PermissiveOutputFirewallRules"); - - /** Static value IoT_PrivilegedDockerOptions for RecommendationType. */ - public static final RecommendationType IO_T_PRIVILEGED_DOCKER_OPTIONS = fromString("IoT_PrivilegedDockerOptions"); - - /** Static value IoT_SharedCredentials for RecommendationType. */ - public static final RecommendationType IO_T_SHARED_CREDENTIALS = fromString("IoT_SharedCredentials"); - - /** Static value IoT_VulnerableTLSCipherSuite for RecommendationType. */ - public static final RecommendationType IO_T_VULNERABLE_TLSCIPHER_SUITE = fromString("IoT_VulnerableTLSCipherSuite"); - - /** - * Creates a new instance of RecommendationType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RecommendationType() { - } - - /** - * Creates or finds a RecommendationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RecommendationType. - */ - @JsonCreator - public static RecommendationType fromString(String name) { - return fromString(name, RecommendationType.class); - } - - /** - * Gets known RecommendationType values. - * - * @return known RecommendationType values. - */ - public static Collection values() { - return values(RecommendationType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceAssessment.java deleted file mode 100644 index 9ae45994128f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceAssessment.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; - -/** An immutable client-side representation of RegulatoryComplianceAssessment. */ -public interface RegulatoryComplianceAssessment { - /** - * 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 description property: The description of the regulatory compliance assessment. - * - * @return the description value. - */ - String description(); - - /** - * Gets the assessmentType property: The expected type of assessment contained in the AssessmentDetailsLink. - * - * @return the assessmentType value. - */ - String assessmentType(); - - /** - * Gets the assessmentDetailsLink property: Link to more detailed assessment results data. The response type will be - * according to the assessmentType field. - * - * @return the assessmentDetailsLink value. - */ - String assessmentDetailsLink(); - - /** - * Gets the state property: Aggregative state based on the assessment's scanned resources states. - * - * @return the state value. - */ - State state(); - - /** - * Gets the passedResources property: The given assessment's related resources count with passed state. - * - * @return the passedResources value. - */ - Integer passedResources(); - - /** - * Gets the failedResources property: The given assessment's related resources count with failed state. - * - * @return the failedResources value. - */ - Integer failedResources(); - - /** - * Gets the skippedResources property: The given assessment's related resources count with skipped state. - * - * @return the skippedResources value. - */ - Integer skippedResources(); - - /** - * Gets the unsupportedResources property: The given assessment's related resources count with unsupported state. - * - * @return the unsupportedResources value. - */ - Integer unsupportedResources(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner object. - * - * @return the inner object. - */ - RegulatoryComplianceAssessmentInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceAssessmentList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceAssessmentList.java deleted file mode 100644 index 78680ee26fd5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceAssessmentList.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of regulatory compliance assessment response. */ -@Fluent -public final class RegulatoryComplianceAssessmentList { - /* - * The value property. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of RegulatoryComplianceAssessmentList class. */ - public RegulatoryComplianceAssessmentList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the RegulatoryComplianceAssessmentList object itself. - */ - public RegulatoryComplianceAssessmentList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model RegulatoryComplianceAssessmentList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceAssessmentList.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceAssessments.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceAssessments.java deleted file mode 100644 index 9160e3c7dd57..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceAssessments.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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 RegulatoryComplianceAssessments. */ -public interface RegulatoryComplianceAssessments { - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. - */ - PagedIterable list( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName); - - /** - * Details and state of assessments mapped to selected regulatory compliance control. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance assessment response as paginated response with {@link PagedIterable}. - */ - PagedIterable list( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String filter, - Context context); - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state along with {@link Response}. - */ - Response getWithResponse( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName, - Context context); - - /** - * Supported regulatory compliance details and state for selected assessment. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param regulatoryComplianceAssessmentName Name of the regulatory compliance assessment object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance assessment details and state. - */ - RegulatoryComplianceAssessment get( - String regulatoryComplianceStandardName, - String regulatoryComplianceControlName, - String regulatoryComplianceAssessmentName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceControl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceControl.java deleted file mode 100644 index caaee9f72e04..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceControl.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.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; - -/** An immutable client-side representation of RegulatoryComplianceControl. */ -public interface RegulatoryComplianceControl { - /** - * 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 description property: The description of the regulatory compliance control. - * - * @return the description value. - */ - String description(); - - /** - * Gets the state property: Aggregative state based on the control's supported assessments states. - * - * @return the state value. - */ - State state(); - - /** - * Gets the passedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a passed state. - * - * @return the passedAssessments value. - */ - Integer passedAssessments(); - - /** - * Gets the failedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a failed state. - * - * @return the failedAssessments value. - */ - Integer failedAssessments(); - - /** - * Gets the skippedAssessments property: The number of supported regulatory compliance assessments of the given - * control with a skipped state. - * - * @return the skippedAssessments value. - */ - Integer skippedAssessments(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner object. - * - * @return the inner object. - */ - RegulatoryComplianceControlInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceControlList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceControlList.java deleted file mode 100644 index 6b2e5c9d399f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceControlList.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of regulatory compliance controls response. */ -@Fluent -public final class RegulatoryComplianceControlList { - /* - * List of regulatory compliance controls - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of RegulatoryComplianceControlList class. */ - public RegulatoryComplianceControlList() { - } - - /** - * Get the value property: List of regulatory compliance controls. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of regulatory compliance controls. - * - * @param value the value value to set. - * @return the RegulatoryComplianceControlList object itself. - */ - public RegulatoryComplianceControlList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model RegulatoryComplianceControlList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceControlList.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceControls.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceControls.java deleted file mode 100644 index 385f2bd80b6a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceControls.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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 RegulatoryComplianceControls. */ -public interface RegulatoryComplianceControls { - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String regulatoryComplianceStandardName); - - /** - * All supported regulatory compliance controls details and state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance controls response as paginated response with {@link PagedIterable}. - */ - PagedIterable list( - String regulatoryComplianceStandardName, String filter, Context context); - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state along with {@link Response}. - */ - Response getWithResponse( - String regulatoryComplianceStandardName, String regulatoryComplianceControlName, Context context); - - /** - * Selected regulatory compliance control details and state. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param regulatoryComplianceControlName Name of the regulatory compliance control object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance control details and state. - */ - RegulatoryComplianceControl get(String regulatoryComplianceStandardName, String regulatoryComplianceControlName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceStandard.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceStandard.java deleted file mode 100644 index fce9414f4172..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceStandard.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; - -/** An immutable client-side representation of RegulatoryComplianceStandard. */ -public interface RegulatoryComplianceStandard { - /** - * 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 state property: Aggregative state based on the standard's supported controls states. - * - * @return the state value. - */ - State state(); - - /** - * Gets the passedControls property: The number of supported regulatory compliance controls of the given standard - * with a passed state. - * - * @return the passedControls value. - */ - Integer passedControls(); - - /** - * Gets the failedControls property: The number of supported regulatory compliance controls of the given standard - * with a failed state. - * - * @return the failedControls value. - */ - Integer failedControls(); - - /** - * Gets the skippedControls property: The number of supported regulatory compliance controls of the given standard - * with a skipped state. - * - * @return the skippedControls value. - */ - Integer skippedControls(); - - /** - * Gets the unsupportedControls property: The number of regulatory compliance controls of the given standard which - * are unsupported by automated assessments. - * - * @return the unsupportedControls value. - */ - Integer unsupportedControls(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner object. - * - * @return the inner object. - */ - RegulatoryComplianceStandardInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceStandardList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceStandardList.java deleted file mode 100644 index 7f8bdd1c520d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceStandardList.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of regulatory compliance standards response. */ -@Fluent -public final class RegulatoryComplianceStandardList { - /* - * The value property. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of RegulatoryComplianceStandardList class. */ - public RegulatoryComplianceStandardList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the RegulatoryComplianceStandardList object itself. - */ - public RegulatoryComplianceStandardList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property value in model RegulatoryComplianceStandardList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RegulatoryComplianceStandardList.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceStandards.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceStandards.java deleted file mode 100644 index ff0bde1f6449..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RegulatoryComplianceStandards.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of RegulatoryComplianceStandards. */ -public interface RegulatoryComplianceStandards { - /** - * Supported regulatory compliance standards details and state. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Supported regulatory compliance standards details and state. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of regulatory compliance standards response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String filter, Context context); - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state along with {@link Response}. - */ - Response getWithResponse(String regulatoryComplianceStandardName, Context context); - - /** - * Supported regulatory compliance details state for selected standard. - * - * @param regulatoryComplianceStandardName Name of the regulatory compliance standard object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return regulatory compliance standard details and state. - */ - RegulatoryComplianceStandard get(String regulatoryComplianceStandardName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Remediation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Remediation.java deleted file mode 100644 index 291027cfae4a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Remediation.java +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Remediation details. */ -@Fluent -public final class Remediation { - /* - * Remediation description. - */ - @JsonProperty(value = "description") - private String description; - - /* - * Remediation script. - */ - @JsonProperty(value = "scripts") - private List scripts; - - /* - * Is remediation automated. - */ - @JsonProperty(value = "automated") - private Boolean automated; - - /* - * Optional link to remediate in Azure Portal. - */ - @JsonProperty(value = "portalLink") - private String portalLink; - - /** Creates an instance of Remediation class. */ - public Remediation() { - } - - /** - * Get the description property: Remediation description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: Remediation description. - * - * @param description the description value to set. - * @return the Remediation object itself. - */ - public Remediation withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the scripts property: Remediation script. - * - * @return the scripts value. - */ - public List scripts() { - return this.scripts; - } - - /** - * Set the scripts property: Remediation script. - * - * @param scripts the scripts value to set. - * @return the Remediation object itself. - */ - public Remediation withScripts(List scripts) { - this.scripts = scripts; - return this; - } - - /** - * Get the automated property: Is remediation automated. - * - * @return the automated value. - */ - public Boolean automated() { - return this.automated; - } - - /** - * Set the automated property: Is remediation automated. - * - * @param automated the automated value to set. - * @return the Remediation object itself. - */ - public Remediation withAutomated(Boolean automated) { - this.automated = automated; - return this; - } - - /** - * Get the portalLink property: Optional link to remediate in Azure Portal. - * - * @return the portalLink value. - */ - public String portalLink() { - return this.portalLink; - } - - /** - * Set the portalLink property: Optional link to remediate in Azure Portal. - * - * @param portalLink the portalLink value to set. - * @return the Remediation object itself. - */ - public Remediation withPortalLink(String portalLink) { - this.portalLink = portalLink; - 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/RemediationEta.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RemediationEta.java deleted file mode 100644 index 5027a272f4d2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RemediationEta.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The ETA (estimated time of arrival) for remediation. */ -@Fluent -public final class RemediationEta { - /* - * ETA for remediation. - */ - @JsonProperty(value = "eta", required = true) - private OffsetDateTime eta; - - /* - * Justification for change of Eta. - */ - @JsonProperty(value = "justification", required = true) - private String justification; - - /** Creates an instance of RemediationEta class. */ - public RemediationEta() { - } - - /** - * Get the eta property: ETA for remediation. - * - * @return the eta value. - */ - public OffsetDateTime eta() { - return this.eta; - } - - /** - * Set the eta property: ETA for remediation. - * - * @param eta the eta value to set. - * @return the RemediationEta object itself. - */ - public RemediationEta withEta(OffsetDateTime eta) { - this.eta = eta; - return this; - } - - /** - * Get the justification property: Justification for change of Eta. - * - * @return the justification value. - */ - public String justification() { - return this.justification; - } - - /** - * Set the justification property: Justification for change of Eta. - * - * @param justification the justification value to set. - * @return the RemediationEta object itself. - */ - public RemediationEta withJustification(String justification) { - this.justification = justification; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (eta() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property eta in model RemediationEta")); - } - if (justification() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property justification in model RemediationEta")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(RemediationEta.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ReportedSeverity.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ReportedSeverity.java deleted file mode 100644 index 5a57ea3551e6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ReportedSeverity.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Assessed alert severity. */ -public final class ReportedSeverity extends ExpandableStringEnum { - /** Static value Informational for ReportedSeverity. */ - public static final ReportedSeverity INFORMATIONAL = fromString("Informational"); - - /** Static value Low for ReportedSeverity. */ - public static final ReportedSeverity LOW = fromString("Low"); - - /** Static value Medium for ReportedSeverity. */ - public static final ReportedSeverity MEDIUM = fromString("Medium"); - - /** Static value High for ReportedSeverity. */ - public static final ReportedSeverity HIGH = fromString("High"); - - /** - * Creates a new instance of ReportedSeverity value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ReportedSeverity() { - } - - /** - * Creates or finds a ReportedSeverity from its string representation. - * - * @param name a name to look for. - * @return the corresponding ReportedSeverity. - */ - @JsonCreator - public static ReportedSeverity fromString(String name) { - return fromString(name, ReportedSeverity.class); - } - - /** - * Gets known ReportedSeverity values. - * - * @return known ReportedSeverity values. - */ - public static Collection values() { - return values(ReportedSeverity.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 deleted file mode 100644 index ea029e1eee55..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceDetails.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.annotation.Immutable; -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) -@JsonTypeName("ResourceDetails") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "Azure", value = AzureResourceDetails.class), - @JsonSubTypes.Type(name = "OnPremise", value = OnPremiseResourceDetails.class) -}) -@Immutable -public class ResourceDetails { - /** Creates an instance of ResourceDetails class. */ - public ResourceDetails() { - } - - /** - * 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/ResourceDetailsAutoGenerated.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceDetailsAutoGenerated.java deleted file mode 100644 index 9222ec983d1b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceDetailsAutoGenerated.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The resource details of the health report. */ -@Fluent -public final class ResourceDetailsAutoGenerated { - /* - * The status of the health report - */ - @JsonProperty(value = "source") - private Source source; - - /* - * The azure id of the resource - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * The id of the connector - */ - @JsonProperty(value = "connectorId", access = JsonProperty.Access.WRITE_ONLY) - private String connectorId; - - /** Creates an instance of ResourceDetailsAutoGenerated class. */ - public ResourceDetailsAutoGenerated() { - } - - /** - * Get the source property: The status of the health report. - * - * @return the source value. - */ - public Source source() { - return this.source; - } - - /** - * Set the source property: The status of the health report. - * - * @param source the source value to set. - * @return the ResourceDetailsAutoGenerated object itself. - */ - public ResourceDetailsAutoGenerated withSource(Source source) { - this.source = source; - return this; - } - - /** - * Get the id property: The azure id of the resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the connectorId property: The id of the connector. - * - * @return the connectorId value. - */ - public String connectorId() { - return this.connectorId; - } - - /** - * 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/ResourceIdentifier.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceIdentifier.java deleted file mode 100644 index 01ec2444db5b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceIdentifier.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.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** - * A resource identifier for an alert which can be used to direct the alert to the right product exposure group (tenant, - * workspace, subscription etc.). - */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "type", - defaultImpl = ResourceIdentifier.class) -@JsonTypeName("ResourceIdentifier") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "AzureResource", value = AzureResourceIdentifier.class), - @JsonSubTypes.Type(name = "LogAnalytics", value = LogAnalyticsIdentifier.class) -}) -@Immutable -public class ResourceIdentifier { - /** Creates an instance of ResourceIdentifier class. */ - public ResourceIdentifier() { - } - - /** - * 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/ResourceIdentifierType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceIdentifierType.java deleted file mode 100644 index e8011821057c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceIdentifierType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** There can be multiple identifiers of different type per alert, this field specify the identifier type. */ -public final class ResourceIdentifierType extends ExpandableStringEnum { - /** Static value AzureResource for ResourceIdentifierType. */ - public static final ResourceIdentifierType AZURE_RESOURCE = fromString("AzureResource"); - - /** Static value LogAnalytics for ResourceIdentifierType. */ - public static final ResourceIdentifierType LOG_ANALYTICS = fromString("LogAnalytics"); - - /** - * Creates a new instance of ResourceIdentifierType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ResourceIdentifierType() { - } - - /** - * Creates or finds a ResourceIdentifierType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ResourceIdentifierType. - */ - @JsonCreator - public static ResourceIdentifierType fromString(String name) { - return fromString(name, ResourceIdentifierType.class); - } - - /** - * Gets known ResourceIdentifierType values. - * - * @return known ResourceIdentifierType values. - */ - public static Collection values() { - return values(ResourceIdentifierType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceIdentityType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceIdentityType.java deleted file mode 100644 index 7b4a4da64f69..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceIdentityType.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.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** The identity type. */ -public enum ResourceIdentityType { - /** Enum value SystemAssigned. */ - SYSTEM_ASSIGNED("SystemAssigned"); - - /** The actual serialized value for a ResourceIdentityType instance. */ - private final String value; - - ResourceIdentityType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceIdentityType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceIdentityType object, or null if unable to parse. - */ - @JsonCreator - public static ResourceIdentityType fromString(String value) { - if (value == null) { - return null; - } - ResourceIdentityType[] items = ResourceIdentityType.values(); - for (ResourceIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** {@inheritDoc} */ - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceStatus.java deleted file mode 100644 index e6b38e15f877..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ResourceStatus.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The status of the resource regarding a single assessment. */ -public final class ResourceStatus extends ExpandableStringEnum { - /** Static value Healthy for ResourceStatus. */ - public static final ResourceStatus HEALTHY = fromString("Healthy"); - - /** Static value NotApplicable for ResourceStatus. */ - public static final ResourceStatus NOT_APPLICABLE = fromString("NotApplicable"); - - /** Static value OffByPolicy for ResourceStatus. */ - public static final ResourceStatus OFF_BY_POLICY = fromString("OffByPolicy"); - - /** Static value NotHealthy for ResourceStatus. */ - public static final ResourceStatus NOT_HEALTHY = fromString("NotHealthy"); - - /** - * Creates a new instance of ResourceStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ResourceStatus() { - } - - /** - * Creates or finds a ResourceStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding ResourceStatus. - */ - @JsonCreator - public static ResourceStatus fromString(String name) { - return fromString(name, ResourceStatus.class); - } - - /** - * Gets known ResourceStatus values. - * - * @return known ResourceStatus values. - */ - public static Collection values() { - return values(ResourceStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Roles.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Roles.java deleted file mode 100644 index c1e2a1bbea97..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Roles.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** A possible role to configure sending security notification alerts to. */ -public final class Roles extends ExpandableStringEnum { - /** Static value AccountAdmin for Roles. */ - public static final Roles ACCOUNT_ADMIN = fromString("AccountAdmin"); - - /** Static value ServiceAdmin for Roles. */ - public static final Roles SERVICE_ADMIN = fromString("ServiceAdmin"); - - /** Static value Owner for Roles. */ - public static final Roles OWNER = fromString("Owner"); - - /** Static value Contributor for Roles. */ - public static final Roles CONTRIBUTOR = fromString("Contributor"); - - /** - * Creates a new instance of Roles value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Roles() { - } - - /** - * Creates or finds a Roles from its string representation. - * - * @param name a name to look for. - * @return the corresponding Roles. - */ - @JsonCreator - public static Roles fromString(String name) { - return fromString(name, Roles.class); - } - - /** - * Gets known Roles values. - * - * @return known Roles values. - */ - public static Collection values() { - return values(Roles.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Rule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Rule.java deleted file mode 100644 index 616429113946..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Rule.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, - * Direction). All other remote addresses are recommended to be blocked. - */ -@Fluent -public final class Rule { - /* - * The name of the rule - */ - @JsonProperty(value = "name") - private String name; - - /* - * The rule's direction - */ - @JsonProperty(value = "direction") - private Direction direction; - - /* - * The rule's destination port - */ - @JsonProperty(value = "destinationPort") - private Integer destinationPort; - - /* - * The rule's transport protocols - */ - @JsonProperty(value = "protocols") - private List protocols; - - /* - * The remote IP addresses that should be able to communicate with the Azure resource on the rule's destination - * port and protocol - */ - @JsonProperty(value = "ipAddresses") - private List ipAddresses; - - /** Creates an instance of Rule class. */ - public Rule() { - } - - /** - * Get the name property: The name of the rule. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The name of the rule. - * - * @param name the name value to set. - * @return the Rule object itself. - */ - public Rule withName(String name) { - this.name = name; - return this; - } - - /** - * Get the direction property: The rule's direction. - * - * @return the direction value. - */ - public Direction direction() { - return this.direction; - } - - /** - * Set the direction property: The rule's direction. - * - * @param direction the direction value to set. - * @return the Rule object itself. - */ - public Rule withDirection(Direction direction) { - this.direction = direction; - return this; - } - - /** - * Get the destinationPort property: The rule's destination port. - * - * @return the destinationPort value. - */ - public Integer destinationPort() { - return this.destinationPort; - } - - /** - * Set the destinationPort property: The rule's destination port. - * - * @param destinationPort the destinationPort value to set. - * @return the Rule object itself. - */ - public Rule withDestinationPort(Integer destinationPort) { - this.destinationPort = destinationPort; - return this; - } - - /** - * Get the protocols property: The rule's transport protocols. - * - * @return the protocols value. - */ - public List protocols() { - return this.protocols; - } - - /** - * Set the protocols property: The rule's transport protocols. - * - * @param protocols the protocols value to set. - * @return the Rule object itself. - */ - public Rule withProtocols(List protocols) { - this.protocols = protocols; - return this; - } - - /** - * Get the ipAddresses property: The remote IP addresses that should be able to communicate with the Azure resource - * on the rule's destination port and protocol. - * - * @return the ipAddresses value. - */ - public List ipAddresses() { - return this.ipAddresses; - } - - /** - * Set the ipAddresses property: The remote IP addresses that should be able to communicate with the Azure resource - * on the rule's destination port and protocol. - * - * @param ipAddresses the ipAddresses value to set. - * @return the Rule object itself. - */ - public Rule withIpAddresses(List ipAddresses) { - this.ipAddresses = ipAddresses; - 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/RuleResults.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleResults.java deleted file mode 100644 index 68af6ea8d61f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleResults.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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.RuleResultsInner; -import java.util.List; - -/** An immutable client-side representation of RuleResults. */ -public interface RuleResults { - /** - * 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: Rule results properties. - * - * @return the properties value. - */ - RuleResultsProperties properties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.RuleResultsInner object. - * - * @return the inner object. - */ - RuleResultsInner innerModel(); - - /** The entirety of the RuleResults definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - /** The RuleResults definition stages. */ - interface DefinitionStages { - /** The first stage of the RuleResults definition. */ - interface Blank extends WithScope { - } - /** The stage of the RuleResults definition allowing to specify parent resource. */ - interface WithScope { - /** - * Specifies resourceId. - * - * @param resourceId The identifier of the resource. - * @return the next definition stage. - */ - WithCreate withExistingResourceId(String resourceId); - } - /** - * The stage of the RuleResults definition which contains all the minimum required properties for the resource - * to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithLatestScan, DefinitionStages.WithResults, DefinitionStages.WithWorkspaceId { - /** - * Executes the create request. - * - * @return the created resource. - */ - RuleResults create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - RuleResults create(Context context); - } - /** The stage of the RuleResults definition allowing to specify latestScan. */ - interface WithLatestScan { - /** - * Specifies the latestScan property: Take results from latest scan.. - * - * @param latestScan Take results from latest scan. - * @return the next definition stage. - */ - WithCreate withLatestScan(Boolean latestScan); - } - /** The stage of the RuleResults definition allowing to specify results. */ - interface WithResults { - /** - * Specifies the results property: Expected results to be inserted into the baseline. Leave this field empty - * it LatestScan == true.. - * - * @param results Expected results to be inserted into the baseline. Leave this field empty it LatestScan == - * true. - * @return the next definition stage. - */ - WithCreate withResults(List> results); - } - /** The stage of the RuleResults definition allowing to specify workspaceId. */ - interface WithWorkspaceId { - /** - * Specifies the workspaceId property: The workspace Id.. - * - * @param workspaceId The workspace Id. - * @return the next definition stage. - */ - WithCreate withWorkspaceId(String workspaceId); - } - } - /** - * Begins update for the RuleResults resource. - * - * @return the stage of resource update. - */ - RuleResults.Update update(); - - /** The template for RuleResults update. */ - interface Update extends UpdateStages.WithLatestScan, UpdateStages.WithResults, UpdateStages.WithWorkspaceId { - /** - * Executes the update request. - * - * @return the updated resource. - */ - RuleResults apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - RuleResults apply(Context context); - } - /** The RuleResults update stages. */ - interface UpdateStages { - /** The stage of the RuleResults update allowing to specify latestScan. */ - interface WithLatestScan { - /** - * Specifies the latestScan property: Take results from latest scan.. - * - * @param latestScan Take results from latest scan. - * @return the next definition stage. - */ - Update withLatestScan(Boolean latestScan); - } - /** The stage of the RuleResults update allowing to specify results. */ - interface WithResults { - /** - * Specifies the results property: Expected results to be inserted into the baseline. Leave this field empty - * it LatestScan == true.. - * - * @param results Expected results to be inserted into the baseline. Leave this field empty it LatestScan == - * true. - * @return the next definition stage. - */ - Update withResults(List> results); - } - /** The stage of the RuleResults update allowing to specify workspaceId. */ - interface WithWorkspaceId { - /** - * Specifies the workspaceId property: The workspace Id.. - * - * @param workspaceId The workspace Id. - * @return the next definition stage. - */ - Update withWorkspaceId(String workspaceId); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleResultsInput.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleResultsInput.java deleted file mode 100644 index 0251a0b35200..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleResultsInput.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Rule results input. */ -@Fluent -public final class RuleResultsInput { - /* - * Take results from latest scan. - */ - @JsonProperty(value = "latestScan") - private Boolean latestScan; - - /* - * Expected results to be inserted into the baseline. - * Leave this field empty it LatestScan == true. - */ - @JsonProperty(value = "results") - private List> results; - - /** Creates an instance of RuleResultsInput class. */ - public RuleResultsInput() { - } - - /** - * Get the latestScan property: Take results from latest scan. - * - * @return the latestScan value. - */ - public Boolean latestScan() { - return this.latestScan; - } - - /** - * Set the latestScan property: Take results from latest scan. - * - * @param latestScan the latestScan value to set. - * @return the RuleResultsInput object itself. - */ - public RuleResultsInput withLatestScan(Boolean latestScan) { - this.latestScan = latestScan; - return this; - } - - /** - * Get the results property: Expected results to be inserted into the baseline. Leave this field empty it LatestScan - * == true. - * - * @return the results value. - */ - public List> results() { - return this.results; - } - - /** - * Set the results property: Expected results to be inserted into the baseline. Leave this field empty it LatestScan - * == true. - * - * @param results the results value to set. - * @return the RuleResultsInput object itself. - */ - public RuleResultsInput withResults(List> results) { - this.results = results; - 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/RuleResultsProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleResultsProperties.java deleted file mode 100644 index 53f49fa986ab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleResultsProperties.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Rule results properties. */ -@Fluent -public final class RuleResultsProperties { - /* - * Expected results in the baseline. - */ - @JsonProperty(value = "results") - private List> results; - - /** Creates an instance of RuleResultsProperties class. */ - public RuleResultsProperties() { - } - - /** - * Get the results property: Expected results in the baseline. - * - * @return the results value. - */ - public List> results() { - return this.results; - } - - /** - * Set the results property: Expected results in the baseline. - * - * @param results the results value to set. - * @return the RuleResultsProperties object itself. - */ - public RuleResultsProperties withResults(List> results) { - this.results = results; - 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/RuleSeverity.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleSeverity.java deleted file mode 100644 index 51bcd78788b9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleSeverity.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The rule severity. */ -public final class RuleSeverity extends ExpandableStringEnum { - /** Static value High for RuleSeverity. */ - public static final RuleSeverity HIGH = fromString("High"); - - /** Static value Medium for RuleSeverity. */ - public static final RuleSeverity MEDIUM = fromString("Medium"); - - /** Static value Low for RuleSeverity. */ - public static final RuleSeverity LOW = fromString("Low"); - - /** Static value Informational for RuleSeverity. */ - public static final RuleSeverity INFORMATIONAL = fromString("Informational"); - - /** Static value Obsolete for RuleSeverity. */ - public static final RuleSeverity OBSOLETE = fromString("Obsolete"); - - /** - * Creates a new instance of RuleSeverity value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RuleSeverity() { - } - - /** - * Creates or finds a RuleSeverity from its string representation. - * - * @param name a name to look for. - * @return the corresponding RuleSeverity. - */ - @JsonCreator - public static RuleSeverity fromString(String name) { - return fromString(name, RuleSeverity.class); - } - - /** - * Gets known RuleSeverity values. - * - * @return known RuleSeverity values. - */ - public static Collection values() { - return values(RuleSeverity.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleState.java deleted file mode 100644 index e9c8cb02405b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleState.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.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** Possible states of the rule. */ -public enum RuleState { - /** Enum value Enabled. */ - ENABLED("Enabled"), - - /** Enum value Disabled. */ - DISABLED("Disabled"), - - /** Enum value Expired. */ - EXPIRED("Expired"); - - /** The actual serialized value for a RuleState instance. */ - private final String value; - - RuleState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a RuleState instance. - * - * @param value the serialized value to parse. - * @return the parsed RuleState object, or null if unable to parse. - */ - @JsonCreator - public static RuleState fromString(String value) { - if (value == null) { - return null; - } - RuleState[] items = RuleState.values(); - for (RuleState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** {@inheritDoc} */ - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleStatus.java deleted file mode 100644 index 28934ce8878b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleStatus.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The rule result status. */ -public final class RuleStatus extends ExpandableStringEnum { - /** Static value NonFinding for RuleStatus. */ - public static final RuleStatus NON_FINDING = fromString("NonFinding"); - - /** Static value Finding for RuleStatus. */ - public static final RuleStatus FINDING = fromString("Finding"); - - /** Static value InternalError for RuleStatus. */ - public static final RuleStatus INTERNAL_ERROR = fromString("InternalError"); - - /** - * Creates a new instance of RuleStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RuleStatus() { - } - - /** - * Creates or finds a RuleStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding RuleStatus. - */ - @JsonCreator - public static RuleStatus fromString(String name) { - return fromString(name, RuleStatus.class); - } - - /** - * Gets known RuleStatus values. - * - * @return known RuleStatus values. - */ - public static Collection values() { - return values(RuleStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleType.java deleted file mode 100644 index 0a2be8577c38..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RuleType.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The rule type. */ -public final class RuleType extends ExpandableStringEnum { - /** Static value Binary for RuleType. */ - public static final RuleType BINARY = fromString("Binary"); - - /** Static value BaselineExpected for RuleType. */ - public static final RuleType BASELINE_EXPECTED = fromString("BaselineExpected"); - - /** Static value PositiveList for RuleType. */ - public static final RuleType POSITIVE_LIST = fromString("PositiveList"); - - /** Static value NegativeList for RuleType. */ - public static final RuleType NEGATIVE_LIST = fromString("NegativeList"); - - /** - * Creates a new instance of RuleType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public RuleType() { - } - - /** - * Creates or finds a RuleType from its string representation. - * - * @param name a name to look for. - * @return the corresponding RuleType. - */ - @JsonCreator - public static RuleType fromString(String name) { - return fromString(name, RuleType.class); - } - - /** - * Gets known RuleType values. - * - * @return known RuleType values. - */ - public static Collection values() { - return values(RuleType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RulesResults.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RulesResults.java deleted file mode 100644 index 9d688c59de5e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RulesResults.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.RulesResultsInner; -import java.util.List; - -/** An immutable client-side representation of RulesResults. */ -public interface RulesResults { - /** - * Gets the value property: List of rule results. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.RulesResultsInner object. - * - * @return the inner object. - */ - RulesResultsInner innerModel(); -} 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 deleted file mode 100644 index 54f878f6256e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/RulesResultsInput.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Rules results input. */ -@Fluent -public final class RulesResultsInput { - /* - * Take results from latest scan. - */ - @JsonProperty(value = "latestScan") - private Boolean latestScan; - - /* - * Expected results to be inserted into the baseline. - * Leave this field empty it LatestScan == true. - */ - @JsonProperty(value = "results") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map>> results; - - /** Creates an instance of RulesResultsInput class. */ - public RulesResultsInput() { - } - - /** - * Get the latestScan property: Take results from latest scan. - * - * @return the latestScan value. - */ - public Boolean latestScan() { - return this.latestScan; - } - - /** - * Set the latestScan property: Take results from latest scan. - * - * @param latestScan the latestScan value to set. - * @return the RulesResultsInput object itself. - */ - public RulesResultsInput withLatestScan(Boolean latestScan) { - this.latestScan = latestScan; - return this; - } - - /** - * Get the results property: Expected results to be inserted into the baseline. Leave this field empty it LatestScan - * == true. - * - * @return the results value. - */ - public Map>> results() { - return this.results; - } - - /** - * Set the results property: Expected results to be inserted into the baseline. Leave this field empty it LatestScan - * == true. - * - * @param results the results value to set. - * @return the RulesResultsInput object itself. - */ - public RulesResultsInput withResults(Map>> results) { - this.results = results; - 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/Scan.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Scan.java deleted file mode 100644 index 824646abb620..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Scan.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.ScanInner; - -/** An immutable client-side representation of Scan. */ -public interface Scan { - /** - * 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: A vulnerability assessment scan record properties. - * - * @return the properties value. - */ - ScanProperties properties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ScanInner object. - * - * @return the inner object. - */ - ScanInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanProperties.java deleted file mode 100644 index 13cc398281e7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanProperties.java +++ /dev/null @@ -1,415 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** A vulnerability assessment scan record properties. */ -@Fluent -public final class ScanProperties { - /* - * The scan trigger type. - */ - @JsonProperty(value = "triggerType") - private ScanTriggerType triggerType; - - /* - * The scan status. - */ - @JsonProperty(value = "state") - private ScanState state; - - /* - * The server name. - */ - @JsonProperty(value = "server") - private String server; - - /* - * The database name. - */ - @JsonProperty(value = "database") - private String database; - - /* - * The SQL version. - */ - @JsonProperty(value = "sqlVersion") - private String sqlVersion; - - /* - * The scan start time (UTC). - */ - @JsonProperty(value = "startTime") - private OffsetDateTime startTime; - - /* - * Scan results are valid until end time (UTC). - */ - @JsonProperty(value = "endTime") - private OffsetDateTime endTime; - - /* - * The number of failed rules with high severity. - */ - @JsonProperty(value = "highSeverityFailedRulesCount") - private Integer highSeverityFailedRulesCount; - - /* - * The number of failed rules with medium severity. - */ - @JsonProperty(value = "mediumSeverityFailedRulesCount") - private Integer mediumSeverityFailedRulesCount; - - /* - * The number of failed rules with low severity. - */ - @JsonProperty(value = "lowSeverityFailedRulesCount") - private Integer lowSeverityFailedRulesCount; - - /* - * The number of total passed rules. - */ - @JsonProperty(value = "totalPassedRulesCount") - private Integer totalPassedRulesCount; - - /* - * The number of total failed rules. - */ - @JsonProperty(value = "totalFailedRulesCount") - private Integer totalFailedRulesCount; - - /* - * The number of total rules assessed. - */ - @JsonProperty(value = "totalRulesCount") - private Integer totalRulesCount; - - /* - * Baseline created for this database, and has one or more rules. - */ - @JsonProperty(value = "isBaselineApplied") - private Boolean isBaselineApplied; - - /* - * Last scan time. - */ - @JsonProperty(value = "lastScanTime") - private OffsetDateTime lastScanTime; - - /** Creates an instance of ScanProperties class. */ - public ScanProperties() { - } - - /** - * Get the triggerType property: The scan trigger type. - * - * @return the triggerType value. - */ - public ScanTriggerType triggerType() { - return this.triggerType; - } - - /** - * Set the triggerType property: The scan trigger type. - * - * @param triggerType the triggerType value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withTriggerType(ScanTriggerType triggerType) { - this.triggerType = triggerType; - return this; - } - - /** - * Get the state property: The scan status. - * - * @return the state value. - */ - public ScanState state() { - return this.state; - } - - /** - * Set the state property: The scan status. - * - * @param state the state value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withState(ScanState state) { - this.state = state; - return this; - } - - /** - * Get the server property: The server name. - * - * @return the server value. - */ - public String server() { - return this.server; - } - - /** - * Set the server property: The server name. - * - * @param server the server value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withServer(String server) { - this.server = server; - return this; - } - - /** - * Get the database property: The database name. - * - * @return the database value. - */ - public String database() { - return this.database; - } - - /** - * Set the database property: The database name. - * - * @param database the database value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withDatabase(String database) { - this.database = database; - return this; - } - - /** - * Get the sqlVersion property: The SQL version. - * - * @return the sqlVersion value. - */ - public String sqlVersion() { - return this.sqlVersion; - } - - /** - * Set the sqlVersion property: The SQL version. - * - * @param sqlVersion the sqlVersion value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withSqlVersion(String sqlVersion) { - this.sqlVersion = sqlVersion; - return this; - } - - /** - * Get the startTime property: The scan start time (UTC). - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Set the startTime property: The scan start time (UTC). - * - * @param startTime the startTime value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withStartTime(OffsetDateTime startTime) { - this.startTime = startTime; - return this; - } - - /** - * Get the endTime property: Scan results are valid until end time (UTC). - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Set the endTime property: Scan results are valid until end time (UTC). - * - * @param endTime the endTime value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withEndTime(OffsetDateTime endTime) { - this.endTime = endTime; - return this; - } - - /** - * Get the highSeverityFailedRulesCount property: The number of failed rules with high severity. - * - * @return the highSeverityFailedRulesCount value. - */ - public Integer highSeverityFailedRulesCount() { - return this.highSeverityFailedRulesCount; - } - - /** - * Set the highSeverityFailedRulesCount property: The number of failed rules with high severity. - * - * @param highSeverityFailedRulesCount the highSeverityFailedRulesCount value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withHighSeverityFailedRulesCount(Integer highSeverityFailedRulesCount) { - this.highSeverityFailedRulesCount = highSeverityFailedRulesCount; - return this; - } - - /** - * Get the mediumSeverityFailedRulesCount property: The number of failed rules with medium severity. - * - * @return the mediumSeverityFailedRulesCount value. - */ - public Integer mediumSeverityFailedRulesCount() { - return this.mediumSeverityFailedRulesCount; - } - - /** - * Set the mediumSeverityFailedRulesCount property: The number of failed rules with medium severity. - * - * @param mediumSeverityFailedRulesCount the mediumSeverityFailedRulesCount value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withMediumSeverityFailedRulesCount(Integer mediumSeverityFailedRulesCount) { - this.mediumSeverityFailedRulesCount = mediumSeverityFailedRulesCount; - return this; - } - - /** - * Get the lowSeverityFailedRulesCount property: The number of failed rules with low severity. - * - * @return the lowSeverityFailedRulesCount value. - */ - public Integer lowSeverityFailedRulesCount() { - return this.lowSeverityFailedRulesCount; - } - - /** - * Set the lowSeverityFailedRulesCount property: The number of failed rules with low severity. - * - * @param lowSeverityFailedRulesCount the lowSeverityFailedRulesCount value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withLowSeverityFailedRulesCount(Integer lowSeverityFailedRulesCount) { - this.lowSeverityFailedRulesCount = lowSeverityFailedRulesCount; - return this; - } - - /** - * Get the totalPassedRulesCount property: The number of total passed rules. - * - * @return the totalPassedRulesCount value. - */ - public Integer totalPassedRulesCount() { - return this.totalPassedRulesCount; - } - - /** - * Set the totalPassedRulesCount property: The number of total passed rules. - * - * @param totalPassedRulesCount the totalPassedRulesCount value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withTotalPassedRulesCount(Integer totalPassedRulesCount) { - this.totalPassedRulesCount = totalPassedRulesCount; - return this; - } - - /** - * Get the totalFailedRulesCount property: The number of total failed rules. - * - * @return the totalFailedRulesCount value. - */ - public Integer totalFailedRulesCount() { - return this.totalFailedRulesCount; - } - - /** - * Set the totalFailedRulesCount property: The number of total failed rules. - * - * @param totalFailedRulesCount the totalFailedRulesCount value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withTotalFailedRulesCount(Integer totalFailedRulesCount) { - this.totalFailedRulesCount = totalFailedRulesCount; - return this; - } - - /** - * Get the totalRulesCount property: The number of total rules assessed. - * - * @return the totalRulesCount value. - */ - public Integer totalRulesCount() { - return this.totalRulesCount; - } - - /** - * Set the totalRulesCount property: The number of total rules assessed. - * - * @param totalRulesCount the totalRulesCount value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withTotalRulesCount(Integer totalRulesCount) { - this.totalRulesCount = totalRulesCount; - return this; - } - - /** - * Get the isBaselineApplied property: Baseline created for this database, and has one or more rules. - * - * @return the isBaselineApplied value. - */ - public Boolean isBaselineApplied() { - return this.isBaselineApplied; - } - - /** - * Set the isBaselineApplied property: Baseline created for this database, and has one or more rules. - * - * @param isBaselineApplied the isBaselineApplied value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withIsBaselineApplied(Boolean isBaselineApplied) { - this.isBaselineApplied = isBaselineApplied; - return this; - } - - /** - * Get the lastScanTime property: Last scan time. - * - * @return the lastScanTime value. - */ - public OffsetDateTime lastScanTime() { - return this.lastScanTime; - } - - /** - * Set the lastScanTime property: Last scan time. - * - * @param lastScanTime the lastScanTime value to set. - * @return the ScanProperties object itself. - */ - public ScanProperties withLastScanTime(OffsetDateTime lastScanTime) { - this.lastScanTime = lastScanTime; - 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/ScanResult.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanResult.java deleted file mode 100644 index 30a10622825c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanResult.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.ScanResultInner; - -/** An immutable client-side representation of ScanResult. */ -public interface ScanResult { - /** - * 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: A vulnerability assessment scan result properties for a single rule. - * - * @return the properties value. - */ - ScanResultProperties properties(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ScanResultInner object. - * - * @return the inner object. - */ - ScanResultInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanResultProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanResultProperties.java deleted file mode 100644 index da96966e92b6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanResultProperties.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** A vulnerability assessment scan result properties for a single rule. */ -@Fluent -public final class ScanResultProperties { - /* - * The rule Id. - */ - @JsonProperty(value = "ruleId") - private String ruleId; - - /* - * The rule result status. - */ - @JsonProperty(value = "status") - private RuleStatus status; - - /* - * Indicated whether the results specified here are trimmed. - */ - @JsonProperty(value = "isTrimmed") - private Boolean isTrimmed; - - /* - * The results of the query that was run. - */ - @JsonProperty(value = "queryResults") - private List> queryResults; - - /* - * Remediation details. - */ - @JsonProperty(value = "remediation") - private Remediation remediation; - - /* - * The rule result adjusted with baseline. - */ - @JsonProperty(value = "baselineAdjustedResult") - private BaselineAdjustedResult baselineAdjustedResult; - - /* - * vulnerability assessment rule metadata details. - */ - @JsonProperty(value = "ruleMetadata") - private VaRule ruleMetadata; - - /** Creates an instance of ScanResultProperties class. */ - public ScanResultProperties() { - } - - /** - * Get the ruleId property: The rule Id. - * - * @return the ruleId value. - */ - public String ruleId() { - return this.ruleId; - } - - /** - * Set the ruleId property: The rule Id. - * - * @param ruleId the ruleId value to set. - * @return the ScanResultProperties object itself. - */ - public ScanResultProperties withRuleId(String ruleId) { - this.ruleId = ruleId; - return this; - } - - /** - * Get the status property: The rule result status. - * - * @return the status value. - */ - public RuleStatus status() { - return this.status; - } - - /** - * Set the status property: The rule result status. - * - * @param status the status value to set. - * @return the ScanResultProperties object itself. - */ - public ScanResultProperties withStatus(RuleStatus status) { - this.status = status; - return this; - } - - /** - * Get the isTrimmed property: Indicated whether the results specified here are trimmed. - * - * @return the isTrimmed value. - */ - public Boolean isTrimmed() { - return this.isTrimmed; - } - - /** - * Set the isTrimmed property: Indicated whether the results specified here are trimmed. - * - * @param isTrimmed the isTrimmed value to set. - * @return the ScanResultProperties object itself. - */ - public ScanResultProperties withIsTrimmed(Boolean isTrimmed) { - this.isTrimmed = isTrimmed; - return this; - } - - /** - * Get the queryResults property: The results of the query that was run. - * - * @return the queryResults value. - */ - public List> queryResults() { - return this.queryResults; - } - - /** - * Set the queryResults property: The results of the query that was run. - * - * @param queryResults the queryResults value to set. - * @return the ScanResultProperties object itself. - */ - public ScanResultProperties withQueryResults(List> queryResults) { - this.queryResults = queryResults; - return this; - } - - /** - * Get the remediation property: Remediation details. - * - * @return the remediation value. - */ - public Remediation remediation() { - return this.remediation; - } - - /** - * Set the remediation property: Remediation details. - * - * @param remediation the remediation value to set. - * @return the ScanResultProperties object itself. - */ - public ScanResultProperties withRemediation(Remediation remediation) { - this.remediation = remediation; - return this; - } - - /** - * Get the baselineAdjustedResult property: The rule result adjusted with baseline. - * - * @return the baselineAdjustedResult value. - */ - public BaselineAdjustedResult baselineAdjustedResult() { - return this.baselineAdjustedResult; - } - - /** - * Set the baselineAdjustedResult property: The rule result adjusted with baseline. - * - * @param baselineAdjustedResult the baselineAdjustedResult value to set. - * @return the ScanResultProperties object itself. - */ - public ScanResultProperties withBaselineAdjustedResult(BaselineAdjustedResult baselineAdjustedResult) { - this.baselineAdjustedResult = baselineAdjustedResult; - return this; - } - - /** - * Get the ruleMetadata property: vulnerability assessment rule metadata details. - * - * @return the ruleMetadata value. - */ - public VaRule ruleMetadata() { - return this.ruleMetadata; - } - - /** - * Set the ruleMetadata property: vulnerability assessment rule metadata details. - * - * @param ruleMetadata the ruleMetadata value to set. - * @return the ScanResultProperties object itself. - */ - public ScanResultProperties withRuleMetadata(VaRule ruleMetadata) { - this.ruleMetadata = ruleMetadata; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (remediation() != null) { - remediation().validate(); - } - if (baselineAdjustedResult() != null) { - baselineAdjustedResult().validate(); - } - if (ruleMetadata() != null) { - ruleMetadata().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanResults.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanResults.java deleted file mode 100644 index babe43af9aab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanResults.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.ScanResultsInner; -import java.util.List; - -/** An immutable client-side representation of ScanResults. */ -public interface ScanResults { - /** - * Gets the value property: List of vulnerability assessment scan results. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ScanResultsInner object. - * - * @return the inner object. - */ - ScanResultsInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanState.java deleted file mode 100644 index be0a3069acf2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanState.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The scan status. */ -public final class ScanState extends ExpandableStringEnum { - /** Static value Failed for ScanState. */ - public static final ScanState FAILED = fromString("Failed"); - - /** Static value FailedToRun for ScanState. */ - public static final ScanState FAILED_TO_RUN = fromString("FailedToRun"); - - /** Static value InProgress for ScanState. */ - public static final ScanState IN_PROGRESS = fromString("InProgress"); - - /** Static value Passed for ScanState. */ - public static final ScanState PASSED = fromString("Passed"); - - /** - * Creates a new instance of ScanState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ScanState() { - } - - /** - * Creates or finds a ScanState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScanState. - */ - @JsonCreator - public static ScanState fromString(String name) { - return fromString(name, ScanState.class); - } - - /** - * Gets known ScanState values. - * - * @return known ScanState values. - */ - public static Collection values() { - return values(ScanState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanTriggerType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanTriggerType.java deleted file mode 100644 index c0fd6f5e26f1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanTriggerType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The scan trigger type. */ -public final class ScanTriggerType extends ExpandableStringEnum { - /** Static value OnDemand for ScanTriggerType. */ - public static final ScanTriggerType ON_DEMAND = fromString("OnDemand"); - - /** Static value Recurring for ScanTriggerType. */ - public static final ScanTriggerType RECURRING = fromString("Recurring"); - - /** - * Creates a new instance of ScanTriggerType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ScanTriggerType() { - } - - /** - * Creates or finds a ScanTriggerType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScanTriggerType. - */ - @JsonCreator - public static ScanTriggerType fromString(String name) { - return fromString(name, ScanTriggerType.class); - } - - /** - * Gets known ScanTriggerType values. - * - * @return known ScanTriggerType values. - */ - public static Collection values() { - return values(ScanTriggerType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningMode.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningMode.java deleted file mode 100644 index 57c620d277c1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScanningMode.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The scanning mode for the VM scan. */ -public final class ScanningMode extends ExpandableStringEnum { - /** Static value Default for ScanningMode. */ - public static final ScanningMode DEFAULT = fromString("Default"); - - /** - * Creates a new instance of ScanningMode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ScanningMode() { - } - - /** - * Creates or finds a ScanningMode from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScanningMode. - */ - @JsonCreator - public static ScanningMode fromString(String name) { - return fromString(name, ScanningMode.class); - } - - /** - * Gets known ScanningMode values. - * - * @return known ScanningMode values. - */ - public static Collection values() { - return values(ScanningMode.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Scans.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Scans.java deleted file mode 100644 index ab7530dc4d29..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Scans.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.ScansInner; -import java.util.List; - -/** An immutable client-side representation of Scans. */ -public interface Scans { - /** - * Gets the value property: List of vulnerability assessment scan records. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ScansInner object. - * - * @return the inner object. - */ - ScansInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScopeElement.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScopeElement.java deleted file mode 100644 index 8eb0bdabdc8d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScopeElement.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** A more specific scope used to identify the alerts to suppress. */ -@Fluent -public final class ScopeElement { - /* - * The alert entity type to suppress by. - */ - @JsonProperty(value = "field") - private String field; - - /* - * A more specific scope used to identify the alerts to suppress. - */ - @JsonIgnore private Map additionalProperties; - - /** Creates an instance of ScopeElement class. */ - public ScopeElement() { - } - - /** - * Get the field property: The alert entity type to suppress by. - * - * @return the field value. - */ - public String field() { - return this.field; - } - - /** - * Set the field property: The alert entity type to suppress by. - * - * @param field the field value to set. - * @return the ScopeElement object itself. - */ - public ScopeElement withField(String field) { - this.field = field; - return this; - } - - /** - * Get the additionalProperties property: A more specific scope used to identify the alerts to suppress. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: A more specific scope used to identify the alerts to suppress. - * - * @param additionalProperties the additionalProperties value to set. - * @return the ScopeElement object itself. - */ - public ScopeElement withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScopeName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScopeName.java deleted file mode 100644 index b14c4be5daac..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ScopeName.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The resource scope of the health report. */ -public final class ScopeName extends ExpandableStringEnum { - /** Static value Connectors for ScopeName. */ - public static final ScopeName CONNECTORS = fromString("Connectors"); - - /** Static value Clusters for ScopeName. */ - public static final ScopeName CLUSTERS = fromString("Clusters"); - - /** Static value VirtualMachines for ScopeName. */ - public static final ScopeName VIRTUAL_MACHINES = fromString("VirtualMachines"); - - /** Static value Unknown for ScopeName. */ - public static final ScopeName UNKNOWN = fromString("Unknown"); - - /** - * Creates a new instance of ScopeName value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ScopeName() { - } - - /** - * Creates or finds a ScopeName from its string representation. - * - * @param name a name to look for. - * @return the corresponding ScopeName. - */ - @JsonCreator - public static ScopeName fromString(String name) { - return fromString(name, ScopeName.class); - } - - /** - * Gets known ScopeName values. - * - * @return known ScopeName values. - */ - public static Collection values() { - return values(ScopeName.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDefinitionItem.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDefinitionItem.java deleted file mode 100644 index 4596d0d59d8b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDefinitionItem.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.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import java.util.List; - -/** An immutable client-side representation of SecureScoreControlDefinitionItem. */ -public interface SecureScoreControlDefinitionItem { - /** - * 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: User friendly display name of the control. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the description property: User friendly description of the control. - * - * @return the description value. - */ - String description(); - - /** - * Gets the maxScore property: Maximum control score (0..10). - * - * @return the maxScore value. - */ - Integer maxScore(); - - /** - * Gets the source property: Source object from which the control was created. - * - * @return the source value. - */ - SecureScoreControlDefinitionSource source(); - - /** - * Gets the assessmentDefinitions property: Array of assessments metadata IDs that are included in this security - * control. - * - * @return the assessmentDefinitions value. - */ - List assessmentDefinitions(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner object. - * - * @return the inner object. - */ - SecureScoreControlDefinitionItemInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDefinitionList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDefinitionList.java deleted file mode 100644 index c998268ff6f7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDefinitionList.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.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of security controls definition. */ -@Immutable -public final class SecureScoreControlDefinitionList { - /* - * Collection of security controls definition in this page - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of SecureScoreControlDefinitionList class. */ - public SecureScoreControlDefinitionList() { - } - - /** - * Get the value property: Collection of security controls definition in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDefinitionSource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDefinitionSource.java deleted file mode 100644 index cb58923bd593..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDefinitionSource.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The type of the security control (For example, BuiltIn). */ -@Fluent -public final class SecureScoreControlDefinitionSource { - /* - * The type of security control (for example, BuiltIn) - */ - @JsonProperty(value = "sourceType") - private ControlType sourceType; - - /** Creates an instance of SecureScoreControlDefinitionSource class. */ - public SecureScoreControlDefinitionSource() { - } - - /** - * Get the sourceType property: The type of security control (for example, BuiltIn). - * - * @return the sourceType value. - */ - public ControlType sourceType() { - return this.sourceType; - } - - /** - * Set the sourceType property: The type of security control (for example, BuiltIn). - * - * @param sourceType the sourceType value to set. - * @return the SecureScoreControlDefinitionSource object itself. - */ - public SecureScoreControlDefinitionSource withSourceType(ControlType sourceType) { - this.sourceType = sourceType; - 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/SecureScoreControlDefinitions.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDefinitions.java deleted file mode 100644 index f882c4358018..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDefinitions.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of SecureScoreControlDefinitions. */ -public interface SecureScoreControlDefinitions { - /** - * List the available security controls, their assessments, and the max score. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySubscription(); - - /** - * For a specified subscription, list the available security controls, their assessments, and the max score. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security controls definition as paginated response with {@link PagedIterable}. - */ - PagedIterable listBySubscription(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDetails.java deleted file mode 100644 index 33f4ec67273f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlDetails.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.SecureScoreControlDetailsInner; - -/** An immutable client-side representation of SecureScoreControlDetails. */ -public interface SecureScoreControlDetails { - /** - * 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: User friendly display name of the control. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the healthyResourceCount property: Number of healthy resources in the control. - * - * @return the healthyResourceCount value. - */ - Integer healthyResourceCount(); - - /** - * Gets the unhealthyResourceCount property: Number of unhealthy resources in the control. - * - * @return the unhealthyResourceCount value. - */ - Integer unhealthyResourceCount(); - - /** - * Gets the notApplicableResourceCount property: Number of not applicable resources in the control. - * - * @return the notApplicableResourceCount value. - */ - Integer notApplicableResourceCount(); - - /** - * Gets the weight property: The relative weight for this specific control in each of your subscriptions. Used when - * calculating an aggregated score for this control across all of your subscriptions. - * - * @return the weight value. - */ - Long weight(); - - /** - * Gets the definition property: Information about the security control. - * - * @return the definition value. - */ - SecureScoreControlDefinitionItem definition(); - - /** - * Gets the max property: Maximum score available. - * - * @return the max value. - */ - Integer max(); - - /** - * Gets the current property: Current score. - * - * @return the current value. - */ - Double current(); - - /** - * Gets the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the - * decimal point. - * - * @return the percentage value. - */ - Double percentage(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecureScoreControlDetailsInner object. - * - * @return the inner object. - */ - SecureScoreControlDetailsInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlList.java deleted file mode 100644 index 28c1e30072c1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlList.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.resourcemanager.security.fluent.models.SecureScoreControlDetailsInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of security controls. */ -@Immutable -public final class SecureScoreControlList { - /* - * Collection of security controls in this page - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of SecureScoreControlList class. */ - public SecureScoreControlList() { - } - - /** - * Get the value property: Collection of security controls in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlScoreDetails.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlScoreDetails.java deleted file mode 100644 index 3ef440e79b3c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControlScoreDetails.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlScoreDetailsInner; - -/** An immutable client-side representation of SecureScoreControlScoreDetails. */ -public interface SecureScoreControlScoreDetails { - /** - * Gets the displayName property: User friendly display name of the control. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the healthyResourceCount property: Number of healthy resources in the control. - * - * @return the healthyResourceCount value. - */ - Integer healthyResourceCount(); - - /** - * Gets the unhealthyResourceCount property: Number of unhealthy resources in the control. - * - * @return the unhealthyResourceCount value. - */ - Integer unhealthyResourceCount(); - - /** - * Gets the notApplicableResourceCount property: Number of not applicable resources in the control. - * - * @return the notApplicableResourceCount value. - */ - Integer notApplicableResourceCount(); - - /** - * Gets the weight property: The relative weight for this specific control in each of your subscriptions. Used when - * calculating an aggregated score for this control across all of your subscriptions. - * - * @return the weight value. - */ - Long weight(); - - /** - * Gets the definition property: Information about the security control. - * - * @return the definition value. - */ - SecureScoreControlDefinitionItem definition(); - - /** - * Gets the max property: Maximum score available. - * - * @return the max value. - */ - Integer max(); - - /** - * Gets the current property: Current score. - * - * @return the current value. - */ - Double current(); - - /** - * Gets the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the - * decimal point. - * - * @return the percentage value. - */ - Double percentage(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecureScoreControlScoreDetailsInner object. - * - * @return the inner object. - */ - SecureScoreControlScoreDetailsInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControls.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControls.java deleted file mode 100644 index a35e79511405..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreControls.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.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of SecureScoreControls. */ -public interface SecureScoreControls { - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls for a specific initiative within a scope as paginated response with {@link - * PagedIterable}. - */ - PagedIterable listBySecureScore(String secureScoreName); - - /** - * Get all security controls for a specific initiative within a scope. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls for a specific initiative within a scope as paginated response with {@link - * PagedIterable}. - */ - PagedIterable listBySecureScore( - String secureScoreName, ExpandControlsEnum expand, Context context); - - /** - * Get all security controls within a scope. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls within a scope as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Get all security controls within a scope. - * - * @param expand OData expand. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all security controls within a scope as paginated response with {@link PagedIterable}. - */ - PagedIterable list(ExpandControlsEnum expand, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreItem.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreItem.java deleted file mode 100644 index 5115559f32bf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoreItem.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.resourcemanager.security.fluent.models.SecureScoreItemInner; - -/** An immutable client-side representation of SecureScoreItem. */ -public interface SecureScoreItem { - /** - * 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: The initiative’s name. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the weight property: The relative weight for each subscription. Used when calculating an aggregated secure - * score for multiple subscriptions. - * - * @return the weight value. - */ - Long weight(); - - /** - * Gets the max property: Maximum score available. - * - * @return the max value. - */ - Integer max(); - - /** - * Gets the current property: Current score. - * - * @return the current value. - */ - Double current(); - - /** - * Gets the percentage property: Ratio of the current score divided by the maximum. Rounded to 4 digits after the - * decimal point. - * - * @return the percentage value. - */ - Double percentage(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecureScoreItemInner object. - * - * @return the inner object. - */ - SecureScoreItemInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScores.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScores.java deleted file mode 100644 index 0eaea250df3f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScores.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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 SecureScores. */ -public interface SecureScores { - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of secure scores as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope along with - * {@link Response}. - */ - Response getWithResponse(String secureScoreName, Context context); - - /** - * Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC - * Default initiative, use 'ascScore'. - * - * @param secureScoreName The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample - * request below. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return secure score for a specific Microsoft Defender for Cloud initiative within your current scope. - */ - SecureScoreItem get(String secureScoreName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoresList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoresList.java deleted file mode 100644 index 2426cf1eb559..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecureScoresList.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.resourcemanager.security.fluent.models.SecureScoreItemInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of secure scores. */ -@Immutable -public final class SecureScoresList { - /* - * Collection of secure scores in this page - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of SecureScoresList class. */ - public SecureScoresList() { - } - - /** - * Get the value property: Collection of secure scores in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} 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 deleted file mode 100644 index 601a6b0acd39..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessment.java +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataProperties; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Security assessment on a resource. */ -@Fluent -public final class SecurityAssessment extends ProxyResource { - /* - * Describes properties of an assessment. - */ - @JsonProperty(value = "properties") - private SecurityAssessmentProperties innerProperties; - - /** Creates an instance of SecurityAssessment class. */ - public SecurityAssessment() { - } - - /** - * Get the innerProperties property: Describes properties of an assessment. - * - * @return the innerProperties value. - */ - private SecurityAssessmentProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the status property: The result of the assessment. - * - * @return the status value. - */ - public AssessmentStatus status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Set the status property: The result of the assessment. - * - * @param status the status value to set. - * @return the SecurityAssessment object itself. - */ - public SecurityAssessment withStatus(AssessmentStatus status) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentProperties(); - } - this.innerProperties().withStatus(status); - return this; - } - - /** - * Get the resourceDetails property: Details of the resource that was assessed. - * - * @return the resourceDetails value. - */ - public ResourceDetails resourceDetails() { - return this.innerProperties() == null ? null : this.innerProperties().resourceDetails(); - } - - /** - * Set the resourceDetails property: Details of the resource that was assessed. - * - * @param resourceDetails the resourceDetails value to set. - * @return the SecurityAssessment object itself. - */ - public SecurityAssessment withResourceDetails(ResourceDetails resourceDetails) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentProperties(); - } - this.innerProperties().withResourceDetails(resourceDetails); - return this; - } - - /** - * Get the displayName property: User friendly display name of the assessment. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the additionalData property: Additional data regarding the assessment. - * - * @return the additionalData value. - */ - public Map additionalData() { - return this.innerProperties() == null ? null : this.innerProperties().additionalData(); - } - - /** - * Set the additionalData property: Additional data regarding the assessment. - * - * @param additionalData the additionalData value to set. - * @return the SecurityAssessment object itself. - */ - public SecurityAssessment withAdditionalData(Map additionalData) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentProperties(); - } - this.innerProperties().withAdditionalData(additionalData); - return this; - } - - /** - * Get the links property: Links relevant to the assessment. - * - * @return the links value. - */ - public AssessmentLinks links() { - return this.innerProperties() == null ? null : this.innerProperties().links(); - } - - /** - * Get the metadata property: Describes properties of an assessment metadata. - * - * @return the metadata value. - */ - public SecurityAssessmentMetadataProperties metadata() { - return this.innerProperties() == null ? null : this.innerProperties().metadata(); - } - - /** - * Set the metadata property: Describes properties of an assessment metadata. - * - * @param metadata the metadata value to set. - * @return the SecurityAssessment object itself. - */ - public SecurityAssessment withMetadata(SecurityAssessmentMetadataProperties metadata) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentProperties(); - } - this.innerProperties().withMetadata(metadata); - return this; - } - - /** - * Get the partnersData property: Data regarding 3rd party partner integration. - * - * @return the partnersData value. - */ - public SecurityAssessmentPartnerData partnersData() { - return this.innerProperties() == null ? null : this.innerProperties().partnersData(); - } - - /** - * Set the partnersData property: Data regarding 3rd party partner integration. - * - * @param partnersData the partnersData value to set. - * @return the SecurityAssessment object itself. - */ - public SecurityAssessment withPartnersData(SecurityAssessmentPartnerData partnersData) { - if (this.innerProperties() == null) { - this.innerProperties = new SecurityAssessmentProperties(); - } - this.innerProperties().withPartnersData(partnersData); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentList.java deleted file mode 100644 index da8191d8e6fe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentList.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.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Page of a security assessments list. */ -@Immutable -public final class SecurityAssessmentList { - /* - * Collection of security assessments in this page - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of SecurityAssessmentList class. */ - public SecurityAssessmentList() { - } - - /** - * Get the value property: Collection of security assessments in this page. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPartnerData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPartnerData.java deleted file mode 100644 index 27d9d4195c0e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPartnerData.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes the partner that created the assessment. */ -@Fluent -public final class SecurityAssessmentMetadataPartnerData { - /* - * Name of the company of the partner - */ - @JsonProperty(value = "partnerName", required = true) - private String partnerName; - - /* - * Name of the product of the partner that created the assessment - */ - @JsonProperty(value = "productName") - private String productName; - - /* - * Secret to authenticate the partner and verify it created the assessment - write only - */ - @JsonProperty(value = "secret", required = true) - private String secret; - - /** Creates an instance of SecurityAssessmentMetadataPartnerData class. */ - public SecurityAssessmentMetadataPartnerData() { - } - - /** - * Get the partnerName property: Name of the company of the partner. - * - * @return the partnerName value. - */ - public String partnerName() { - return this.partnerName; - } - - /** - * Set the partnerName property: Name of the company of the partner. - * - * @param partnerName the partnerName value to set. - * @return the SecurityAssessmentMetadataPartnerData object itself. - */ - public SecurityAssessmentMetadataPartnerData withPartnerName(String partnerName) { - this.partnerName = partnerName; - return this; - } - - /** - * Get the productName property: Name of the product of the partner that created the assessment. - * - * @return the productName value. - */ - public String productName() { - return this.productName; - } - - /** - * Set the productName property: Name of the product of the partner that created the assessment. - * - * @param productName the productName value to set. - * @return the SecurityAssessmentMetadataPartnerData object itself. - */ - public SecurityAssessmentMetadataPartnerData withProductName(String productName) { - this.productName = productName; - return this; - } - - /** - * Get the secret property: Secret to authenticate the partner and verify it created the assessment - write only. - * - * @return the secret value. - */ - public String secret() { - return this.secret; - } - - /** - * Set the secret property: Secret to authenticate the partner and verify it created the assessment - write only. - * - * @param secret the secret value to set. - * @return the SecurityAssessmentMetadataPartnerData object itself. - */ - public SecurityAssessmentMetadataPartnerData withSecret(String secret) { - this.secret = secret; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (partnerName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property partnerName in model SecurityAssessmentMetadataPartnerData")); - } - if (secret() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property secret in model SecurityAssessmentMetadataPartnerData")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityAssessmentMetadataPartnerData.class); -} 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 deleted file mode 100644 index 1120250758c6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataPropertiesResponsePublishDates.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SecurityAssessmentMetadataPropertiesResponsePublishDates model. */ -@Fluent -public final class SecurityAssessmentMetadataPropertiesResponsePublishDates { - /* - * The GA property. - */ - @JsonProperty(value = "GA") - private String ga; - - /* - * The public property. - */ - @JsonProperty(value = "public", required = true) - private String publicProperty; - - /** Creates an instance of SecurityAssessmentMetadataPropertiesResponsePublishDates class. */ - public SecurityAssessmentMetadataPropertiesResponsePublishDates() { - } - - /** - * 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")); - } - } - - private static final ClientLogger LOGGER = - new ClientLogger(SecurityAssessmentMetadataPropertiesResponsePublishDates.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponse.java deleted file mode 100644 index 51d514a7ddf3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponse.java +++ /dev/null @@ -1,373 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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.SecurityAssessmentMetadataResponseInner; -import java.util.List; - -/** An immutable client-side representation of SecurityAssessmentMetadataResponse. */ -public interface SecurityAssessmentMetadataResponse { - /** - * 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 publishDates property: The publishDates property. - * - * @return the publishDates value. - */ - SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates(); - - /** - * Gets the plannedDeprecationDate property: The plannedDeprecationDate property. - * - * @return the plannedDeprecationDate value. - */ - String plannedDeprecationDate(); - - /** - * Gets the tactics property: The tactics property. - * - * @return the tactics value. - */ - List tactics(); - - /** - * Gets the techniques property: The techniques property. - * - * @return the techniques value. - */ - List techniques(); - - /** - * Gets the displayName property: User friendly display name of the assessment. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the policyDefinitionId property: Azure resource ID of the policy definition that turns this assessment - * calculation on. - * - * @return the policyDefinitionId value. - */ - String policyDefinitionId(); - - /** - * Gets the description property: Human readable description of the assessment. - * - * @return the description value. - */ - String description(); - - /** - * Gets the remediationDescription property: Human readable description of what you should do to mitigate this - * security issue. - * - * @return the remediationDescription value. - */ - String remediationDescription(); - - /** - * Gets the categories property: The categories property. - * - * @return the categories value. - */ - List categories(); - - /** - * Gets the severity property: The severity level of the assessment. - * - * @return the severity value. - */ - Severity severity(); - - /** - * Gets the userImpact property: The user impact of the assessment. - * - * @return the userImpact value. - */ - UserImpact userImpact(); - - /** - * Gets the implementationEffort property: The implementation effort required to remediate this assessment. - * - * @return the implementationEffort value. - */ - ImplementationEffort implementationEffort(); - - /** - * Gets the threats property: The threats property. - * - * @return the threats value. - */ - List threats(); - - /** - * Gets the preview property: True if this assessment is in preview release status. - * - * @return the preview value. - */ - Boolean preview(); - - /** - * Gets the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy definition, Custom if - * the assessment based on custom Azure Policy definition. - * - * @return the assessmentType value. - */ - AssessmentType assessmentType(); - - /** - * Gets the partnerData property: Describes the partner that created the assessment. - * - * @return the partnerData value. - */ - SecurityAssessmentMetadataPartnerData partnerData(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner object. - * - * @return the inner object. - */ - SecurityAssessmentMetadataResponseInner innerModel(); - - /** The entirety of the SecurityAssessmentMetadataResponse definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - /** The SecurityAssessmentMetadataResponse definition stages. */ - interface DefinitionStages { - /** The first stage of the SecurityAssessmentMetadataResponse definition. */ - interface Blank extends WithCreate { - } - /** - * The stage of the SecurityAssessmentMetadataResponse definition which contains all the minimum required - * properties for the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithPublishDates, - DefinitionStages.WithPlannedDeprecationDate, - DefinitionStages.WithTactics, - DefinitionStages.WithTechniques, - DefinitionStages.WithDisplayName, - DefinitionStages.WithDescription, - DefinitionStages.WithRemediationDescription, - DefinitionStages.WithCategories, - DefinitionStages.WithSeverity, - DefinitionStages.WithUserImpact, - DefinitionStages.WithImplementationEffort, - DefinitionStages.WithThreats, - DefinitionStages.WithPreview, - DefinitionStages.WithAssessmentType, - DefinitionStages.WithPartnerData { - /** - * Executes the create request. - * - * @return the created resource. - */ - SecurityAssessmentMetadataResponse create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - SecurityAssessmentMetadataResponse create(Context context); - } - /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify publishDates. */ - interface WithPublishDates { - /** - * Specifies the publishDates property: The publishDates property.. - * - * @param publishDates The publishDates property. - * @return the next definition stage. - */ - WithCreate withPublishDates(SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates); - } - /** - * The stage of the SecurityAssessmentMetadataResponse definition allowing to specify plannedDeprecationDate. - */ - interface WithPlannedDeprecationDate { - /** - * Specifies the plannedDeprecationDate property: The plannedDeprecationDate property.. - * - * @param plannedDeprecationDate The plannedDeprecationDate property. - * @return the next definition stage. - */ - WithCreate withPlannedDeprecationDate(String plannedDeprecationDate); - } - /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify tactics. */ - interface WithTactics { - /** - * Specifies the tactics property: The tactics property.. - * - * @param tactics The tactics property. - * @return the next definition stage. - */ - WithCreate withTactics(List tactics); - } - /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify techniques. */ - interface WithTechniques { - /** - * Specifies the techniques property: The techniques property.. - * - * @param techniques The techniques property. - * @return the next definition stage. - */ - WithCreate withTechniques(List techniques); - } - /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify displayName. */ - interface WithDisplayName { - /** - * Specifies the displayName property: User friendly display name of the assessment. - * - * @param displayName User friendly display name of the assessment. - * @return the next definition stage. - */ - WithCreate withDisplayName(String displayName); - } - /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify description. */ - interface WithDescription { - /** - * Specifies the description property: Human readable description of the assessment. - * - * @param description Human readable description of the assessment. - * @return the next definition stage. - */ - WithCreate withDescription(String description); - } - /** - * 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 - * mitigate this security issue. - * - * @param remediationDescription Human readable description of what you should do to mitigate this security - * issue. - * @return the next definition stage. - */ - WithCreate withRemediationDescription(String remediationDescription); - } - /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify categories. */ - interface WithCategories { - /** - * Specifies the categories property: The categories property.. - * - * @param categories The categories property. - * @return the next definition stage. - */ - WithCreate withCategories(List categories); - } - /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify severity. */ - interface WithSeverity { - /** - * Specifies the severity property: The severity level of the assessment. - * - * @param severity The severity level of the assessment. - * @return the next definition stage. - */ - WithCreate withSeverity(Severity severity); - } - /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify userImpact. */ - interface WithUserImpact { - /** - * Specifies the userImpact property: The user impact of the assessment. - * - * @param userImpact The user impact of the assessment. - * @return the next definition stage. - */ - WithCreate withUserImpact(UserImpact userImpact); - } - /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify implementationEffort. */ - interface WithImplementationEffort { - /** - * Specifies the implementationEffort property: The implementation effort required to remediate this - * assessment. - * - * @param implementationEffort The implementation effort required to remediate this assessment. - * @return the next definition stage. - */ - WithCreate withImplementationEffort(ImplementationEffort implementationEffort); - } - /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify threats. */ - interface WithThreats { - /** - * Specifies the threats property: The threats property.. - * - * @param threats The threats property. - * @return the next definition stage. - */ - WithCreate withThreats(List threats); - } - /** 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. - * - * @param preview True if this assessment is in preview release status. - * @return the next definition stage. - */ - WithCreate withPreview(Boolean preview); - } - /** 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 - * definition, Custom if the assessment based on custom Azure Policy definition. - * - * @param assessmentType BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the - * assessment based on custom Azure Policy definition. - * @return the next definition stage. - */ - WithCreate withAssessmentType(AssessmentType assessmentType); - } - /** The stage of the SecurityAssessmentMetadataResponse definition allowing to specify partnerData. */ - interface WithPartnerData { - /** - * Specifies the partnerData property: Describes the partner that created the assessment. - * - * @param partnerData Describes the partner that created the assessment. - * @return the next definition stage. - */ - WithCreate withPartnerData(SecurityAssessmentMetadataPartnerData partnerData); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - SecurityAssessmentMetadataResponse refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - SecurityAssessmentMetadataResponse refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponseList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponseList.java deleted file mode 100644 index 775e521262aa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentMetadataResponseList.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.resourcemanager.security.fluent.models.SecurityAssessmentMetadataResponseInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of security assessment metadata. */ -@Immutable -public final class SecurityAssessmentMetadataResponseList { - /* - * The value property. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of SecurityAssessmentMetadataResponseList class. */ - public SecurityAssessmentMetadataResponseList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPartnerData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPartnerData.java deleted file mode 100644 index 4dce90e6516d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPartnerData.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.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Data regarding 3rd party partner integration. */ -@Fluent -public final class SecurityAssessmentPartnerData { - /* - * Name of the company of the partner - */ - @JsonProperty(value = "partnerName", required = true) - private String partnerName; - - /* - * secret to authenticate the partner - write only - */ - @JsonProperty(value = "secret", required = true) - private String secret; - - /** Creates an instance of SecurityAssessmentPartnerData class. */ - public SecurityAssessmentPartnerData() { - } - - /** - * Get the partnerName property: Name of the company of the partner. - * - * @return the partnerName value. - */ - public String partnerName() { - return this.partnerName; - } - - /** - * Set the partnerName property: Name of the company of the partner. - * - * @param partnerName the partnerName value to set. - * @return the SecurityAssessmentPartnerData object itself. - */ - public SecurityAssessmentPartnerData withPartnerName(String partnerName) { - this.partnerName = partnerName; - return this; - } - - /** - * Get the secret property: secret to authenticate the partner - write only. - * - * @return the secret value. - */ - public String secret() { - return this.secret; - } - - /** - * Set the secret property: secret to authenticate the partner - write only. - * - * @param secret the secret value to set. - * @return the SecurityAssessmentPartnerData object itself. - */ - public SecurityAssessmentPartnerData withSecret(String secret) { - this.secret = secret; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (partnerName() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property partnerName in model SecurityAssessmentPartnerData")); - } - if (secret() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property secret in model SecurityAssessmentPartnerData")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityAssessmentPartnerData.class); -} 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 deleted file mode 100644 index c595aa48c253..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentPropertiesBase.java +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataProperties; -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 { - /* - * 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; - - /** Creates an instance of SecurityAssessmentPropertiesBase class. */ - public SecurityAssessmentPropertiesBase() { - } - - /** - * 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(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityAssessmentPropertiesBase.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentResponse.java deleted file mode 100644 index 36403c276ed8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityAssessmentResponse.java +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentMetadataProperties; -import com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner; -import java.util.Map; - -/** An immutable client-side representation of SecurityAssessmentResponse. */ -public interface SecurityAssessmentResponse { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the status property: The result of the assessment. - * - * @return the status value. - */ - AssessmentStatusResponse status(); - - /** - * Gets the resourceDetails property: Details of the resource that was assessed. - * - * @return the resourceDetails value. - */ - ResourceDetails resourceDetails(); - - /** - * Gets the displayName property: User friendly display name of the assessment. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the additionalData property: Additional data regarding the assessment. - * - * @return the additionalData value. - */ - Map additionalData(); - - /** - * Gets the links property: Links relevant to the assessment. - * - * @return the links value. - */ - AssessmentLinks links(); - - /** - * Gets the metadata property: Describes properties of an assessment metadata. - * - * @return the metadata value. - */ - SecurityAssessmentMetadataProperties metadata(); - - /** - * Gets the partnersData property: Data regarding 3rd party partner integration. - * - * @return the partnersData value. - */ - SecurityAssessmentPartnerData partnersData(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner object. - * - * @return the inner object. - */ - SecurityAssessmentResponseInner innerModel(); - - /** The entirety of the SecurityAssessmentResponse definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { - } - /** The SecurityAssessmentResponse definition stages. */ - interface DefinitionStages { - /** The first stage of the SecurityAssessmentResponse definition. */ - interface Blank extends WithScope { - } - /** The stage of the SecurityAssessmentResponse definition allowing to specify parent resource. */ - interface WithScope { - /** - * Specifies resourceId. - * - * @param resourceId The identifier of the resource. - * @return the next definition stage. - */ - WithCreate withExistingResourceId(String resourceId); - } - /** - * The stage of the SecurityAssessmentResponse definition which contains all the minimum required properties for - * the resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithStatus, - DefinitionStages.WithResourceDetails, - DefinitionStages.WithAdditionalData, - DefinitionStages.WithMetadata, - DefinitionStages.WithPartnersData { - /** - * Executes the create request. - * - * @return the created resource. - */ - SecurityAssessmentResponse create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - SecurityAssessmentResponse create(Context context); - } - /** The stage of the SecurityAssessmentResponse definition allowing to specify status. */ - interface WithStatus { - /** - * Specifies the status property: The result of the assessment. - * - * @param status The result of the assessment. - * @return the next definition stage. - */ - WithCreate withStatus(AssessmentStatus status); - } - /** The stage of the SecurityAssessmentResponse definition allowing to specify resourceDetails. */ - interface WithResourceDetails { - /** - * Specifies the resourceDetails property: Details of the resource that was assessed. - * - * @param resourceDetails Details of the resource that was assessed. - * @return the next definition stage. - */ - WithCreate withResourceDetails(ResourceDetails resourceDetails); - } - /** The stage of the SecurityAssessmentResponse definition allowing to specify additionalData. */ - interface WithAdditionalData { - /** - * Specifies the additionalData property: Additional data regarding the assessment. - * - * @param additionalData Additional data regarding the assessment. - * @return the next definition stage. - */ - WithCreate withAdditionalData(Map additionalData); - } - /** The stage of the SecurityAssessmentResponse definition allowing to specify metadata. */ - interface WithMetadata { - /** - * Specifies the metadata property: Describes properties of an assessment metadata.. - * - * @param metadata Describes properties of an assessment metadata. - * @return the next definition stage. - */ - WithCreate withMetadata(SecurityAssessmentMetadataProperties metadata); - } - /** The stage of the SecurityAssessmentResponse definition allowing to specify partnersData. */ - interface WithPartnersData { - /** - * Specifies the partnersData property: Data regarding 3rd party partner integration. - * - * @param partnersData Data regarding 3rd party partner integration. - * @return the next definition stage. - */ - WithCreate withPartnersData(SecurityAssessmentPartnerData partnersData); - } - } - /** - * Begins update for the SecurityAssessmentResponse resource. - * - * @return the stage of resource update. - */ - SecurityAssessmentResponse.Update update(); - - /** The template for SecurityAssessmentResponse update. */ - interface Update - extends UpdateStages.WithStatus, - UpdateStages.WithResourceDetails, - UpdateStages.WithAdditionalData, - UpdateStages.WithMetadata, - UpdateStages.WithPartnersData { - /** - * Executes the update request. - * - * @return the updated resource. - */ - SecurityAssessmentResponse apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - SecurityAssessmentResponse apply(Context context); - } - /** The SecurityAssessmentResponse update stages. */ - interface UpdateStages { - /** The stage of the SecurityAssessmentResponse update allowing to specify status. */ - interface WithStatus { - /** - * Specifies the status property: The result of the assessment. - * - * @param status The result of the assessment. - * @return the next definition stage. - */ - Update withStatus(AssessmentStatus status); - } - /** The stage of the SecurityAssessmentResponse update allowing to specify resourceDetails. */ - interface WithResourceDetails { - /** - * Specifies the resourceDetails property: Details of the resource that was assessed. - * - * @param resourceDetails Details of the resource that was assessed. - * @return the next definition stage. - */ - Update withResourceDetails(ResourceDetails resourceDetails); - } - /** The stage of the SecurityAssessmentResponse update allowing to specify additionalData. */ - interface WithAdditionalData { - /** - * Specifies the additionalData property: Additional data regarding the assessment. - * - * @param additionalData Additional data regarding the assessment. - * @return the next definition stage. - */ - Update withAdditionalData(Map additionalData); - } - /** The stage of the SecurityAssessmentResponse update allowing to specify metadata. */ - interface WithMetadata { - /** - * Specifies the metadata property: Describes properties of an assessment metadata.. - * - * @param metadata Describes properties of an assessment metadata. - * @return the next definition stage. - */ - Update withMetadata(SecurityAssessmentMetadataProperties metadata); - } - /** The stage of the SecurityAssessmentResponse update allowing to specify partnersData. */ - interface WithPartnersData { - /** - * Specifies the partnersData property: Data regarding 3rd party partner integration. - * - * @param partnersData Data regarding 3rd party partner integration. - * @return the next definition stage. - */ - Update withPartnersData(SecurityAssessmentPartnerData partnersData); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - SecurityAssessmentResponse refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - SecurityAssessmentResponse refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnector.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnector.java deleted file mode 100644 index 4fa367db0af5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnector.java +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of SecurityConnector. */ -public interface SecurityConnector { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of AWS connector, - * project number in case of GCP connector). - * - * @return the hierarchyIdentifier value. - */ - String hierarchyIdentifier(); - - /** - * Gets the hierarchyIdentifierTrialEndDate property: The date on which the trial period will end, if applicable. - * Trial period exists for 30 days after upgrading to payed offerings. - * - * @return the hierarchyIdentifierTrialEndDate value. - */ - OffsetDateTime hierarchyIdentifierTrialEndDate(); - - /** - * Gets the environmentName property: The multi cloud resource's cloud name. - * - * @return the environmentName value. - */ - CloudName environmentName(); - - /** - * Gets the offerings property: A collection of offerings for the security connector. - * - * @return the offerings value. - */ - List offerings(); - - /** - * Gets the environmentData property: The security connector environment data. - * - * @return the environmentData value. - */ - EnvironmentData environmentData(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner object. - * - * @return the inner object. - */ - SecurityConnectorInner innerModel(); - - /** The entirety of the SecurityConnector definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { - } - /** The SecurityConnector definition stages. */ - interface DefinitionStages { - /** The first stage of the SecurityConnector definition. */ - interface Blank extends WithLocation { - } - /** The stage of the SecurityConnector definition allowing to specify location. */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(String location); - } - /** The stage of the SecurityConnector definition allowing to specify parent resource. */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @return the next definition stage. - */ - WithCreate withExistingResourceGroup(String resourceGroupName); - } - /** - * The stage of the SecurityConnector definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithHierarchyIdentifier, - DefinitionStages.WithEnvironmentName, - DefinitionStages.WithOfferings, - DefinitionStages.WithEnvironmentData { - /** - * Executes the create request. - * - * @return the created resource. - */ - SecurityConnector create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - SecurityConnector create(Context context); - } - /** The stage of the SecurityConnector definition allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - /** The stage of the SecurityConnector definition allowing to specify hierarchyIdentifier. */ - interface WithHierarchyIdentifier { - /** - * Specifies the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of - * AWS connector, project number in case of GCP connector).. - * - * @param hierarchyIdentifier The multi cloud resource identifier (account id in case of AWS connector, - * project number in case of GCP connector). - * @return the next definition stage. - */ - WithCreate withHierarchyIdentifier(String hierarchyIdentifier); - } - /** The stage of the SecurityConnector definition allowing to specify environmentName. */ - interface WithEnvironmentName { - /** - * Specifies the environmentName property: The multi cloud resource's cloud name.. - * - * @param environmentName The multi cloud resource's cloud name. - * @return the next definition stage. - */ - WithCreate withEnvironmentName(CloudName environmentName); - } - /** The stage of the SecurityConnector definition allowing to specify offerings. */ - interface WithOfferings { - /** - * Specifies the offerings property: A collection of offerings for the security connector.. - * - * @param offerings A collection of offerings for the security connector. - * @return the next definition stage. - */ - WithCreate withOfferings(List offerings); - } - /** The stage of the SecurityConnector definition allowing to specify environmentData. */ - interface WithEnvironmentData { - /** - * Specifies the environmentData property: The security connector environment data.. - * - * @param environmentData The security connector environment data. - * @return the next definition stage. - */ - WithCreate withEnvironmentData(EnvironmentData environmentData); - } - } - /** - * Begins update for the SecurityConnector resource. - * - * @return the stage of resource update. - */ - SecurityConnector.Update update(); - - /** The template for SecurityConnector update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithHierarchyIdentifier, - UpdateStages.WithEnvironmentName, - UpdateStages.WithOfferings, - UpdateStages.WithEnvironmentData { - /** - * Executes the update request. - * - * @return the updated resource. - */ - SecurityConnector apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - SecurityConnector apply(Context context); - } - /** The SecurityConnector update stages. */ - interface UpdateStages { - /** The stage of the SecurityConnector update allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - Update withTags(Map tags); - } - /** The stage of the SecurityConnector update allowing to specify hierarchyIdentifier. */ - interface WithHierarchyIdentifier { - /** - * Specifies the hierarchyIdentifier property: The multi cloud resource identifier (account id in case of - * AWS connector, project number in case of GCP connector).. - * - * @param hierarchyIdentifier The multi cloud resource identifier (account id in case of AWS connector, - * project number in case of GCP connector). - * @return the next definition stage. - */ - Update withHierarchyIdentifier(String hierarchyIdentifier); - } - /** The stage of the SecurityConnector update allowing to specify environmentName. */ - interface WithEnvironmentName { - /** - * Specifies the environmentName property: The multi cloud resource's cloud name.. - * - * @param environmentName The multi cloud resource's cloud name. - * @return the next definition stage. - */ - Update withEnvironmentName(CloudName environmentName); - } - /** The stage of the SecurityConnector update allowing to specify offerings. */ - interface WithOfferings { - /** - * Specifies the offerings property: A collection of offerings for the security connector.. - * - * @param offerings A collection of offerings for the security connector. - * @return the next definition stage. - */ - Update withOfferings(List offerings); - } - /** The stage of the SecurityConnector update allowing to specify environmentData. */ - interface WithEnvironmentData { - /** - * Specifies the environmentData property: The security connector environment data.. - * - * @param environmentData The security connector environment data. - * @return the next definition stage. - */ - Update withEnvironmentData(EnvironmentData environmentData); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - SecurityConnector refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - SecurityConnector refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorApplicationOperations.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorApplicationOperations.java deleted file mode 100644 index 82ae177d9032..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorApplicationOperations.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; - -/** Resource collection API of SecurityConnectorApplicationOperations. */ -public interface SecurityConnectorApplicationOperations { - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String securityConnectorName, String applicationId, Context context); - - /** - * Get a specific application for the requested scope by applicationId. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific application for the requested scope by applicationId. - */ - Application get(String resourceGroupName, String securityConnectorName, String applicationId); - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope along with {@link Response}. - */ - Response createOrUpdateWithResponse( - String resourceGroupName, - String securityConnectorName, - String applicationId, - ApplicationInner application, - Context context); - - /** - * Creates or update a security Application on the given security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param application Application over a subscription scope. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security Application over a given scope. - */ - Application createOrUpdate( - String resourceGroupName, String securityConnectorName, String applicationId, ApplicationInner application); - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse( - String resourceGroupName, String securityConnectorName, String applicationId, Context context); - - /** - * Delete an Application over a given scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param applicationId The security Application key - unique key for the standard application. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String securityConnectorName, String applicationId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorApplications.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorApplications.java deleted file mode 100644 index 8c79470dea54..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorApplications.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.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of SecurityConnectorApplications. */ -public interface SecurityConnectorApplications { - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName); - - /** - * Get a list of all relevant applications over a security connector level scope. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all relevant applications over a security connector level scope as paginated response with - * {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String securityConnectorName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectors.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectors.java deleted file mode 100644 index 771160d2616a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectors.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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 SecurityConnectors. */ -public interface SecurityConnectors { - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to - * get the next page of security connectors for the specified resource group. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security connectors response as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response}. - */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String securityConnectorName, Context context); - - /** - * Retrieves details of a specific security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource. - */ - SecurityConnector getByResourceGroup(String resourceGroupName, String securityConnectorName); - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByResourceGroupWithResponse( - String resourceGroupName, String securityConnectorName, Context context); - - /** - * Deletes a security connector. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param securityConnectorName The security connector name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String resourceGroupName, String securityConnectorName); - - /** - * Retrieves details of a specific security connector. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response}. - */ - SecurityConnector getById(String id); - - /** - * Retrieves details of a specific security connector. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the security connector resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes a security connector. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes a security connector. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new SecurityConnector resource. - * - * @param name resource name. - * @return the first stage of the new SecurityConnector definition. - */ - SecurityConnector.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorsList.java deleted file mode 100644 index 0ca9a3fac403..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityConnectorsList.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of security connectors response. */ -@Fluent -public final class SecurityConnectorsList { - /* - * The list of security connectors under the given scope. - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of SecurityConnectorsList class. */ - public SecurityConnectorsList() { - } - - /** - * Get the value property: The list of security connectors under the given scope. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The list of security connectors under the given scope. - * - * @param value the value value to set. - * @return the SecurityConnectorsList object itself. - */ - public SecurityConnectorsList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model SecurityConnectorsList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecurityConnectorsList.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContact.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContact.java deleted file mode 100644 index c27b37e64543..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContact.java +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; - -/** An immutable client-side representation of SecurityContact. */ -public interface SecurityContact { - /** - * 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 emails property: List of email addresses which will get notifications from Microsoft Defender for Cloud - * by the configurations defined in this security contact. - * - * @return the emails value. - */ - String emails(); - - /** - * Gets the phone property: The security contact's phone number. - * - * @return the phone value. - */ - String phone(); - - /** - * Gets the alertNotifications property: Defines whether to send email notifications about new security alerts. - * - * @return the alertNotifications value. - */ - SecurityContactPropertiesAlertNotifications alertNotifications(); - - /** - * Gets the notificationsByRole property: Defines whether to send email notifications from Microsoft Defender for - * Cloud to persons with specific RBAC roles on the subscription. - * - * @return the notificationsByRole value. - */ - SecurityContactPropertiesNotificationsByRole notificationsByRole(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityContactInner object. - * - * @return the inner object. - */ - SecurityContactInner innerModel(); - - /** The entirety of the SecurityContact definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - /** The SecurityContact definition stages. */ - interface DefinitionStages { - /** The first stage of the SecurityContact definition. */ - interface Blank extends WithCreate { - } - /** - * The stage of the SecurityContact definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithEmails, - DefinitionStages.WithPhone, - DefinitionStages.WithAlertNotifications, - DefinitionStages.WithNotificationsByRole { - /** - * Executes the create request. - * - * @return the created resource. - */ - SecurityContact create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - SecurityContact create(Context context); - } - /** The stage of the SecurityContact definition allowing to specify emails. */ - interface WithEmails { - /** - * Specifies the emails property: List of email addresses which will get notifications from Microsoft - * Defender for Cloud by the configurations defined in this security contact.. - * - * @param emails List of email addresses which will get notifications from Microsoft Defender for Cloud by - * the configurations defined in this security contact. - * @return the next definition stage. - */ - WithCreate withEmails(String emails); - } - /** The stage of the SecurityContact definition allowing to specify phone. */ - interface WithPhone { - /** - * Specifies the phone property: The security contact's phone number. - * - * @param phone The security contact's phone number. - * @return the next definition stage. - */ - WithCreate withPhone(String phone); - } - /** The stage of the SecurityContact definition allowing to specify alertNotifications. */ - interface WithAlertNotifications { - /** - * Specifies the alertNotifications property: Defines whether to send email notifications about new security - * alerts. - * - * @param alertNotifications Defines whether to send email notifications about new security alerts. - * @return the next definition stage. - */ - WithCreate withAlertNotifications(SecurityContactPropertiesAlertNotifications alertNotifications); - } - /** The stage of the SecurityContact definition allowing to specify notificationsByRole. */ - interface WithNotificationsByRole { - /** - * Specifies the notificationsByRole property: Defines whether to send email notifications from Microsoft - * Defender for Cloud to persons with specific RBAC roles on the subscription.. - * - * @param notificationsByRole Defines whether to send email notifications from Microsoft Defender for Cloud - * to persons with specific RBAC roles on the subscription. - * @return the next definition stage. - */ - WithCreate withNotificationsByRole(SecurityContactPropertiesNotificationsByRole notificationsByRole); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - SecurityContact refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - SecurityContact refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContactList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContactList.java deleted file mode 100644 index b7d66ee7637a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContactList.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.resourcemanager.security.fluent.models.SecurityContactInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of security contacts response. */ -@Immutable -public final class SecurityContactList { - /* - * List of security contacts - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of SecurityContactList class. */ - public SecurityContactList() { - } - - /** - * Get the value property: List of security contacts. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContactPropertiesAlertNotifications.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContactPropertiesAlertNotifications.java deleted file mode 100644 index 81db15aec4f7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContactPropertiesAlertNotifications.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Defines whether to send email notifications about new security alerts. */ -@Fluent -public final class SecurityContactPropertiesAlertNotifications { - /* - * Defines if email notifications will be sent about new security alerts - */ - @JsonProperty(value = "state") - private State state; - - /* - * Defines the minimal alert severity which will be sent as email notifications - */ - @JsonProperty(value = "minimalSeverity") - private MinimalSeverity minimalSeverity; - - /** Creates an instance of SecurityContactPropertiesAlertNotifications class. */ - public SecurityContactPropertiesAlertNotifications() { - } - - /** - * Get the state property: Defines if email notifications will be sent about new security alerts. - * - * @return the state value. - */ - public State state() { - return this.state; - } - - /** - * Set the state property: Defines if email notifications will be sent about new security alerts. - * - * @param state the state value to set. - * @return the SecurityContactPropertiesAlertNotifications object itself. - */ - public SecurityContactPropertiesAlertNotifications withState(State state) { - this.state = state; - return this; - } - - /** - * Get the minimalSeverity property: Defines the minimal alert severity which will be sent as email notifications. - * - * @return the minimalSeverity value. - */ - public MinimalSeverity minimalSeverity() { - return this.minimalSeverity; - } - - /** - * Set the minimalSeverity property: Defines the minimal alert severity which will be sent as email notifications. - * - * @param minimalSeverity the minimalSeverity value to set. - * @return the SecurityContactPropertiesAlertNotifications object itself. - */ - public SecurityContactPropertiesAlertNotifications withMinimalSeverity(MinimalSeverity minimalSeverity) { - this.minimalSeverity = minimalSeverity; - 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/SecurityContactPropertiesNotificationsByRole.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContactPropertiesNotificationsByRole.java deleted file mode 100644 index b545f132b6f5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContactPropertiesNotificationsByRole.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC roles on - * the subscription. - */ -@Fluent -public final class SecurityContactPropertiesNotificationsByRole { - /* - * Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC - * roles on the subscription. - */ - @JsonProperty(value = "state") - private State state; - - /* - * Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud. List of allowed RBAC - * roles: - */ - @JsonProperty(value = "roles") - private List roles; - - /** Creates an instance of SecurityContactPropertiesNotificationsByRole class. */ - public SecurityContactPropertiesNotificationsByRole() { - } - - /** - * Get the state property: Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons - * with specific RBAC roles on the subscription. - * - * @return the state value. - */ - public State state() { - return this.state; - } - - /** - * Set the state property: Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons - * with specific RBAC roles on the subscription. - * - * @param state the state value to set. - * @return the SecurityContactPropertiesNotificationsByRole object itself. - */ - public SecurityContactPropertiesNotificationsByRole withState(State state) { - this.state = state; - return this; - } - - /** - * Get the roles property: Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud. - * List of allowed RBAC roles:. - * - * @return the roles value. - */ - public List roles() { - return this.roles; - } - - /** - * Set the roles property: Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud. - * List of allowed RBAC roles:. - * - * @param roles the roles value to set. - * @return the SecurityContactPropertiesNotificationsByRole object itself. - */ - public SecurityContactPropertiesNotificationsByRole withRoles(List roles) { - this.roles = roles; - 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/SecurityContacts.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContacts.java deleted file mode 100644 index e1412d1a5675..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityContacts.java +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of SecurityContacts. */ -public interface SecurityContacts { - /** - * List all security contact configurations for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * List all security contact configurations for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security contacts response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription along with {@link Response}. - */ - Response getWithResponse(String securityContactName, Context context); - - /** - * Get Default Security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription. - */ - SecurityContact get(String securityContactName); - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String securityContactName, Context context); - - /** - * Delete security contact configurations for the subscription. - * - * @param securityContactName Name of the security contact object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String securityContactName); - - /** - * Get Default Security contact configurations for the subscription. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription along with {@link Response}. - */ - SecurityContact getById(String id); - - /** - * Get Default Security contact configurations for the subscription. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return default Security contact configurations for the subscription along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete security contact configurations for the subscription. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Delete security contact configurations for the subscription. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new SecurityContact resource. - * - * @param name resource name. - * @return the first stage of the new SecurityContact definition. - */ - SecurityContact.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityFamily.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityFamily.java deleted file mode 100644 index 2d7ae478887f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityFamily.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The security family of the discovered solution. */ -public final class SecurityFamily extends ExpandableStringEnum { - /** Static value Waf for SecurityFamily. */ - public static final SecurityFamily WAF = fromString("Waf"); - - /** Static value Ngfw for SecurityFamily. */ - public static final SecurityFamily NGFW = fromString("Ngfw"); - - /** Static value SaasWaf for SecurityFamily. */ - public static final SecurityFamily SAAS_WAF = fromString("SaasWaf"); - - /** Static value Va for SecurityFamily. */ - public static final SecurityFamily VA = fromString("Va"); - - /** - * Creates a new instance of SecurityFamily value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SecurityFamily() { - } - - /** - * Creates or finds a SecurityFamily from its string representation. - * - * @param name a name to look for. - * @return the corresponding SecurityFamily. - */ - @JsonCreator - public static SecurityFamily fromString(String name) { - return fromString(name, SecurityFamily.class); - } - - /** - * Gets known SecurityFamily values. - * - * @return known SecurityFamily values. - */ - public static Collection values() { - return values(SecurityFamily.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityOperator.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityOperator.java deleted file mode 100644 index 344eb52f9891..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityOperator.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.SecurityOperatorInner; - -/** An immutable client-side representation of SecurityOperator. */ -public interface SecurityOperator { - /** - * 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 identity property: Identity for the resource. - * - * @return the identity value. - */ - Identity identity(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner object. - * - * @return the inner object. - */ - SecurityOperatorInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityOperatorList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityOperatorList.java deleted file mode 100644 index 6eff74dba183..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityOperatorList.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.SecurityOperatorListInner; -import java.util.List; - -/** An immutable client-side representation of SecurityOperatorList. */ -public interface SecurityOperatorList { - /** - * Gets the value property: List of SecurityOperator configurations. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityOperatorListInner object. - * - * @return the inner object. - */ - SecurityOperatorListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityOperators.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityOperators.java deleted file mode 100644 index 3695ca0ca4f9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityOperators.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of SecurityOperators. */ -public interface SecurityOperators { - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response along with {@link Response}. - */ - Response listWithResponse(String pricingName, Context context); - - /** - * Lists Microsoft Defender for Cloud securityOperators in the subscription. - * - * @param pricingName name of the pricing configuration. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of SecurityOperator response. - */ - SecurityOperatorList list(String pricingName); - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope along with {@link Response}. - */ - Response getWithResponse(String pricingName, String securityOperatorName, Context context); - - /** - * Get a specific security operator for the requested scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific security operator for the requested scope. - */ - SecurityOperator get(String pricingName, String securityOperatorName); - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing along with {@link Response}. - */ - Response createOrUpdateWithResponse( - String pricingName, String securityOperatorName, Context context); - - /** - * Creates Microsoft Defender for Cloud security operator on the given scope. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security operator under a given subscription and pricing. - */ - SecurityOperator createOrUpdate(String pricingName, String securityOperatorName); - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByResourceGroupWithResponse(String pricingName, String securityOperatorName, Context context); - - /** - * Delete Microsoft Defender for Cloud securityOperator in the subscription. - * - * @param pricingName name of the pricing configuration. - * @param securityOperatorName name of the securityOperator. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteByResourceGroup(String pricingName, String securityOperatorName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolution.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolution.java deleted file mode 100644 index 01825c3be26b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolution.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.models; - -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner; - -/** An immutable client-side representation of SecuritySolution. */ -public interface SecuritySolution { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - - /** - * Gets the securityFamily property: The security family of the security solution. - * - * @return the securityFamily value. - */ - SecurityFamily securityFamily(); - - /** - * Gets the provisioningState property: The security family provisioning State. - * - * @return the provisioningState value. - */ - ProvisioningState provisioningState(); - - /** - * Gets the template property: The security solutions' template. - * - * @return the template value. - */ - String template(); - - /** - * Gets the protectionStatus property: The security solutions' status. - * - * @return the protectionStatus value. - */ - String protectionStatus(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner object. - * - * @return the inner object. - */ - SecuritySolutionInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionList.java deleted file mode 100644 index a5fc878523e7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionList.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The SecuritySolutionList model. */ -@Fluent -public final class SecuritySolutionList { - /* - * The value property. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of SecuritySolutionList class. */ - public SecuritySolutionList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the SecuritySolutionList object itself. - */ - public SecuritySolutionList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionStatus.java deleted file mode 100644 index 6b76d1d22d9a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionStatus.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Status of the IoT Security solution. */ -public final class SecuritySolutionStatus extends ExpandableStringEnum { - /** Static value Enabled for SecuritySolutionStatus. */ - public static final SecuritySolutionStatus ENABLED = fromString("Enabled"); - - /** Static value Disabled for SecuritySolutionStatus. */ - public static final SecuritySolutionStatus DISABLED = fromString("Disabled"); - - /** - * Creates a new instance of SecuritySolutionStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SecuritySolutionStatus() { - } - - /** - * Creates or finds a SecuritySolutionStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding SecuritySolutionStatus. - */ - @JsonCreator - public static SecuritySolutionStatus fromString(String name) { - return fromString(name, SecuritySolutionStatus.class); - } - - /** - * Gets known SecuritySolutionStatus values. - * - * @return known SecuritySolutionStatus values. - */ - public static Collection values() { - return values(SecuritySolutionStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutions.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutions.java deleted file mode 100644 index 12e3cc8370d2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutions.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of SecuritySolutions. */ -public interface SecuritySolutions { - /** - * Gets a list of Security Solutions for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Gets a list of Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Security Solutions for the subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Security Solution along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String ascLocation, String securitySolutionName, Context context); - - /** - * Gets a specific Security Solution. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param securitySolutionName Name of security solution. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific Security Solution. - */ - SecuritySolution get(String resourceGroupName, String ascLocation, String securitySolutionName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceData.java deleted file mode 100644 index 5eb1d385e607..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceData.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataProperties; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The SecuritySolutionsReferenceData model. */ -@Fluent -public final class SecuritySolutionsReferenceData extends ProxyResource { - /* - * The properties property. - */ - @JsonProperty(value = "properties", required = true) - private SecuritySolutionsReferenceDataProperties innerProperties = new SecuritySolutionsReferenceDataProperties(); - - /* - * Location where the resource is stored - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /** Creates an instance of SecuritySolutionsReferenceData class. */ - public SecuritySolutionsReferenceData() { - } - - /** - * Get the innerProperties property: The properties property. - * - * @return the innerProperties value. - */ - private SecuritySolutionsReferenceDataProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the securityFamily property: The security family of the security solution. - * - * @return the securityFamily value. - */ - public SecurityFamily securityFamily() { - return this.innerProperties() == null ? null : this.innerProperties().securityFamily(); - } - - /** - * Set the securityFamily property: The security family of the security solution. - * - * @param securityFamily the securityFamily value to set. - * @return the SecuritySolutionsReferenceData object itself. - */ - public SecuritySolutionsReferenceData withSecurityFamily(SecurityFamily securityFamily) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySolutionsReferenceDataProperties(); - } - this.innerProperties().withSecurityFamily(securityFamily); - return this; - } - - /** - * Get the alertVendorName property: The security solutions' vendor name. - * - * @return the alertVendorName value. - */ - public String alertVendorName() { - return this.innerProperties() == null ? null : this.innerProperties().alertVendorName(); - } - - /** - * Set the alertVendorName property: The security solutions' vendor name. - * - * @param alertVendorName the alertVendorName value to set. - * @return the SecuritySolutionsReferenceData object itself. - */ - public SecuritySolutionsReferenceData withAlertVendorName(String alertVendorName) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySolutionsReferenceDataProperties(); - } - this.innerProperties().withAlertVendorName(alertVendorName); - return this; - } - - /** - * Get the packageInfoUrl property: The security solutions' package info url. - * - * @return the packageInfoUrl value. - */ - public String packageInfoUrl() { - return this.innerProperties() == null ? null : this.innerProperties().packageInfoUrl(); - } - - /** - * Set the packageInfoUrl property: The security solutions' package info url. - * - * @param packageInfoUrl the packageInfoUrl value to set. - * @return the SecuritySolutionsReferenceData object itself. - */ - public SecuritySolutionsReferenceData withPackageInfoUrl(String packageInfoUrl) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySolutionsReferenceDataProperties(); - } - this.innerProperties().withPackageInfoUrl(packageInfoUrl); - return this; - } - - /** - * Get the productName property: The security solutions' product name. - * - * @return the productName value. - */ - public String productName() { - return this.innerProperties() == null ? null : this.innerProperties().productName(); - } - - /** - * Set the productName property: The security solutions' product name. - * - * @param productName the productName value to set. - * @return the SecuritySolutionsReferenceData object itself. - */ - public SecuritySolutionsReferenceData withProductName(String productName) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySolutionsReferenceDataProperties(); - } - this.innerProperties().withProductName(productName); - return this; - } - - /** - * Get the publisher property: The security solutions' publisher. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Set the publisher property: The security solutions' publisher. - * - * @param publisher the publisher value to set. - * @return the SecuritySolutionsReferenceData object itself. - */ - public SecuritySolutionsReferenceData withPublisher(String publisher) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySolutionsReferenceDataProperties(); - } - this.innerProperties().withPublisher(publisher); - return this; - } - - /** - * Get the publisherDisplayName property: The security solutions' publisher display name. - * - * @return the publisherDisplayName value. - */ - public String publisherDisplayName() { - return this.innerProperties() == null ? null : this.innerProperties().publisherDisplayName(); - } - - /** - * Set the publisherDisplayName property: The security solutions' publisher display name. - * - * @param publisherDisplayName the publisherDisplayName value to set. - * @return the SecuritySolutionsReferenceData object itself. - */ - public SecuritySolutionsReferenceData withPublisherDisplayName(String publisherDisplayName) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySolutionsReferenceDataProperties(); - } - this.innerProperties().withPublisherDisplayName(publisherDisplayName); - return this; - } - - /** - * Get the template property: The security solutions' template. - * - * @return the template value. - */ - public String template() { - return this.innerProperties() == null ? null : this.innerProperties().template(); - } - - /** - * Set the template property: The security solutions' template. - * - * @param template the template value to set. - * @return the SecuritySolutionsReferenceData object itself. - */ - public SecuritySolutionsReferenceData withTemplate(String template) { - if (this.innerProperties() == null) { - this.innerProperties = new SecuritySolutionsReferenceDataProperties(); - } - this.innerProperties().withTemplate(template); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model SecuritySolutionsReferenceData")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SecuritySolutionsReferenceData.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceDataList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceDataList.java deleted file mode 100644 index bc0da29b13c6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceDataList.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.SecuritySolutionsReferenceDataListInner; -import java.util.List; - -/** An immutable client-side representation of SecuritySolutionsReferenceDataList. */ -public interface SecuritySolutionsReferenceDataList { - /** - * Gets the value property: The value property. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataListInner object. - * - * @return the inner object. - */ - SecuritySolutionsReferenceDataListInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceDatas.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceDatas.java deleted file mode 100644 index bbd7275d6411..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySolutionsReferenceDatas.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of SecuritySolutionsReferenceDatas. */ -public interface SecuritySolutionsReferenceDatas { - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription along with {@link Response}. - */ - Response listWithResponse(Context context); - - /** - * Gets a list of all supported Security Solutions for the subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of all supported Security Solutions for the subscription. - */ - SecuritySolutionsReferenceDataList list(); - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location along with {@link Response}. - */ - Response listByHomeRegionWithResponse(String ascLocation, Context context); - - /** - * Gets list of all supported Security Solutions for subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of all supported Security Solutions for subscription and location. - */ - SecuritySolutionsReferenceDataList listByHomeRegion(String ascLocation); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySubAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySubAssessment.java deleted file mode 100644 index d76b91acfed1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySubAssessment.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of SecuritySubAssessment. */ -public interface SecuritySubAssessment { - /** - * 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 idPropertiesId property: Vulnerability ID. - * - * @return the idPropertiesId value. - */ - String idPropertiesId(); - - /** - * Gets the displayName property: User friendly display name of the sub-assessment. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the status property: Status of the sub-assessment. - * - * @return the status value. - */ - SubAssessmentStatus status(); - - /** - * Gets the remediation property: Information on how to remediate this sub-assessment. - * - * @return the remediation value. - */ - String remediation(); - - /** - * Gets the impact property: Description of the impact of this sub-assessment. - * - * @return the impact value. - */ - String impact(); - - /** - * Gets the category property: Category of the sub-assessment. - * - * @return the category value. - */ - String category(); - - /** - * Gets the description property: Human readable description of the assessment status. - * - * @return the description value. - */ - String description(); - - /** - * Gets the timeGenerated property: The date and time the sub-assessment was generated. - * - * @return the timeGenerated value. - */ - OffsetDateTime timeGenerated(); - - /** - * Gets the resourceDetails property: Details of the resource that was assessed. - * - * @return the resourceDetails value. - */ - ResourceDetails resourceDetails(); - - /** - * Gets the additionalData property: Details of the sub-assessment. - * - * @return the additionalData value. - */ - AdditionalData additionalData(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner object. - * - * @return the inner object. - */ - SecuritySubAssessmentInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySubAssessmentList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySubAssessmentList.java deleted file mode 100644 index a2d68d4562fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecuritySubAssessmentList.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.resourcemanager.security.fluent.models.SecuritySubAssessmentInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of security sub-assessments. */ -@Immutable -public final class SecuritySubAssessmentList { - /* - * The value property. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of SecuritySubAssessmentList class. */ - public SecuritySubAssessmentList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityTask.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityTask.java deleted file mode 100644 index 48c8ca3e14be..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityTask.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.resourcemanager.security.fluent.models.SecurityTaskInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of SecurityTask. */ -public interface SecurityTask { - /** - * 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 state property: State of the task (Active, Resolved etc.). - * - * @return the state value. - */ - String state(); - - /** - * Gets the creationTimeUtc property: The time this task was discovered in UTC. - * - * @return the creationTimeUtc value. - */ - OffsetDateTime creationTimeUtc(); - - /** - * Gets the securityTaskParameters property: Changing set of properties, depending on the task type that is derived - * from the name field. - * - * @return the securityTaskParameters value. - */ - SecurityTaskParameters securityTaskParameters(); - - /** - * Gets the lastStateChangeTimeUtc property: The time this task's details were last changed in UTC. - * - * @return the lastStateChangeTimeUtc value. - */ - OffsetDateTime lastStateChangeTimeUtc(); - - /** - * Gets the subState property: Additional data on the state of the task. - * - * @return the subState value. - */ - String subState(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SecurityTaskInner object. - * - * @return the inner object. - */ - SecurityTaskInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityTaskList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityTaskList.java deleted file mode 100644 index e48a857aa698..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityTaskList.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.resourcemanager.security.fluent.models.SecurityTaskInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of security task recommendations. */ -@Immutable -public final class SecurityTaskList { - /* - * The value property. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of SecurityTaskList class. */ - public SecurityTaskList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityTaskParameters.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityTaskParameters.java deleted file mode 100644 index 3ae19b040301..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SecurityTaskParameters.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.HashMap; -import java.util.Map; - -/** Changing set of properties, depending on the task type that is derived from the name field. */ -@Fluent -public final class SecurityTaskParameters { - /* - * Name of the task type - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Changing set of properties, depending on the task type that is derived from the name field - */ - @JsonIgnore private Map additionalProperties; - - /** Creates an instance of SecurityTaskParameters class. */ - public SecurityTaskParameters() { - } - - /** - * Get the name property: Name of the task type. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the additionalProperties property: Changing set of properties, depending on the task type that is derived - * from the name field. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Changing set of properties, depending on the task type that is derived - * from the name field. - * - * @param additionalProperties the additionalProperties value to set. - * @return the SecurityTaskParameters object itself. - */ - public SecurityTaskParameters withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensitivityLabel.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensitivityLabel.java deleted file mode 100644 index c7ef875b8766..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SensitivityLabel.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** The sensitivity label. */ -@Fluent -public final class SensitivityLabel { - /* - * The name of the sensitivity label. - */ - @JsonProperty(value = "displayName") - private String displayName; - - /* - * The description of the sensitivity label. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The rank of the sensitivity label. - */ - @JsonProperty(value = "rank") - private Rank rank; - - /* - * The order of the sensitivity label. - */ - @JsonProperty(value = "order") - private Integer order; - - /* - * Indicates whether the label is enabled or not. - */ - @JsonProperty(value = "enabled") - private Boolean enabled; - - /** Creates an instance of SensitivityLabel class. */ - public SensitivityLabel() { - } - - /** - * Get the displayName property: The name of the sensitivity label. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Set the displayName property: The name of the sensitivity label. - * - * @param displayName the displayName value to set. - * @return the SensitivityLabel object itself. - */ - public SensitivityLabel withDisplayName(String displayName) { - this.displayName = displayName; - return this; - } - - /** - * Get the description property: The description of the sensitivity label. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The description of the sensitivity label. - * - * @param description the description value to set. - * @return the SensitivityLabel object itself. - */ - public SensitivityLabel withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the rank property: The rank of the sensitivity label. - * - * @return the rank value. - */ - public Rank rank() { - return this.rank; - } - - /** - * Set the rank property: The rank of the sensitivity label. - * - * @param rank the rank value to set. - * @return the SensitivityLabel object itself. - */ - public SensitivityLabel withRank(Rank rank) { - this.rank = rank; - return this; - } - - /** - * Get the order property: The order of the sensitivity label. - * - * @return the order value. - */ - public Integer order() { - return this.order; - } - - /** - * Set the order property: The order of the sensitivity label. - * - * @param order the order value to set. - * @return the SensitivityLabel object itself. - */ - public SensitivityLabel withOrder(Integer order) { - this.order = order; - return this; - } - - /** - * Get the enabled property: Indicates whether the label is enabled or not. - * - * @return the enabled value. - */ - public Boolean enabled() { - return this.enabled; - } - - /** - * Set the enabled property: Indicates whether the label is enabled or not. - * - * @param enabled the enabled value to set. - * @return the SensitivityLabel object itself. - */ - public SensitivityLabel withEnabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessment.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessment.java deleted file mode 100644 index 56fd354690ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessment.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.ServerVulnerabilityAssessmentInner; - -/** An immutable client-side representation of ServerVulnerabilityAssessment. */ -public interface ServerVulnerabilityAssessment { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the provisioningState property: The provisioningState of the vulnerability assessment capability on the VM. - * - * @return the provisioningState value. - */ - ServerVulnerabilityAssessmentPropertiesProvisioningState provisioningState(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner object. - * - * @return the inner object. - */ - ServerVulnerabilityAssessmentInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentPropertiesProvisioningState.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentPropertiesProvisioningState.java deleted file mode 100644 index 68c331b4dfd6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentPropertiesProvisioningState.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The provisioningState of the vulnerability assessment capability on the VM. */ -public final class ServerVulnerabilityAssessmentPropertiesProvisioningState - extends ExpandableStringEnum { - /** Static value Succeeded for ServerVulnerabilityAssessmentPropertiesProvisioningState. */ - public static final ServerVulnerabilityAssessmentPropertiesProvisioningState SUCCEEDED = fromString("Succeeded"); - - /** Static value Failed for ServerVulnerabilityAssessmentPropertiesProvisioningState. */ - public static final ServerVulnerabilityAssessmentPropertiesProvisioningState FAILED = fromString("Failed"); - - /** Static value Canceled for ServerVulnerabilityAssessmentPropertiesProvisioningState. */ - public static final ServerVulnerabilityAssessmentPropertiesProvisioningState CANCELED = fromString("Canceled"); - - /** Static value Provisioning for ServerVulnerabilityAssessmentPropertiesProvisioningState. */ - public static final ServerVulnerabilityAssessmentPropertiesProvisioningState PROVISIONING = - fromString("Provisioning"); - - /** Static value Deprovisioning for ServerVulnerabilityAssessmentPropertiesProvisioningState. */ - public static final ServerVulnerabilityAssessmentPropertiesProvisioningState DEPROVISIONING = - fromString("Deprovisioning"); - - /** - * Creates a new instance of ServerVulnerabilityAssessmentPropertiesProvisioningState value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ServerVulnerabilityAssessmentPropertiesProvisioningState() { - } - - /** - * Creates or finds a ServerVulnerabilityAssessmentPropertiesProvisioningState from its string representation. - * - * @param name a name to look for. - * @return the corresponding ServerVulnerabilityAssessmentPropertiesProvisioningState. - */ - @JsonCreator - public static ServerVulnerabilityAssessmentPropertiesProvisioningState fromString(String name) { - return fromString(name, ServerVulnerabilityAssessmentPropertiesProvisioningState.class); - } - - /** - * Gets known ServerVulnerabilityAssessmentPropertiesProvisioningState values. - * - * @return known ServerVulnerabilityAssessmentPropertiesProvisioningState values. - */ - public static Collection values() { - return values(ServerVulnerabilityAssessmentPropertiesProvisioningState.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessments.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessments.java deleted file mode 100644 index e6d69d38502b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessments.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of ServerVulnerabilityAssessments. */ -public interface ServerVulnerabilityAssessments { - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server vulnerability assessment onboarding statuses on a given resource along with {@link - * Response}. - */ - Response listByExtendedResourceWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); - - /** - * Gets a list of server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of server vulnerability assessment onboarding statuses on a given resource. - */ - ServerVulnerabilityAssessmentsList listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server vulnerability assessment onboarding statuses on a given resource along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); - - /** - * Gets a server vulnerability assessment onboarding statuses on a given resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a server vulnerability assessment onboarding statuses on a given resource. - */ - ServerVulnerabilityAssessment get( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the server vulnerability assessment details on a resource along with {@link Response}. - */ - Response createOrUpdateWithResponse( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); - - /** - * Creating a server vulnerability assessment on a resource, which will onboard a resource for having a - * vulnerability assessment on it. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return describes the server vulnerability assessment details on a resource. - */ - ServerVulnerabilityAssessment createOrUpdate( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); - - /** - * Removing server vulnerability assessment from a resource. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The Namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsList.java deleted file mode 100644 index 353e2bc0441c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityAssessmentsList.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.ServerVulnerabilityAssessmentsListInner; -import java.util.List; - -/** An immutable client-side representation of ServerVulnerabilityAssessmentsList. */ -public interface ServerVulnerabilityAssessmentsList { - /** - * Gets the value property: The value property. - * - * @return the value value. - */ - List value(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsListInner object. - * - * @return the inner object. - */ - ServerVulnerabilityAssessmentsListInner innerModel(); -} 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 deleted file mode 100644 index c7de7567c627..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServerVulnerabilityProperties.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.Map; - -/** Additional context fields for server vulnerability assessment. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "assessedResourceType") -@JsonTypeName("ServerVulnerabilityAssessment") -@Immutable -public final class ServerVulnerabilityProperties extends AdditionalData { - /* - * Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * 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; - - /* - * Indicates whether a patch is available or not - */ - @JsonProperty(value = "patchable", access = JsonProperty.Access.WRITE_ONLY) - private Boolean patchable; - - /* - * List of CVEs - */ - @JsonProperty(value = "cve", access = JsonProperty.Access.WRITE_ONLY) - private List cve; - - /* - * Threat name - */ - @JsonProperty(value = "threat", access = JsonProperty.Access.WRITE_ONLY) - private String threat; - - /* - * Published time - */ - @JsonProperty(value = "publishedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime publishedTime; - - /* - * The vendorReferences property. - */ - @JsonProperty(value = "vendorReferences", access = JsonProperty.Access.WRITE_ONLY) - private List vendorReferences; - - /** Creates an instance of ServerVulnerabilityProperties class. */ - public ServerVulnerabilityProperties() { - } - - /** - * Get the type property: Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the cvss property: Dictionary from cvss version to cvss details object. - * - * @return the cvss value. - */ - public Map cvss() { - return this.cvss; - } - - /** - * Get the patchable property: Indicates whether a patch is available or not. - * - * @return the patchable value. - */ - public Boolean patchable() { - return this.patchable; - } - - /** - * Get the cve property: List of CVEs. - * - * @return the cve value. - */ - public List cve() { - return this.cve; - } - - /** - * Get the threat property: Threat name. - * - * @return the threat value. - */ - public String threat() { - return this.threat; - } - - /** - * Get the publishedTime property: Published time. - * - * @return the publishedTime value. - */ - public OffsetDateTime publishedTime() { - return this.publishedTime; - } - - /** - * Get the vendorReferences property: The vendorReferences property. - * - * @return the vendorReferences value. - */ - public List vendorReferences() { - return this.vendorReferences; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (cvss() != null) { - cvss() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - if (cve() != null) { - cve().forEach(e -> e.validate()); - } - if (vendorReferences() != null) { - vendorReferences().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServicePrincipalProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServicePrincipalProperties.java deleted file mode 100644 index ac8e8dae079f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ServicePrincipalProperties.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.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Details of the service principal. */ -@Fluent -public final class ServicePrincipalProperties { - /* - * Application ID of service principal. - */ - @JsonProperty(value = "applicationId") - private String applicationId; - - /* - * A secret string that the application uses to prove its identity, also can be referred to as application password - * (write only). - */ - @JsonProperty(value = "secret") - private String secret; - - /** Creates an instance of ServicePrincipalProperties class. */ - public ServicePrincipalProperties() { - } - - /** - * Get the applicationId property: Application ID of service principal. - * - * @return the applicationId value. - */ - public String applicationId() { - return this.applicationId; - } - - /** - * Set the applicationId property: Application ID of service principal. - * - * @param applicationId the applicationId value to set. - * @return the ServicePrincipalProperties object itself. - */ - public ServicePrincipalProperties withApplicationId(String applicationId) { - this.applicationId = applicationId; - return this; - } - - /** - * Get the secret property: A secret string that the application uses to prove its identity, also can be referred to - * as application password (write only). - * - * @return the secret value. - */ - public String secret() { - return this.secret; - } - - /** - * Set the secret property: A secret string that the application uses to prove its identity, also can be referred to - * as application password (write only). - * - * @param secret the secret value to set. - * @return the ServicePrincipalProperties object itself. - */ - public ServicePrincipalProperties withSecret(String secret) { - this.secret = secret; - 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/Setting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Setting.java deleted file mode 100644 index ea3ec718e969..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Setting.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.resourcemanager.security.fluent.models.SettingInner; - -/** An immutable client-side representation of Setting. */ -public interface Setting { - /** - * 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 inner com.azure.resourcemanager.security.fluent.models.SettingInner object. - * - * @return the inner object. - */ - SettingInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingKind.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingKind.java deleted file mode 100644 index ca8238847fcc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingKind.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** the kind of the settings string. */ -public final class SettingKind extends ExpandableStringEnum { - /** Static value DataExportSettings for SettingKind. */ - public static final SettingKind DATA_EXPORT_SETTINGS = fromString("DataExportSettings"); - - /** Static value AlertSuppressionSetting for SettingKind. */ - public static final SettingKind ALERT_SUPPRESSION_SETTING = fromString("AlertSuppressionSetting"); - - /** Static value AlertSyncSettings for SettingKind. */ - public static final SettingKind ALERT_SYNC_SETTINGS = fromString("AlertSyncSettings"); - - /** - * Creates a new instance of SettingKind value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SettingKind() { - } - - /** - * Creates or finds a SettingKind from its string representation. - * - * @param name a name to look for. - * @return the corresponding SettingKind. - */ - @JsonCreator - public static SettingKind fromString(String name) { - return fromString(name, SettingKind.class); - } - - /** - * Gets known SettingKind values. - * - * @return known SettingKind values. - */ - public static Collection values() { - return values(SettingKind.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingName.java deleted file mode 100644 index c07d20eb13b2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingName.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for SettingName. */ -public final class SettingName extends ExpandableStringEnum { - /** Static value MCAS for SettingName. */ - public static final SettingName MCAS = fromString("MCAS"); - - /** Static value WDATP for SettingName. */ - public static final SettingName WDATP = fromString("WDATP"); - - /** Static value WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW for SettingName. */ - public static final SettingName WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW = - fromString("WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW"); - - /** Static value WDATP_UNIFIED_SOLUTION for SettingName. */ - public static final SettingName WDATP_UNIFIED_SOLUTION = fromString("WDATP_UNIFIED_SOLUTION"); - - /** Static value Sentinel for SettingName. */ - public static final SettingName SENTINEL = fromString("Sentinel"); - - /** - * Creates a new instance of SettingName value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SettingName() { - } - - /** - * Creates or finds a SettingName from its string representation. - * - * @param name a name to look for. - * @return the corresponding SettingName. - */ - @JsonCreator - public static SettingName fromString(String name) { - return fromString(name, SettingName.class); - } - - /** - * Gets known SettingName values. - * - * @return known SettingName values. - */ - public static Collection values() { - return values(SettingName.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Settings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Settings.java deleted file mode 100644 index 07a2899484ce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Settings.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.SettingInner; - -/** Resource collection API of Settings. */ -public interface Settings { - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription settings list as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Settings about different configurations in Microsoft Defender for Cloud. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return subscription settings list as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response}. - */ - Response getWithResponse(SettingName settingName, Context context); - - /** - * Settings of different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting. - */ - Setting get(SettingName settingName); - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting along with {@link Response}. - */ - Response updateWithResponse(SettingName settingName, SettingInner setting, Context context); - - /** - * updating settings about different configurations in Microsoft Defender for Cloud. - * - * @param settingName The name of the setting. - * @param setting Setting object. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the kind of the security setting. - */ - Setting update(SettingName settingName, SettingInner setting); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingsList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingsList.java deleted file mode 100644 index 2eed3069385b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SettingsList.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Subscription settings list. */ -@Fluent -public final class SettingsList { - /* - * The settings list. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of SettingsList class. */ - public SettingsList() { - } - - /** - * Get the value property: The settings list. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The settings list. - * - * @param value the value value to set. - * @return the SettingsList object itself. - */ - public SettingsList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Severity.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Severity.java deleted file mode 100644 index e7453a10d1b8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Severity.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The sub-assessment severity level. */ -public final class Severity extends ExpandableStringEnum { - /** Static value Low for Severity. */ - public static final Severity LOW = fromString("Low"); - - /** Static value Medium for Severity. */ - public static final Severity MEDIUM = fromString("Medium"); - - /** Static value High for Severity. */ - public static final Severity HIGH = fromString("High"); - - /** - * Creates a new instance of Severity value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Severity() { - } - - /** - * Creates or finds a Severity from its string representation. - * - * @param name a name to look for. - * @return the corresponding Severity. - */ - @JsonCreator - public static Severity fromString(String name) { - return fromString(name, Severity.class); - } - - /** - * Gets known Severity values. - * - * @return known Severity values. - */ - public static Collection values() { - return values(Severity.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SeverityEnum.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SeverityEnum.java deleted file mode 100644 index 2202ed856bf5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SeverityEnum.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The severity to relate to the assessments generated by this assessment automation. */ -public final class SeverityEnum 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 a new instance of SeverityEnum value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SeverityEnum() { - } - - /** - * 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); - } - - /** - * Gets known SeverityEnum values. - * - * @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/Software.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Software.java deleted file mode 100644 index 9ff0d12a0d2a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Software.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.resourcemanager.security.fluent.models.SoftwareInner; - -/** An immutable client-side representation of Software. */ -public interface Software { - /** - * 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: Unique identifier for the virtual machine in the service. - * - * @return the deviceId value. - */ - String deviceId(); - - /** - * Gets the osPlatform property: Platform of the operating system running on the device. - * - * @return the osPlatform value. - */ - String osPlatform(); - - /** - * Gets the vendor property: Name of the software vendor. - * - * @return the vendor value. - */ - String vendor(); - - /** - * Gets the softwareName property: Name of the software product. - * - * @return the softwareName value. - */ - String softwareName(); - - /** - * Gets the version property: Version number of the software product. - * - * @return the version value. - */ - String version(); - - /** - * Gets the endOfSupportStatus property: End of support status. - * - * @return the endOfSupportStatus value. - */ - EndOfSupportStatus endOfSupportStatus(); - - /** - * Gets the endOfSupportDate property: The end of support date in case the product is upcoming end of support. - * - * @return the endOfSupportDate value. - */ - String endOfSupportDate(); - - /** - * Gets the numberOfKnownVulnerabilities property: Number of weaknesses. - * - * @return the numberOfKnownVulnerabilities value. - */ - Integer numberOfKnownVulnerabilities(); - - /** - * Gets the firstSeenAt property: First time that the software was seen in the device. - * - * @return the firstSeenAt value. - */ - String firstSeenAt(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.SoftwareInner object. - * - * @return the inner object. - */ - SoftwareInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SoftwareInventories.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SoftwareInventories.java deleted file mode 100644 index 39ef49cfcca1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SoftwareInventories.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of SoftwareInventories. */ -public interface SoftwareInventories { - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of the virtual machine as paginated response with {@link PagedIterable}. - */ - PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName); - - /** - * Gets the software inventory of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of the virtual machine as paginated response with {@link PagedIterable}. - */ - PagedIterable listByExtendedResource( - String resourceGroupName, String resourceNamespace, String resourceType, String resourceName, Context context); - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(); - - /** - * Gets the software inventory of all virtual machines in the subscriptions. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the software inventory of all virtual machines in the subscriptions as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single software data of the virtual machine along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName, - Context context); - - /** - * Gets a single software data of the virtual machine. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param resourceNamespace The namespace of the resource. - * @param resourceType The type of the resource. - * @param resourceName Name of the resource. - * @param softwareName Name of the installed software. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single software data of the virtual machine. - */ - Software get( - String resourceGroupName, - String resourceNamespace, - String resourceType, - String resourceName, - String softwareName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SoftwaresList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SoftwaresList.java deleted file mode 100644 index 8e5cfbd0350f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SoftwaresList.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.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.SoftwareInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Represents the software inventory of the virtual machine. */ -@Fluent -public final class SoftwaresList { - /* - * The value property. - */ - @JsonProperty(value = "value") - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of SoftwaresList class. */ - public SoftwaresList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: The value property. - * - * @param value the value value to set. - * @return the SoftwaresList object itself. - */ - public SoftwaresList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Source.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Source.java deleted file mode 100644 index daaa9fabec9b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Source.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The platform where the assessed resource resides. */ -public final class Source extends ExpandableStringEnum { - /** Static value Azure for Source. */ - public static final Source AZURE = fromString("Azure"); - - /** Static value OnPremise for Source. */ - public static final Source ON_PREMISE = fromString("OnPremise"); - - /** Static value OnPremiseSql for Source. */ - public static final Source ON_PREMISE_SQL = fromString("OnPremiseSql"); - - /** - * Creates a new instance of Source value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Source() { - } - - /** - * Creates or finds a Source from its string representation. - * - * @param name a name to look for. - * @return the corresponding Source. - */ - @JsonCreator - public static Source fromString(String name) { - return fromString(name, Source.class); - } - - /** - * Gets known Source values. - * - * @return known Source values. - */ - public static Collection values() { - return values(Source.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SourceSystem.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SourceSystem.java deleted file mode 100644 index 092c38009856..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SourceSystem.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The source type of the machine group. */ -public final class SourceSystem extends ExpandableStringEnum { - /** Static value Azure_AppLocker for SourceSystem. */ - public static final SourceSystem AZURE_APP_LOCKER = fromString("Azure_AppLocker"); - - /** Static value Azure_AuditD for SourceSystem. */ - public static final SourceSystem AZURE_AUDITD = fromString("Azure_AuditD"); - - /** Static value NonAzure_AppLocker for SourceSystem. */ - public static final SourceSystem NON_AZURE_APP_LOCKER = fromString("NonAzure_AppLocker"); - - /** Static value NonAzure_AuditD for SourceSystem. */ - public static final SourceSystem NON_AZURE_AUDITD = fromString("NonAzure_AuditD"); - - /** Static value None for SourceSystem. */ - public static final SourceSystem NONE = fromString("None"); - - /** - * Creates a new instance of SourceSystem value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SourceSystem() { - } - - /** - * Creates or finds a SourceSystem from its string representation. - * - * @param name a name to look for. - * @return the corresponding SourceSystem. - */ - @JsonCreator - public static SourceSystem fromString(String name) { - return fromString(name, SourceSystem.class); - } - - /** - * Gets known SourceSystem values. - * - * @return known SourceSystem values. - */ - public static Collection values() { - return values(SourceSystem.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlServerVulnerabilityProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlServerVulnerabilityProperties.java deleted file mode 100644 index 2f7ed95eb830..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlServerVulnerabilityProperties.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -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 = "assessedResourceType") -@JsonTypeName("SqlServerVulnerability") -@Immutable -public final class SqlServerVulnerabilityProperties extends AdditionalData { - /* - * The resource type the sub assessment refers to in its resource details - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * The T-SQL query that runs on your SQL database to perform the particular check - */ - @JsonProperty(value = "query", access = JsonProperty.Access.WRITE_ONLY) - private String query; - - /** Creates an instance of SqlServerVulnerabilityProperties class. */ - public SqlServerVulnerabilityProperties() { - } - - /** - * Get the type property: The resource type the sub assessment refers to in its resource details. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the query property: The T-SQL query that runs on your SQL database to perform the particular check. - * - * @return the query value. - */ - public String query() { - return this.query; - } - - /** - * 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/SqlVulnerabilityAssessmentBaselineRules.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentBaselineRules.java deleted file mode 100644 index 56a81b4148ff..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentBaselineRules.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of SqlVulnerabilityAssessmentBaselineRules. */ -public interface SqlVulnerabilityAssessmentBaselineRules { - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline along with {@link Response}. - */ - Response getWithResponse(String ruleId, String workspaceId, String resourceId, Context context); - - /** - * Gets the results for a given rule in the Baseline. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for a given rule in the Baseline. - */ - RuleResults get(String ruleId, String workspaceId, String resourceId); - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String ruleId, String workspaceId, String resourceId, Context context); - - /** - * Deletes a rule from the Baseline of a given database. - * - * @param ruleId The rule Id. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String ruleId, String workspaceId, String resourceId); - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline along with {@link Response}. - */ - Response listWithResponse(String workspaceId, String resourceId, Context context); - - /** - * Gets the results for all rules in the Baseline. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the results for all rules in the Baseline. - */ - RulesResults list(String workspaceId, String resourceId); - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param body The baseline rules. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of rules results along with {@link Response}. - */ - Response addWithResponse( - String workspaceId, String resourceId, RulesResultsInput body, Context context); - - /** - * Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of rules results. - */ - RulesResults add(String workspaceId, String resourceId); - - /** - * Begins definition for a new RuleResults resource. - * - * @param name resource name. - * @return the first stage of the new RuleResults definition. - */ - RuleResults.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentScanResults.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentScanResults.java deleted file mode 100644 index c6eac8f24e30..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentScanResults.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of SqlVulnerabilityAssessmentScanResults. */ -public interface SqlVulnerabilityAssessmentScanResults { - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record along with {@link Response}. - */ - Response getWithResponse( - String scanId, String scanResultId, String workspaceId, String resourceId, Context context); - - /** - * Gets the scan results of a single rule in a scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param scanResultId The rule Id of the results. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan results of a single rule in a scan record. - */ - ScanResult get(String scanId, String scanResultId, String workspaceId, String resourceId); - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan results for a single scan record along with {@link Response}. - */ - Response listWithResponse(String scanId, String workspaceId, String resourceId, Context context); - - /** - * Gets a list of scan results for a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan results for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan results for a single scan record. - */ - ScanResults list(String scanId, String workspaceId, String resourceId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentScans.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentScans.java deleted file mode 100644 index 7337b7390e8b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SqlVulnerabilityAssessmentScans.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of SqlVulnerabilityAssessmentScans. */ -public interface SqlVulnerabilityAssessmentScans { - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record along with {@link Response}. - */ - Response getWithResponse(String scanId, String workspaceId, String resourceId, Context context); - - /** - * Gets the scan details of a single scan record. - * - * @param scanId The scan Id. Type 'latest' to get the scan record for the latest scan. - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the scan details of a single scan record. - */ - Scan get(String scanId, String workspaceId, String resourceId); - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan records along with {@link Response}. - */ - Response listWithResponse(String workspaceId, String resourceId, Context context); - - /** - * Gets a list of scan records. - * - * @param workspaceId The workspace Id. - * @param resourceId The identifier of the resource. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of scan records. - */ - Scans list(String workspaceId, String resourceId); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/State.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/State.java deleted file mode 100644 index 9d606016f170..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/State.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Aggregative state based on the standard's supported controls states. */ -public final class State extends ExpandableStringEnum { - /** Static value Passed for State. */ - public static final State PASSED = fromString("Passed"); - - /** Static value Failed for State. */ - public static final State FAILED = fromString("Failed"); - - /** Static value Skipped for State. */ - public static final State SKIPPED = fromString("Skipped"); - - /** Static value Unsupported for State. */ - public static final State UNSUPPORTED = fromString("Unsupported"); - - /** - * Creates a new instance of State value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public State() { - } - - /** - * Creates or finds a State from its string representation. - * - * @param name a name to look for. - * @return the corresponding State. - */ - @JsonCreator - public static State fromString(String name) { - return fromString(name, State.class); - } - - /** - * Gets known State values. - * - * @return known State values. - */ - public static Collection values() { - return values(State.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Status.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Status.java deleted file mode 100644 index 30997f3be2d1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Status.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The status of the port. */ -public final class Status extends ExpandableStringEnum { - /** Static value Revoked for Status. */ - public static final Status REVOKED = fromString("Revoked"); - - /** Static value Initiated for Status. */ - public static final Status INITIATED = fromString("Initiated"); - - /** - * Creates a new instance of Status value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Status() { - } - - /** - * Creates or finds a Status from its string representation. - * - * @param name a name to look for. - * @return the corresponding Status. - */ - @JsonCreator - public static Status fromString(String name) { - return fromString(name, Status.class); - } - - /** - * Gets known Status values. - * - * @return known Status values. - */ - public static Collection values() { - return values(Status.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusAutoGenerated.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusAutoGenerated.java deleted file mode 100644 index 9332eaf6883c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusAutoGenerated.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** The status of the health report. */ -@Fluent -public final class StatusAutoGenerated { - /* - * The status of the health report - */ - @JsonProperty(value = "code") - private StatusName code; - - /* - * The date of when the status of the health report was changed in the last time - */ - @JsonProperty(value = "statusChangeDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime statusChangeDate; - - /* - * The date of when the resource of the health report was scanned in the first time - */ - @JsonProperty(value = "firstEvaluationDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime firstEvaluationDate; - - /** Creates an instance of StatusAutoGenerated class. */ - public StatusAutoGenerated() { - } - - /** - * Get the code property: The status of the health report. - * - * @return the code value. - */ - public StatusName code() { - return this.code; - } - - /** - * Set the code property: The status of the health report. - * - * @param code the code value to set. - * @return the StatusAutoGenerated object itself. - */ - public StatusAutoGenerated withCode(StatusName code) { - this.code = code; - return this; - } - - /** - * Get the statusChangeDate property: The date of when the status of the health report was changed in the last time. - * - * @return the statusChangeDate value. - */ - public OffsetDateTime statusChangeDate() { - return this.statusChangeDate; - } - - /** - * Get the firstEvaluationDate property: The date of when the resource of the health report was scanned in the first - * time. - * - * @return the firstEvaluationDate value. - */ - public OffsetDateTime firstEvaluationDate() { - return this.firstEvaluationDate; - } - - /** - * 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/StatusName.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusName.java deleted file mode 100644 index 78edef2e37cd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusName.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The status of the health report. */ -public final class StatusName extends ExpandableStringEnum { - /** Static value Healthy for StatusName. */ - public static final StatusName HEALTHY = fromString("Healthy"); - - /** Static value NotHealthy for StatusName. */ - public static final StatusName NOT_HEALTHY = fromString("NotHealthy"); - - /** Static value NotApplicable for StatusName. */ - public static final StatusName NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Creates a new instance of StatusName value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public StatusName() { - } - - /** - * Creates or finds a StatusName from its string representation. - * - * @param name a name to look for. - * @return the corresponding StatusName. - */ - @JsonCreator - public static StatusName fromString(String name) { - return fromString(name, StatusName.class); - } - - /** - * Gets known StatusName values. - * - * @return known StatusName values. - */ - public static Collection values() { - return values(StatusName.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusReason.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusReason.java deleted file mode 100644 index 91be264a363f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/StatusReason.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** A description of why the `status` has its value. */ -public final class StatusReason extends ExpandableStringEnum { - /** Static value Expired for StatusReason. */ - public static final StatusReason EXPIRED = fromString("Expired"); - - /** Static value UserRequested for StatusReason. */ - public static final StatusReason USER_REQUESTED = fromString("UserRequested"); - - /** Static value NewerRequestInitiated for StatusReason. */ - public static final StatusReason NEWER_REQUEST_INITIATED = fromString("NewerRequestInitiated"); - - /** - * Creates a new instance of StatusReason value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public StatusReason() { - } - - /** - * Creates or finds a StatusReason from its string representation. - * - * @param name a name to look for. - * @return the corresponding StatusReason. - */ - @JsonCreator - public static StatusReason fromString(String name) { - return fromString(name, StatusReason.class); - } - - /** - * Gets known StatusReason values. - * - * @return known StatusReason values. - */ - public static Collection values() { - return values(StatusReason.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessmentStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessmentStatus.java deleted file mode 100644 index 9efbfea31765..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessmentStatus.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Status of the sub-assessment. */ -@Immutable -public final class SubAssessmentStatus { - /* - * Programmatic code for the status of the assessment - */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) - private SubAssessmentStatusCode code; - - /* - * Programmatic code for the cause of the assessment status - */ - @JsonProperty(value = "cause", access = JsonProperty.Access.WRITE_ONLY) - private String cause; - - /* - * Human readable description of the assessment status - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The sub-assessment severity level - */ - @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) - private Severity severity; - - /** Creates an instance of SubAssessmentStatus class. */ - public SubAssessmentStatus() { - } - - /** - * Get the code property: Programmatic code for the status of the assessment. - * - * @return the code value. - */ - public SubAssessmentStatusCode code() { - return this.code; - } - - /** - * Get the cause property: Programmatic code for the cause of the assessment status. - * - * @return the cause value. - */ - public String cause() { - return this.cause; - } - - /** - * Get the description property: Human readable description of the assessment status. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the severity property: The sub-assessment severity level. - * - * @return the severity value. - */ - public Severity severity() { - return this.severity; - } - - /** - * 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/SubAssessmentStatusCode.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessmentStatusCode.java deleted file mode 100644 index 9b82da225433..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessmentStatusCode.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Programmatic code for the status of the assessment. */ -public final class SubAssessmentStatusCode extends ExpandableStringEnum { - /** Static value Healthy for SubAssessmentStatusCode. */ - public static final SubAssessmentStatusCode HEALTHY = fromString("Healthy"); - - /** Static value Unhealthy for SubAssessmentStatusCode. */ - public static final SubAssessmentStatusCode UNHEALTHY = fromString("Unhealthy"); - - /** Static value NotApplicable for SubAssessmentStatusCode. */ - public static final SubAssessmentStatusCode NOT_APPLICABLE = fromString("NotApplicable"); - - /** - * Creates a new instance of SubAssessmentStatusCode value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SubAssessmentStatusCode() { - } - - /** - * Creates or finds a SubAssessmentStatusCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding SubAssessmentStatusCode. - */ - @JsonCreator - public static SubAssessmentStatusCode fromString(String name) { - return fromString(name, SubAssessmentStatusCode.class); - } - - /** - * Gets known SubAssessmentStatusCode values. - * - * @return known SubAssessmentStatusCode values. - */ - public static Collection values() { - return values(SubAssessmentStatusCode.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessments.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessments.java deleted file mode 100644 index d2fe59954510..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubAssessments.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.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of SubAssessments. */ -public interface SubAssessments { - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedIterable}. - */ - PagedIterable listAll(String scope); - - /** - * Get security sub-assessments on all your scanned resources inside a subscription scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a subscription scope as paginated response - * with {@link PagedIterable}. - */ - PagedIterable listAll(String scope, Context context); - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(String scope, String assessmentName); - - /** - * Get security sub-assessments on all your scanned resources inside a scope. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security sub-assessments on all your scanned resources inside a scope as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(String scope, String assessmentName, Context context); - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment type. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security sub-assessment on your scanned resource along with {@link Response}. - */ - Response getWithResponse( - String scope, String assessmentName, String subAssessmentName, Context context); - - /** - * Get a security sub-assessment on your scanned resource. - * - * @param scope Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or - * management group (/providers/Microsoft.Management/managementGroups/mgName). - * @param assessmentName The Assessment Key - Unique key for the assessment type. - * @param subAssessmentName The Sub-Assessment Key - Unique key for the sub-assessment type. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a security sub-assessment on your scanned resource. - */ - SecuritySubAssessment get(String scope, String assessmentName, String subAssessmentName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubPlan.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubPlan.java deleted file mode 100644 index daa211657fba..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SubPlan.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The available sub plans. */ -public final class SubPlan extends ExpandableStringEnum { - /** Static value P1 for SubPlan. */ - public static final SubPlan P1 = fromString("P1"); - - /** Static value P2 for SubPlan. */ - public static final SubPlan P2 = fromString("P2"); - - /** - * Creates a new instance of SubPlan value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SubPlan() { - } - - /** - * Creates or finds a SubPlan from its string representation. - * - * @param name a name to look for. - * @return the corresponding SubPlan. - */ - @JsonCreator - public static SubPlan fromString(String name) { - return fromString(name, SubPlan.class); - } - - /** - * Gets known SubPlan values. - * - * @return known SubPlan values. - */ - public static Collection values() { - return values(SubPlan.class); - } -} 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 deleted file mode 100644 index b8013fad05ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SupportedCloudEnum.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Relevant cloud for the custom assessment automation. */ -public final class SupportedCloudEnum extends ExpandableStringEnum { - /** Static value AWS for SupportedCloudEnum. */ - public static final SupportedCloudEnum AWS = fromString("AWS"); - - /** Static value GCP for SupportedCloudEnum. */ - public static final SupportedCloudEnum GCP = fromString("GCP"); - - /** - * Creates a new instance of SupportedCloudEnum value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SupportedCloudEnum() { - } - - /** - * 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); - } - - /** - * Gets known SupportedCloudEnum values. - * - * @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/SuppressionAlertsScope.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SuppressionAlertsScope.java deleted file mode 100644 index 3f523fadb0ba..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/SuppressionAlertsScope.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.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The SuppressionAlertsScope model. */ -@Fluent -public final class SuppressionAlertsScope { - /* - * All the conditions inside need to be true in order to suppress the alert - */ - @JsonProperty(value = "allOf", required = true) - private List allOf; - - /** Creates an instance of SuppressionAlertsScope class. */ - public SuppressionAlertsScope() { - } - - /** - * Get the allOf property: All the conditions inside need to be true in order to suppress the alert. - * - * @return the allOf value. - */ - public List allOf() { - return this.allOf; - } - - /** - * Set the allOf property: All the conditions inside need to be true in order to suppress the alert. - * - * @param allOf the allOf value to set. - * @return the SuppressionAlertsScope object itself. - */ - public SuppressionAlertsScope withAllOf(List allOf) { - this.allOf = allOf; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (allOf() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property allOf in model SuppressionAlertsScope")); - } else { - allOf().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(SuppressionAlertsScope.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 deleted file mode 100644 index 78319720027e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tactics.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Tactic of the assessment. */ -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 a new instance of Tactics value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Tactics() { - } - - /** - * 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); - } - - /** - * Gets known Tactics values. - * - * @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 deleted file mode 100644 index 607ec4b9dd68..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tags.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** A list of key value pairs that describe the resource. */ -@Fluent -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; - - /** Creates an instance of Tags class. */ - public Tags() { - } - - /** - * Get the tags property: A list of key value pairs that describe the resource. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: A list of key value pairs that describe the resource. - * - * @param tags the tags value to set. - * @return the Tags object itself. - */ - public Tags 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/models/TagsResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TagsResource.java deleted file mode 100644 index d86888a72bbd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TagsResource.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** A container holding only the Tags for a resource, allowing the user to update the tags. */ -@Fluent -public class TagsResource { - /* - * Resource tags - */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; - - /** Creates an instance of TagsResource class. */ - public TagsResource() { - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Resource tags. - * - * @param tags the tags value to set. - * @return the TagsResource object itself. - */ - public TagsResource 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/models/TaskUpdateActionType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TaskUpdateActionType.java deleted file mode 100644 index 3db786c081d2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TaskUpdateActionType.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for TaskUpdateActionType. */ -public final class TaskUpdateActionType extends ExpandableStringEnum { - /** Static value Activate for TaskUpdateActionType. */ - public static final TaskUpdateActionType ACTIVATE = fromString("Activate"); - - /** Static value Dismiss for TaskUpdateActionType. */ - public static final TaskUpdateActionType DISMISS = fromString("Dismiss"); - - /** Static value Start for TaskUpdateActionType. */ - public static final TaskUpdateActionType START = fromString("Start"); - - /** Static value Resolve for TaskUpdateActionType. */ - public static final TaskUpdateActionType RESOLVE = fromString("Resolve"); - - /** Static value Close for TaskUpdateActionType. */ - public static final TaskUpdateActionType CLOSE = fromString("Close"); - - /** - * Creates a new instance of TaskUpdateActionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TaskUpdateActionType() { - } - - /** - * Creates or finds a TaskUpdateActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding TaskUpdateActionType. - */ - @JsonCreator - public static TaskUpdateActionType fromString(String name) { - return fromString(name, TaskUpdateActionType.class); - } - - /** - * Gets known TaskUpdateActionType values. - * - * @return known TaskUpdateActionType values. - */ - public static Collection values() { - return values(TaskUpdateActionType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tasks.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tasks.java deleted file mode 100644 index 54c084a032aa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Tasks.java +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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 Tasks. */ -public interface Tasks { - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String filter, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation, String filter, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response}. - */ - Response getSubscriptionLevelTaskWithResponse(String ascLocation, String taskName, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security. - */ - SecurityTask getSubscriptionLevelTask(String ascLocation, String taskName); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response updateSubscriptionLevelTaskStateWithResponse( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void updateSubscriptionLevelTaskState( - String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName, String ascLocation); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param filter OData filter. Optional. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of security task recommendations as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup( - String resourceGroupName, String ascLocation, String filter, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security along with {@link Response}. - */ - Response getResourceGroupLevelTaskWithResponse( - String resourceGroupName, String ascLocation, String taskName, Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return security task that we recommend to do in order to strengthen security. - */ - SecurityTask getResourceGroupLevelTask(String resourceGroupName, String ascLocation, String taskName); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response updateResourceGroupLevelTaskStateWithResponse( - String resourceGroupName, - String ascLocation, - String taskName, - TaskUpdateActionType taskUpdateActionType, - Context context); - - /** - * Recommended tasks that will help improve the security of the subscription proactively. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param taskName Name of the task object, will be a GUID. - * @param taskUpdateActionType Type of the action to do on the task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void updateResourceGroupLevelTaskState( - String resourceGroupName, String ascLocation, String taskName, TaskUpdateActionType taskUpdateActionType); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Techniques.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Techniques.java deleted file mode 100644 index 9fafeb990de3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Techniques.java +++ /dev/null @@ -1,362 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights 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; - -/** Techniques of the assessment. */ -public final class Techniques extends ExpandableStringEnum { - /** Static value Abuse Elevation Control Mechanism for Techniques. */ - public static final Techniques ABUSE_ELEVATION_CONTROL_MECHANISM = fromString("Abuse Elevation Control Mechanism"); - - /** Static value Access Token Manipulation for Techniques. */ - public static final Techniques ACCESS_TOKEN_MANIPULATION = fromString("Access Token Manipulation"); - - /** Static value Account Discovery for Techniques. */ - public static final Techniques ACCOUNT_DISCOVERY = fromString("Account Discovery"); - - /** Static value Account Manipulation for Techniques. */ - public static final Techniques ACCOUNT_MANIPULATION = fromString("Account Manipulation"); - - /** Static value Active Scanning for Techniques. */ - public static final Techniques ACTIVE_SCANNING = fromString("Active Scanning"); - - /** Static value Application Layer Protocol for Techniques. */ - public static final Techniques APPLICATION_LAYER_PROTOCOL = fromString("Application Layer Protocol"); - - /** Static value Audio Capture for Techniques. */ - public static final Techniques AUDIO_CAPTURE = fromString("Audio Capture"); - - /** Static value Boot or Logon Autostart Execution for Techniques. */ - public static final Techniques BOOT_OR_LOGON_AUTOSTART_EXECUTION = fromString("Boot or Logon Autostart Execution"); - - /** Static value Boot or Logon Initialization Scripts for Techniques. */ - public static final Techniques BOOT_OR_LOGON_INITIALIZATION_SCRIPTS = - fromString("Boot or Logon Initialization Scripts"); - - /** Static value Brute Force for Techniques. */ - public static final Techniques BRUTE_FORCE = fromString("Brute Force"); - - /** Static value Cloud Infrastructure Discovery for Techniques. */ - public static final Techniques CLOUD_INFRASTRUCTURE_DISCOVERY = fromString("Cloud Infrastructure Discovery"); - - /** Static value Cloud Service Dashboard for Techniques. */ - public static final Techniques CLOUD_SERVICE_DASHBOARD = fromString("Cloud Service Dashboard"); - - /** Static value Cloud Service Discovery for Techniques. */ - public static final Techniques CLOUD_SERVICE_DISCOVERY = fromString("Cloud Service Discovery"); - - /** Static value Command and Scripting Interpreter for Techniques. */ - public static final Techniques COMMAND_AND_SCRIPTING_INTERPRETER = fromString("Command and Scripting Interpreter"); - - /** Static value Compromise Client Software Binary for Techniques. */ - public static final Techniques COMPROMISE_CLIENT_SOFTWARE_BINARY = fromString("Compromise Client Software Binary"); - - /** Static value Compromise Infrastructure for Techniques. */ - public static final Techniques COMPROMISE_INFRASTRUCTURE = fromString("Compromise Infrastructure"); - - /** Static value Container and Resource Discovery for Techniques. */ - public static final Techniques CONTAINER_AND_RESOURCE_DISCOVERY = fromString("Container and Resource Discovery"); - - /** Static value Create Account for Techniques. */ - public static final Techniques CREATE_ACCOUNT = fromString("Create Account"); - - /** Static value Create or Modify System Process for Techniques. */ - public static final Techniques CREATE_OR_MODIFY_SYSTEM_PROCESS = fromString("Create or Modify System Process"); - - /** Static value Credentials from Password Stores for Techniques. */ - public static final Techniques CREDENTIALS_FROM_PASSWORD_STORES = fromString("Credentials from Password Stores"); - - /** Static value Data Destruction for Techniques. */ - public static final Techniques DATA_DESTRUCTION = fromString("Data Destruction"); - - /** Static value Data Encrypted for Impact for Techniques. */ - public static final Techniques DATA_ENCRYPTED_FOR_IMPACT = fromString("Data Encrypted for Impact"); - - /** Static value Data from Cloud Storage Object for Techniques. */ - public static final Techniques DATA_FROM_CLOUD_STORAGE_OBJECT = fromString("Data from Cloud Storage Object"); - - /** Static value Data from Configuration Repository for Techniques. */ - public static final Techniques DATA_FROM_CONFIGURATION_REPOSITORY = - fromString("Data from Configuration Repository"); - - /** Static value Data from Information Repositories for Techniques. */ - public static final Techniques DATA_FROM_INFORMATION_REPOSITORIES = - fromString("Data from Information Repositories"); - - /** Static value Data from Local System for Techniques. */ - public static final Techniques DATA_FROM_LOCAL_SYSTEM = fromString("Data from Local System"); - - /** Static value Data Manipulation for Techniques. */ - public static final Techniques DATA_MANIPULATION = fromString("Data Manipulation"); - - /** Static value Data Staged for Techniques. */ - public static final Techniques DATA_STAGED = fromString("Data Staged"); - - /** Static value Defacement for Techniques. */ - public static final Techniques DEFACEMENT = fromString("Defacement"); - - /** Static value Deobfuscate/Decode Files or Information for Techniques. */ - public static final Techniques DEOBFUSCATE_DECODE_FILES_OR_INFORMATION = - fromString("Deobfuscate/Decode Files or Information"); - - /** Static value Disk Wipe for Techniques. */ - public static final Techniques DISK_WIPE = fromString("Disk Wipe"); - - /** Static value Domain Trust Discovery for Techniques. */ - public static final Techniques DOMAIN_TRUST_DISCOVERY = fromString("Domain Trust Discovery"); - - /** Static value Drive-by Compromise for Techniques. */ - public static final Techniques DRIVE_BY_COMPROMISE = fromString("Drive-by Compromise"); - - /** Static value Dynamic Resolution for Techniques. */ - public static final Techniques DYNAMIC_RESOLUTION = fromString("Dynamic Resolution"); - - /** Static value Endpoint Denial of Service for Techniques. */ - public static final Techniques ENDPOINT_DENIAL_OF_SERVICE = fromString("Endpoint Denial of Service"); - - /** Static value Event Triggered Execution for Techniques. */ - public static final Techniques EVENT_TRIGGERED_EXECUTION = fromString("Event Triggered Execution"); - - /** Static value Exfiltration Over Alternative Protocol for Techniques. */ - public static final Techniques EXFILTRATION_OVER_ALTERNATIVE_PROTOCOL = - fromString("Exfiltration Over Alternative Protocol"); - - /** Static value Exploit Public-Facing Application for Techniques. */ - public static final Techniques EXPLOIT_PUBLIC_FACING_APPLICATION = fromString("Exploit Public-Facing Application"); - - /** Static value Exploitation for Client Execution for Techniques. */ - public static final Techniques EXPLOITATION_FOR_CLIENT_EXECUTION = fromString("Exploitation for Client Execution"); - - /** Static value Exploitation for Credential Access for Techniques. */ - public static final Techniques EXPLOITATION_FOR_CREDENTIAL_ACCESS = - fromString("Exploitation for Credential Access"); - - /** Static value Exploitation for Defense Evasion for Techniques. */ - public static final Techniques EXPLOITATION_FOR_DEFENSE_EVASION = fromString("Exploitation for Defense Evasion"); - - /** Static value Exploitation for Privilege Escalation for Techniques. */ - public static final Techniques EXPLOITATION_FOR_PRIVILEGE_ESCALATION = - fromString("Exploitation for Privilege Escalation"); - - /** Static value Exploitation of Remote Services for Techniques. */ - public static final Techniques EXPLOITATION_OF_REMOTE_SERVICES = fromString("Exploitation of Remote Services"); - - /** Static value External Remote Services for Techniques. */ - public static final Techniques EXTERNAL_REMOTE_SERVICES = fromString("External Remote Services"); - - /** Static value Fallback Channels for Techniques. */ - public static final Techniques FALLBACK_CHANNELS = fromString("Fallback Channels"); - - /** Static value File and Directory Discovery for Techniques. */ - public static final Techniques FILE_AND_DIRECTORY_DISCOVERY = fromString("File and Directory Discovery"); - - /** Static value Gather Victim Network Information for Techniques. */ - public static final Techniques GATHER_VICTIM_NETWORK_INFORMATION = fromString("Gather Victim Network Information"); - - /** Static value Hide Artifacts for Techniques. */ - public static final Techniques HIDE_ARTIFACTS = fromString("Hide Artifacts"); - - /** Static value Hijack Execution Flow for Techniques. */ - public static final Techniques HIJACK_EXECUTION_FLOW = fromString("Hijack Execution Flow"); - - /** Static value Impair Defenses for Techniques. */ - public static final Techniques IMPAIR_DEFENSES = fromString("Impair Defenses"); - - /** Static value Implant Container Image for Techniques. */ - public static final Techniques IMPLANT_CONTAINER_IMAGE = fromString("Implant Container Image"); - - /** Static value Indicator Removal on Host for Techniques. */ - public static final Techniques INDICATOR_REMOVAL_ON_HOST = fromString("Indicator Removal on Host"); - - /** Static value Indirect Command Execution for Techniques. */ - public static final Techniques INDIRECT_COMMAND_EXECUTION = fromString("Indirect Command Execution"); - - /** Static value Ingress Tool Transfer for Techniques. */ - public static final Techniques INGRESS_TOOL_TRANSFER = fromString("Ingress Tool Transfer"); - - /** Static value Input Capture for Techniques. */ - public static final Techniques INPUT_CAPTURE = fromString("Input Capture"); - - /** Static value Inter-Process Communication for Techniques. */ - public static final Techniques INTER_PROCESS_COMMUNICATION = fromString("Inter-Process Communication"); - - /** Static value Lateral Tool Transfer for Techniques. */ - public static final Techniques LATERAL_TOOL_TRANSFER = fromString("Lateral Tool Transfer"); - - /** Static value Man-in-the-Middle for Techniques. */ - public static final Techniques MAN_IN_THE_MIDDLE = fromString("Man-in-the-Middle"); - - /** Static value Masquerading for Techniques. */ - public static final Techniques MASQUERADING = fromString("Masquerading"); - - /** Static value Modify Authentication Process for Techniques. */ - public static final Techniques MODIFY_AUTHENTICATION_PROCESS = fromString("Modify Authentication Process"); - - /** Static value Modify Registry for Techniques. */ - public static final Techniques MODIFY_REGISTRY = fromString("Modify Registry"); - - /** Static value Network Denial of Service for Techniques. */ - public static final Techniques NETWORK_DENIAL_OF_SERVICE = fromString("Network Denial of Service"); - - /** Static value Network Service Scanning for Techniques. */ - public static final Techniques NETWORK_SERVICE_SCANNING = fromString("Network Service Scanning"); - - /** Static value Network Sniffing for Techniques. */ - public static final Techniques NETWORK_SNIFFING = fromString("Network Sniffing"); - - /** Static value Non-Application Layer Protocol for Techniques. */ - public static final Techniques NON_APPLICATION_LAYER_PROTOCOL = fromString("Non-Application Layer Protocol"); - - /** Static value Non-Standard Port for Techniques. */ - public static final Techniques NON_STANDARD_PORT = fromString("Non-Standard Port"); - - /** Static value Obtain Capabilities for Techniques. */ - public static final Techniques OBTAIN_CAPABILITIES = fromString("Obtain Capabilities"); - - /** Static value Obfuscated Files or Information for Techniques. */ - public static final Techniques OBFUSCATED_FILES_OR_INFORMATION = fromString("Obfuscated Files or Information"); - - /** Static value Office Application Startup for Techniques. */ - public static final Techniques OFFICE_APPLICATION_STARTUP = fromString("Office Application Startup"); - - /** Static value OS Credential Dumping for Techniques. */ - public static final Techniques OS_CREDENTIAL_DUMPING = fromString("OS Credential Dumping"); - - /** Static value Permission Groups Discovery for Techniques. */ - public static final Techniques PERMISSION_GROUPS_DISCOVERY = fromString("Permission Groups Discovery"); - - /** Static value Phishing for Techniques. */ - public static final Techniques PHISHING = fromString("Phishing"); - - /** Static value Pre-OS Boot for Techniques. */ - public static final Techniques PRE_OS_BOOT = fromString("Pre-OS Boot"); - - /** Static value Process Discovery for Techniques. */ - public static final Techniques PROCESS_DISCOVERY = fromString("Process Discovery"); - - /** Static value Process Injection for Techniques. */ - public static final Techniques PROCESS_INJECTION = fromString("Process Injection"); - - /** Static value Protocol Tunneling for Techniques. */ - public static final Techniques PROTOCOL_TUNNELING = fromString("Protocol Tunneling"); - - /** Static value Proxy for Techniques. */ - public static final Techniques PROXY = fromString("Proxy"); - - /** Static value Query Registry for Techniques. */ - public static final Techniques QUERY_REGISTRY = fromString("Query Registry"); - - /** Static value Remote Access Software for Techniques. */ - public static final Techniques REMOTE_ACCESS_SOFTWARE = fromString("Remote Access Software"); - - /** Static value Remote Service Session Hijacking for Techniques. */ - public static final Techniques REMOTE_SERVICE_SESSION_HIJACKING = fromString("Remote Service Session Hijacking"); - - /** Static value Remote Services for Techniques. */ - public static final Techniques REMOTE_SERVICES = fromString("Remote Services"); - - /** Static value Remote System Discovery for Techniques. */ - public static final Techniques REMOTE_SYSTEM_DISCOVERY = fromString("Remote System Discovery"); - - /** Static value Resource Hijacking for Techniques. */ - public static final Techniques RESOURCE_HIJACKING = fromString("Resource Hijacking"); - - /** Static value Scheduled Task/Job for Techniques. */ - public static final Techniques SCHEDULED_TASK_JOB = fromString("Scheduled Task/Job"); - - /** Static value Screen Capture for Techniques. */ - public static final Techniques SCREEN_CAPTURE = fromString("Screen Capture"); - - /** Static value Search Victim-Owned Websites for Techniques. */ - public static final Techniques SEARCH_VICTIM_OWNED_WEBSITES = fromString("Search Victim-Owned Websites"); - - /** Static value Server Software Component for Techniques. */ - public static final Techniques SERVER_SOFTWARE_COMPONENT = fromString("Server Software Component"); - - /** Static value Service Stop for Techniques. */ - public static final Techniques SERVICE_STOP = fromString("Service Stop"); - - /** Static value Signed Binary Proxy Execution for Techniques. */ - public static final Techniques SIGNED_BINARY_PROXY_EXECUTION = fromString("Signed Binary Proxy Execution"); - - /** Static value Software Deployment Tools for Techniques. */ - public static final Techniques SOFTWARE_DEPLOYMENT_TOOLS = fromString("Software Deployment Tools"); - - /** Static value SQL Stored Procedures for Techniques. */ - public static final Techniques SQL_STORED_PROCEDURES = fromString("SQL Stored Procedures"); - - /** Static value Steal or Forge Kerberos Tickets for Techniques. */ - public static final Techniques STEAL_OR_FORGE_KERBEROS_TICKETS = fromString("Steal or Forge Kerberos Tickets"); - - /** Static value Subvert Trust Controls for Techniques. */ - public static final Techniques SUBVERT_TRUST_CONTROLS = fromString("Subvert Trust Controls"); - - /** Static value Supply Chain Compromise for Techniques. */ - public static final Techniques SUPPLY_CHAIN_COMPROMISE = fromString("Supply Chain Compromise"); - - /** Static value System Information Discovery for Techniques. */ - public static final Techniques SYSTEM_INFORMATION_DISCOVERY = fromString("System Information Discovery"); - - /** Static value Taint Shared Content for Techniques. */ - public static final Techniques TAINT_SHARED_CONTENT = fromString("Taint Shared Content"); - - /** Static value Traffic Signaling for Techniques. */ - public static final Techniques TRAFFIC_SIGNALING = fromString("Traffic Signaling"); - - /** Static value Transfer Data to Cloud Account for Techniques. */ - public static final Techniques TRANSFER_DATA_TO_CLOUD_ACCOUNT = fromString("Transfer Data to Cloud Account"); - - /** Static value Trusted Relationship for Techniques. */ - public static final Techniques TRUSTED_RELATIONSHIP = fromString("Trusted Relationship"); - - /** Static value Unsecured Credentials for Techniques. */ - public static final Techniques UNSECURED_CREDENTIALS = fromString("Unsecured Credentials"); - - /** Static value User Execution for Techniques. */ - public static final Techniques USER_EXECUTION = fromString("User Execution"); - - /** Static value Valid Accounts for Techniques. */ - public static final Techniques VALID_ACCOUNTS = fromString("Valid Accounts"); - - /** Static value Windows Management Instrumentation for Techniques. */ - public static final Techniques WINDOWS_MANAGEMENT_INSTRUMENTATION = - fromString("Windows Management Instrumentation"); - - /** Static value File and Directory Permissions Modification for Techniques. */ - public static final Techniques FILE_AND_DIRECTORY_PERMISSIONS_MODIFICATION = - fromString("File and Directory Permissions Modification"); - - /** - * Creates a new instance of Techniques value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Techniques() { - } - - /** - * 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); - } - - /** - * Gets known Techniques values. - * - * @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/Threats.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Threats.java deleted file mode 100644 index de2c64b42347..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Threats.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Threats impact of the assessment. */ -public final class Threats extends ExpandableStringEnum { - /** Static value accountBreach for Threats. */ - public static final Threats ACCOUNT_BREACH = fromString("accountBreach"); - - /** Static value dataExfiltration for Threats. */ - public static final Threats DATA_EXFILTRATION = fromString("dataExfiltration"); - - /** Static value dataSpillage for Threats. */ - public static final Threats DATA_SPILLAGE = fromString("dataSpillage"); - - /** Static value maliciousInsider for Threats. */ - public static final Threats MALICIOUS_INSIDER = fromString("maliciousInsider"); - - /** Static value elevationOfPrivilege for Threats. */ - public static final Threats ELEVATION_OF_PRIVILEGE = fromString("elevationOfPrivilege"); - - /** Static value threatResistance for Threats. */ - public static final Threats THREAT_RESISTANCE = fromString("threatResistance"); - - /** Static value missingCoverage for Threats. */ - public static final Threats MISSING_COVERAGE = fromString("missingCoverage"); - - /** Static value denialOfService for Threats. */ - public static final Threats DENIAL_OF_SERVICE = fromString("denialOfService"); - - /** - * Creates a new instance of Threats value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Threats() { - } - - /** - * Creates or finds a Threats from its string representation. - * - * @param name a name to look for. - * @return the corresponding Threats. - */ - @JsonCreator - public static Threats fromString(String name) { - return fromString(name, Threats.class); - } - - /** - * Gets known Threats values. - * - * @return known Threats values. - */ - public static Collection values() { - return values(Threats.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ThresholdCustomAlertRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ThresholdCustomAlertRule.java deleted file mode 100644 index a3048cfbf9cf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ThresholdCustomAlertRule.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** A custom alert rule that checks if a value (depends on the custom alert type) is within the given range. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "ruleType", - defaultImpl = ThresholdCustomAlertRule.class) -@JsonTypeName("ThresholdCustomAlertRule") -@JsonSubTypes({@JsonSubTypes.Type(name = "TimeWindowCustomAlertRule", value = TimeWindowCustomAlertRule.class)}) -@Fluent -public class ThresholdCustomAlertRule extends CustomAlertRule { - /* - * The minimum threshold. - */ - @JsonProperty(value = "minThreshold", required = true) - private int minThreshold; - - /* - * The maximum threshold. - */ - @JsonProperty(value = "maxThreshold", required = true) - private int maxThreshold; - - /** Creates an instance of ThresholdCustomAlertRule class. */ - public ThresholdCustomAlertRule() { - } - - /** - * Get the minThreshold property: The minimum threshold. - * - * @return the minThreshold value. - */ - public int minThreshold() { - return this.minThreshold; - } - - /** - * Set the minThreshold property: The minimum threshold. - * - * @param minThreshold the minThreshold value to set. - * @return the ThresholdCustomAlertRule object itself. - */ - public ThresholdCustomAlertRule withMinThreshold(int minThreshold) { - this.minThreshold = minThreshold; - return this; - } - - /** - * Get the maxThreshold property: The maximum threshold. - * - * @return the maxThreshold value. - */ - public int maxThreshold() { - return this.maxThreshold; - } - - /** - * Set the maxThreshold property: The maximum threshold. - * - * @param maxThreshold the maxThreshold value to set. - * @return the ThresholdCustomAlertRule object itself. - */ - public ThresholdCustomAlertRule withMaxThreshold(int maxThreshold) { - this.maxThreshold = maxThreshold; - return this; - } - - /** {@inheritDoc} */ - @Override - public ThresholdCustomAlertRule withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/TimeWindowCustomAlertRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TimeWindowCustomAlertRule.java deleted file mode 100644 index 6d39c15b514b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TimeWindowCustomAlertRule.java +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** - * A custom alert rule that checks if the number of activities (depends on the custom alert type) in a time window is - * within the given range. - */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "ruleType", - defaultImpl = TimeWindowCustomAlertRule.class) -@JsonTypeName("TimeWindowCustomAlertRule") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "ActiveConnectionsNotInAllowedRange", value = ActiveConnectionsNotInAllowedRange.class), - @JsonSubTypes.Type(name = "AmqpC2DMessagesNotInAllowedRange", value = AmqpC2DMessagesNotInAllowedRange.class), - @JsonSubTypes.Type(name = "MqttC2DMessagesNotInAllowedRange", value = MqttC2DMessagesNotInAllowedRange.class), - @JsonSubTypes.Type(name = "HttpC2DMessagesNotInAllowedRange", value = HttpC2DMessagesNotInAllowedRange.class), - @JsonSubTypes.Type( - name = "AmqpC2DRejectedMessagesNotInAllowedRange", - value = AmqpC2DRejectedMessagesNotInAllowedRange.class), - @JsonSubTypes.Type( - name = "MqttC2DRejectedMessagesNotInAllowedRange", - value = MqttC2DRejectedMessagesNotInAllowedRange.class), - @JsonSubTypes.Type( - name = "HttpC2DRejectedMessagesNotInAllowedRange", - value = HttpC2DRejectedMessagesNotInAllowedRange.class), - @JsonSubTypes.Type(name = "AmqpD2CMessagesNotInAllowedRange", value = AmqpD2CMessagesNotInAllowedRange.class), - @JsonSubTypes.Type(name = "MqttD2CMessagesNotInAllowedRange", value = MqttD2CMessagesNotInAllowedRange.class), - @JsonSubTypes.Type(name = "HttpD2CMessagesNotInAllowedRange", value = HttpD2CMessagesNotInAllowedRange.class), - @JsonSubTypes.Type( - name = "DirectMethodInvokesNotInAllowedRange", - value = DirectMethodInvokesNotInAllowedRange.class), - @JsonSubTypes.Type(name = "FailedLocalLoginsNotInAllowedRange", value = FailedLocalLoginsNotInAllowedRange.class), - @JsonSubTypes.Type(name = "FileUploadsNotInAllowedRange", value = FileUploadsNotInAllowedRange.class), - @JsonSubTypes.Type(name = "QueuePurgesNotInAllowedRange", value = QueuePurgesNotInAllowedRange.class), - @JsonSubTypes.Type(name = "TwinUpdatesNotInAllowedRange", value = TwinUpdatesNotInAllowedRange.class), - @JsonSubTypes.Type( - name = "UnauthorizedOperationsNotInAllowedRange", - value = UnauthorizedOperationsNotInAllowedRange.class) -}) -@Fluent -public class TimeWindowCustomAlertRule extends ThresholdCustomAlertRule { - /* - * The time window size in iso8601 format. - */ - @JsonProperty(value = "timeWindowSize", required = true) - private Duration timeWindowSize; - - /** Creates an instance of TimeWindowCustomAlertRule class. */ - public TimeWindowCustomAlertRule() { - } - - /** - * Get the timeWindowSize property: The time window size in iso8601 format. - * - * @return the timeWindowSize value. - */ - public Duration timeWindowSize() { - return this.timeWindowSize; - } - - /** - * Set the timeWindowSize property: The time window size in iso8601 format. - * - * @param timeWindowSize the timeWindowSize value to set. - * @return the TimeWindowCustomAlertRule object itself. - */ - public TimeWindowCustomAlertRule withTimeWindowSize(Duration timeWindowSize) { - this.timeWindowSize = timeWindowSize; - return this; - } - - /** {@inheritDoc} */ - @Override - public TimeWindowCustomAlertRule withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public TimeWindowCustomAlertRule withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public TimeWindowCustomAlertRule withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (timeWindowSize() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property timeWindowSize in model TimeWindowCustomAlertRule")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(TimeWindowCustomAlertRule.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Topologies.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Topologies.java deleted file mode 100644 index e82f7507256e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Topologies.java +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Topologies. */ -public interface Topologies { - /** - * Gets a list that allows to build a topology view of a subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(); - - /** - * Gets a list that allows to build a topology view of a subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation); - - /** - * Gets a list that allows to build a topology view of a subscription and location. - * - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list that allows to build a topology view of a subscription and location as paginated response with - * {@link PagedIterable}. - */ - PagedIterable listByHomeRegion(String ascLocation, Context context); - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, String ascLocation, String topologyResourceName, Context context); - - /** - * Gets a specific topology component. - * - * @param resourceGroupName The name of the resource group within the user's subscription. The name is case - * insensitive. - * @param ascLocation The location where ASC stores the data of the subscription. can be retrieved from Get - * locations. - * @param topologyResourceName Name of a topology resources collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a specific topology component. - */ - TopologyResource get(String resourceGroupName, String ascLocation, String topologyResourceName); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologyList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologyList.java deleted file mode 100644 index da838290f232..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologyList.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.resourcemanager.security.fluent.models.TopologyResourceInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The TopologyList model. */ -@Immutable -public final class TopologyList { - /* - * The value property. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of TopologyList class. */ - public TopologyList() { - } - - /** - * Get the value property: The value property. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologyResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologyResource.java deleted file mode 100644 index f742653cb985..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologyResource.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.resourcemanager.security.fluent.models.TopologyResourceInner; -import java.time.OffsetDateTime; -import java.util.List; - -/** An immutable client-side representation of TopologyResource. */ -public interface TopologyResource { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: The name of the resource. - * - * @return the name value. - */ - String name(); - - /** - * Gets the type property: The type of the resource. - * - * @return the type value. - */ - String type(); - - /** - * Gets the location property: Location where the resource is stored. - * - * @return the location value. - */ - String location(); - - /** - * Gets the calculatedDateTime property: The UTC time on which the topology was calculated. - * - * @return the calculatedDateTime value. - */ - OffsetDateTime calculatedDateTime(); - - /** - * Gets the topologyResources property: Azure resources which are part of this topology resource. - * - * @return the topologyResources value. - */ - List topologyResources(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.TopologyResourceInner object. - * - * @return the inner object. - */ - TopologyResourceInner innerModel(); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologySingleResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologySingleResource.java deleted file mode 100644 index 4ee5ec01c25d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologySingleResource.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The TopologySingleResource model. */ -@Immutable -public final class TopologySingleResource { - /* - * Azure resource id - */ - @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) - private String resourceId; - - /* - * The security severity of the resource - */ - @JsonProperty(value = "severity", access = JsonProperty.Access.WRITE_ONLY) - private String severity; - - /* - * Indicates if the resource has security recommendations - */ - @JsonProperty(value = "recommendationsExist", access = JsonProperty.Access.WRITE_ONLY) - private Boolean recommendationsExist; - - /* - * Indicates the resource connectivity level to the Internet (InternetFacing, Internal ,etc.) - */ - @JsonProperty(value = "networkZones", access = JsonProperty.Access.WRITE_ONLY) - private String networkZones; - - /* - * Score of the resource based on its security severity - */ - @JsonProperty(value = "topologyScore", access = JsonProperty.Access.WRITE_ONLY) - private Integer topologyScore; - - /* - * The location of this resource - */ - @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) - private String location; - - /* - * Azure resources connected to this resource which are in higher level in the topology view - */ - @JsonProperty(value = "parents", access = JsonProperty.Access.WRITE_ONLY) - private List parents; - - /* - * Azure resources connected to this resource which are in lower level in the topology view - */ - @JsonProperty(value = "children", access = JsonProperty.Access.WRITE_ONLY) - private List children; - - /** Creates an instance of TopologySingleResource class. */ - public TopologySingleResource() { - } - - /** - * Get the resourceId property: Azure resource id. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Get the severity property: The security severity of the resource. - * - * @return the severity value. - */ - public String severity() { - return this.severity; - } - - /** - * Get the recommendationsExist property: Indicates if the resource has security recommendations. - * - * @return the recommendationsExist value. - */ - public Boolean recommendationsExist() { - return this.recommendationsExist; - } - - /** - * Get the networkZones property: Indicates the resource connectivity level to the Internet (InternetFacing, - * Internal ,etc.). - * - * @return the networkZones value. - */ - public String networkZones() { - return this.networkZones; - } - - /** - * Get the topologyScore property: Score of the resource based on its security severity. - * - * @return the topologyScore value. - */ - public Integer topologyScore() { - return this.topologyScore; - } - - /** - * Get the location property: The location of this resource. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Get the parents property: Azure resources connected to this resource which are in higher level in the topology - * view. - * - * @return the parents value. - */ - public List parents() { - return this.parents; - } - - /** - * Get the children property: Azure resources connected to this resource which are in lower level in the topology - * view. - * - * @return the children value. - */ - public List children() { - return this.children; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (parents() != null) { - parents().forEach(e -> e.validate()); - } - if (children() != null) { - children().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologySingleResourceChild.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologySingleResourceChild.java deleted file mode 100644 index fc1d0c77fec5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologySingleResourceChild.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.fasterxml.jackson.annotation.JsonProperty; - -/** The TopologySingleResourceChild model. */ -@Immutable -public final class TopologySingleResourceChild { - /* - * Azure resource id which serves as child resource in topology view - */ - @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) - private String resourceId; - - /** Creates an instance of TopologySingleResourceChild class. */ - public TopologySingleResourceChild() { - } - - /** - * Get the resourceId property: Azure resource id which serves as child resource in topology view. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * 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/TopologySingleResourceParent.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologySingleResourceParent.java deleted file mode 100644 index 01ab584cedec..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TopologySingleResourceParent.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.fasterxml.jackson.annotation.JsonProperty; - -/** The TopologySingleResourceParent model. */ -@Immutable -public final class TopologySingleResourceParent { - /* - * Azure resource id which serves as parent resource in topology view - */ - @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) - private String resourceId; - - /** Creates an instance of TopologySingleResourceParent class. */ - public TopologySingleResourceParent() { - } - - /** - * Get the resourceId property: Azure resource id which serves as parent resource in topology view. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * 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/TrackedResource.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TrackedResource.java deleted file mode 100644 index f532595f99de..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TrackedResource.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.ProxyResource; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Describes an Azure tracked resource. */ -@Fluent -public final class TrackedResource extends ProxyResource { - /* - * Location where the resource is stored - */ - @JsonProperty(value = "location") - private String location; - - /* - * Kind of the resource - */ - @JsonProperty(value = "kind") - private String kind; - - /* - * Entity tag is used for comparing two or more entities from the same requested resource. - */ - @JsonProperty(value = "etag") - private String etag; - - /* - * 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; - - /** Creates an instance of TrackedResource class. */ - public TrackedResource() { - } - - /** - * Get the location property: Location where the resource is stored. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Location where the resource is stored. - * - * @param location the location value to set. - * @return the TrackedResource object itself. - */ - public TrackedResource withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the kind property: Kind of the resource. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Set the kind property: Kind of the resource. - * - * @param kind the kind value to set. - * @return the TrackedResource object itself. - */ - public TrackedResource withKind(String kind) { - this.kind = kind; - return this; - } - - /** - * Get the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: Entity tag is used for comparing two or more entities from the same requested resource. - * - * @param etag the etag value to set. - * @return the TrackedResource object itself. - */ - public TrackedResource withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the tags property: A list of key value pairs that describe the resource. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: A list of key value pairs that describe the resource. - * - * @param tags the tags value to set. - * @return the TrackedResource object itself. - */ - public TrackedResource 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/models/TransportProtocol.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TransportProtocol.java deleted file mode 100644 index b2ac09805755..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TransportProtocol.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for TransportProtocol. */ -public final class TransportProtocol extends ExpandableStringEnum { - /** Static value TCP for TransportProtocol. */ - public static final TransportProtocol TCP = fromString("TCP"); - - /** Static value UDP for TransportProtocol. */ - public static final TransportProtocol UDP = fromString("UDP"); - - /** - * Creates a new instance of TransportProtocol value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TransportProtocol() { - } - - /** - * Creates or finds a TransportProtocol from its string representation. - * - * @param name a name to look for. - * @return the corresponding TransportProtocol. - */ - @JsonCreator - public static TransportProtocol fromString(String name) { - return fromString(name, TransportProtocol.class); - } - - /** - * Gets known TransportProtocol values. - * - * @return known TransportProtocol values. - */ - public static Collection values() { - return values(TransportProtocol.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TwinUpdatesNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TwinUpdatesNotInAllowedRange.java deleted file mode 100644 index fd186fdaac67..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/TwinUpdatesNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of twin updates is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("TwinUpdatesNotInAllowedRange") -@Fluent -public final class TwinUpdatesNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of TwinUpdatesNotInAllowedRange class. */ - public TwinUpdatesNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public TwinUpdatesNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public TwinUpdatesNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public TwinUpdatesNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public TwinUpdatesNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/Type.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Type.java deleted file mode 100644 index 53ea14ac9730..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/Type.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. */ -public final class Type extends ExpandableStringEnum { - /** Static value Qualys for Type. */ - public static final Type QUALYS = fromString("Qualys"); - - /** Static value TVM for Type. */ - public static final Type TVM = fromString("TVM"); - - /** - * Creates a new instance of Type value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Type() { - } - - /** - * Creates or finds a Type from its string representation. - * - * @param name a name to look for. - * @return the corresponding Type. - */ - @JsonCreator - public static Type fromString(String name) { - return fromString(name, Type.class); - } - - /** - * Gets known Type values. - * - * @return known Type values. - */ - public static Collection values() { - return values(Type.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UnauthorizedOperationsNotInAllowedRange.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UnauthorizedOperationsNotInAllowedRange.java deleted file mode 100644 index 0616e1bafc5e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UnauthorizedOperationsNotInAllowedRange.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.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Number of unauthorized operations is not in allowed range. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "ruleType") -@JsonTypeName("UnauthorizedOperationsNotInAllowedRange") -@Fluent -public final class UnauthorizedOperationsNotInAllowedRange extends TimeWindowCustomAlertRule { - /** Creates an instance of UnauthorizedOperationsNotInAllowedRange class. */ - public UnauthorizedOperationsNotInAllowedRange() { - } - - /** {@inheritDoc} */ - @Override - public UnauthorizedOperationsNotInAllowedRange withTimeWindowSize(Duration timeWindowSize) { - super.withTimeWindowSize(timeWindowSize); - return this; - } - - /** {@inheritDoc} */ - @Override - public UnauthorizedOperationsNotInAllowedRange withMinThreshold(int minThreshold) { - super.withMinThreshold(minThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public UnauthorizedOperationsNotInAllowedRange withMaxThreshold(int maxThreshold) { - super.withMaxThreshold(maxThreshold); - return this; - } - - /** {@inheritDoc} */ - @Override - public UnauthorizedOperationsNotInAllowedRange withIsEnabled(boolean isEnabled) { - super.withIsEnabled(isEnabled); - 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/UnmaskedIpLoggingStatus.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UnmaskedIpLoggingStatus.java deleted file mode 100644 index b1888b57a29b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UnmaskedIpLoggingStatus.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Unmasked IP address logging status. */ -public final class UnmaskedIpLoggingStatus extends ExpandableStringEnum { - /** Static value Disabled for UnmaskedIpLoggingStatus. */ - public static final UnmaskedIpLoggingStatus DISABLED = fromString("Disabled"); - - /** Static value Enabled for UnmaskedIpLoggingStatus. */ - public static final UnmaskedIpLoggingStatus ENABLED = fromString("Enabled"); - - /** - * Creates a new instance of UnmaskedIpLoggingStatus value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public UnmaskedIpLoggingStatus() { - } - - /** - * Creates or finds a UnmaskedIpLoggingStatus from its string representation. - * - * @param name a name to look for. - * @return the corresponding UnmaskedIpLoggingStatus. - */ - @JsonCreator - public static UnmaskedIpLoggingStatus fromString(String name) { - return fromString(name, UnmaskedIpLoggingStatus.class); - } - - /** - * Gets known UnmaskedIpLoggingStatus values. - * - * @return known UnmaskedIpLoggingStatus values. - */ - public static Collection values() { - return values(UnmaskedIpLoggingStatus.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpdateIotSecuritySolutionData.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpdateIotSecuritySolutionData.java deleted file mode 100644 index 14365020975b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UpdateIotSecuritySolutionData.java +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.security.fluent.models.UpdateIoTSecuritySolutionProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** The UpdateIotSecuritySolutionData model. */ -@Fluent -public final class UpdateIotSecuritySolutionData extends TagsResource { - /* - * Security Solution data - */ - @JsonProperty(value = "properties") - private UpdateIoTSecuritySolutionProperties innerProperties; - - /** Creates an instance of UpdateIotSecuritySolutionData class. */ - public UpdateIotSecuritySolutionData() { - } - - /** - * Get the innerProperties property: Security Solution data. - * - * @return the innerProperties value. - */ - private UpdateIoTSecuritySolutionProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public UpdateIotSecuritySolutionData withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @return the userDefinedResources value. - */ - public UserDefinedResourcesProperties userDefinedResources() { - return this.innerProperties() == null ? null : this.innerProperties().userDefinedResources(); - } - - /** - * Set the userDefinedResources property: Properties of the IoT Security solution's user defined resources. - * - * @param userDefinedResources the userDefinedResources value to set. - * @return the UpdateIotSecuritySolutionData object itself. - */ - public UpdateIotSecuritySolutionData withUserDefinedResources(UserDefinedResourcesProperties userDefinedResources) { - if (this.innerProperties() == null) { - this.innerProperties = new UpdateIoTSecuritySolutionProperties(); - } - this.innerProperties().withUserDefinedResources(userDefinedResources); - return this; - } - - /** - * Get the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @return the recommendationsConfiguration value. - */ - public List recommendationsConfiguration() { - return this.innerProperties() == null ? null : this.innerProperties().recommendationsConfiguration(); - } - - /** - * Set the recommendationsConfiguration property: List of the configuration status for each recommendation type. - * - * @param recommendationsConfiguration the recommendationsConfiguration value to set. - * @return the UpdateIotSecuritySolutionData object itself. - */ - public UpdateIotSecuritySolutionData withRecommendationsConfiguration( - List recommendationsConfiguration) { - if (this.innerProperties() == null) { - this.innerProperties = new UpdateIoTSecuritySolutionProperties(); - } - this.innerProperties().withRecommendationsConfiguration(recommendationsConfiguration); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UserDefinedResourcesProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UserDefinedResourcesProperties.java deleted file mode 100644 index d9c6181af2af..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UserDefinedResourcesProperties.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Properties of the IoT Security solution's user defined resources. */ -@Fluent -public final class UserDefinedResourcesProperties { - /* - * Azure Resource Graph query which represents the security solution's user defined resources. Required to start - * with "where type != "Microsoft.Devices/IotHubs"" - */ - @JsonProperty(value = "query", required = true) - private String query; - - /* - * List of Azure subscription ids on which the user defined resources query should be executed. - */ - @JsonProperty(value = "querySubscriptions", required = true) - private List querySubscriptions; - - /** Creates an instance of UserDefinedResourcesProperties class. */ - public UserDefinedResourcesProperties() { - } - - /** - * Get the query property: Azure Resource Graph query which represents the security solution's user defined - * resources. Required to start with "where type != "Microsoft.Devices/IotHubs"". - * - * @return the query value. - */ - public String query() { - return this.query; - } - - /** - * Set the query property: Azure Resource Graph query which represents the security solution's user defined - * resources. Required to start with "where type != "Microsoft.Devices/IotHubs"". - * - * @param query the query value to set. - * @return the UserDefinedResourcesProperties object itself. - */ - public UserDefinedResourcesProperties withQuery(String query) { - this.query = query; - return this; - } - - /** - * Get the querySubscriptions property: List of Azure subscription ids on which the user defined resources query - * should be executed. - * - * @return the querySubscriptions value. - */ - public List querySubscriptions() { - return this.querySubscriptions; - } - - /** - * Set the querySubscriptions property: List of Azure subscription ids on which the user defined resources query - * should be executed. - * - * @param querySubscriptions the querySubscriptions value to set. - * @return the UserDefinedResourcesProperties object itself. - */ - public UserDefinedResourcesProperties withQuerySubscriptions(List querySubscriptions) { - this.querySubscriptions = querySubscriptions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (query() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property query in model UserDefinedResourcesProperties")); - } - if (querySubscriptions() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property querySubscriptions in model UserDefinedResourcesProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(UserDefinedResourcesProperties.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UserImpact.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UserImpact.java deleted file mode 100644 index 667c3dda24f4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UserImpact.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The user impact of the assessment. */ -public final class UserImpact extends ExpandableStringEnum { - /** Static value Low for UserImpact. */ - public static final UserImpact LOW = fromString("Low"); - - /** Static value Moderate for UserImpact. */ - public static final UserImpact MODERATE = fromString("Moderate"); - - /** Static value High for UserImpact. */ - public static final UserImpact HIGH = fromString("High"); - - /** - * Creates a new instance of UserImpact value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public UserImpact() { - } - - /** - * Creates or finds a UserImpact from its string representation. - * - * @param name a name to look for. - * @return the corresponding UserImpact. - */ - @JsonCreator - public static UserImpact fromString(String name) { - return fromString(name, UserImpact.class); - } - - /** - * Gets known UserImpact values. - * - * @return known UserImpact values. - */ - public static Collection values() { - return values(UserImpact.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UserRecommendation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UserRecommendation.java deleted file mode 100644 index 123fbc125618..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/UserRecommendation.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.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents a user that is recommended to be allowed for a certain rule. */ -@Fluent -public final class UserRecommendation { - /* - * Represents a user that is recommended to be allowed for a certain rule - */ - @JsonProperty(value = "username") - private String username; - - /* - * The recommendation action of the machine or rule - */ - @JsonProperty(value = "recommendationAction") - private RecommendationAction recommendationAction; - - /** Creates an instance of UserRecommendation class. */ - public UserRecommendation() { - } - - /** - * Get the username property: Represents a user that is recommended to be allowed for a certain rule. - * - * @return the username value. - */ - public String username() { - return this.username; - } - - /** - * Set the username property: Represents a user that is recommended to be allowed for a certain rule. - * - * @param username the username value to set. - * @return the UserRecommendation object itself. - */ - public UserRecommendation withUsername(String username) { - this.username = username; - return this; - } - - /** - * Get the recommendationAction property: The recommendation action of the machine or rule. - * - * @return the recommendationAction value. - */ - public RecommendationAction recommendationAction() { - return this.recommendationAction; - } - - /** - * Set the recommendationAction property: The recommendation action of the machine or rule. - * - * @param recommendationAction the recommendationAction value to set. - * @return the UserRecommendation object itself. - */ - public UserRecommendation withRecommendationAction(RecommendationAction recommendationAction) { - this.recommendationAction = recommendationAction; - 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/VaRule.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VaRule.java deleted file mode 100644 index bd8a503ceb35..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VaRule.java +++ /dev/null @@ -1,265 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** vulnerability assessment rule metadata details. */ -@Fluent -public final class VaRule { - /* - * The rule Id. - */ - @JsonProperty(value = "ruleId") - private String ruleId; - - /* - * The rule severity. - */ - @JsonProperty(value = "severity") - private RuleSeverity severity; - - /* - * The rule category. - */ - @JsonProperty(value = "category") - private String category; - - /* - * The rule type. - */ - @JsonProperty(value = "ruleType") - private RuleType ruleType; - - /* - * The rule title. - */ - @JsonProperty(value = "title") - private String title; - - /* - * The rule description. - */ - @JsonProperty(value = "description") - private String description; - - /* - * The rule rationale. - */ - @JsonProperty(value = "rationale") - private String rationale; - - /* - * The rule query details. - */ - @JsonProperty(value = "queryCheck") - private QueryCheck queryCheck; - - /* - * The benchmark references. - */ - @JsonProperty(value = "benchmarkReferences") - private List benchmarkReferences; - - /** Creates an instance of VaRule class. */ - public VaRule() { - } - - /** - * Get the ruleId property: The rule Id. - * - * @return the ruleId value. - */ - public String ruleId() { - return this.ruleId; - } - - /** - * Set the ruleId property: The rule Id. - * - * @param ruleId the ruleId value to set. - * @return the VaRule object itself. - */ - public VaRule withRuleId(String ruleId) { - this.ruleId = ruleId; - return this; - } - - /** - * Get the severity property: The rule severity. - * - * @return the severity value. - */ - public RuleSeverity severity() { - return this.severity; - } - - /** - * Set the severity property: The rule severity. - * - * @param severity the severity value to set. - * @return the VaRule object itself. - */ - public VaRule withSeverity(RuleSeverity severity) { - this.severity = severity; - return this; - } - - /** - * Get the category property: The rule category. - * - * @return the category value. - */ - public String category() { - return this.category; - } - - /** - * Set the category property: The rule category. - * - * @param category the category value to set. - * @return the VaRule object itself. - */ - public VaRule withCategory(String category) { - this.category = category; - return this; - } - - /** - * Get the ruleType property: The rule type. - * - * @return the ruleType value. - */ - public RuleType ruleType() { - return this.ruleType; - } - - /** - * Set the ruleType property: The rule type. - * - * @param ruleType the ruleType value to set. - * @return the VaRule object itself. - */ - public VaRule withRuleType(RuleType ruleType) { - this.ruleType = ruleType; - return this; - } - - /** - * Get the title property: The rule title. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Set the title property: The rule title. - * - * @param title the title value to set. - * @return the VaRule object itself. - */ - public VaRule withTitle(String title) { - this.title = title; - return this; - } - - /** - * Get the description property: The rule description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Set the description property: The rule description. - * - * @param description the description value to set. - * @return the VaRule object itself. - */ - public VaRule withDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the rationale property: The rule rationale. - * - * @return the rationale value. - */ - public String rationale() { - return this.rationale; - } - - /** - * Set the rationale property: The rule rationale. - * - * @param rationale the rationale value to set. - * @return the VaRule object itself. - */ - public VaRule withRationale(String rationale) { - this.rationale = rationale; - return this; - } - - /** - * Get the queryCheck property: The rule query details. - * - * @return the queryCheck value. - */ - public QueryCheck queryCheck() { - return this.queryCheck; - } - - /** - * Set the queryCheck property: The rule query details. - * - * @param queryCheck the queryCheck value to set. - * @return the VaRule object itself. - */ - public VaRule withQueryCheck(QueryCheck queryCheck) { - this.queryCheck = queryCheck; - return this; - } - - /** - * Get the benchmarkReferences property: The benchmark references. - * - * @return the benchmarkReferences value. - */ - public List benchmarkReferences() { - return this.benchmarkReferences; - } - - /** - * Set the benchmarkReferences property: The benchmark references. - * - * @param benchmarkReferences the benchmarkReferences value to set. - * @return the VaRule object itself. - */ - public VaRule withBenchmarkReferences(List benchmarkReferences) { - this.benchmarkReferences = benchmarkReferences; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (queryCheck() != null) { - queryCheck().validate(); - } - if (benchmarkReferences() != null) { - benchmarkReferences().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ValueType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ValueType.java deleted file mode 100644 index dd486682d0c1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/ValueType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** The value type of the items in the list. */ -public final class ValueType extends ExpandableStringEnum { - /** Static value IpCidr for ValueType. */ - public static final ValueType IP_CIDR = fromString("IpCidr"); - - /** Static value String for ValueType. */ - public static final ValueType STRING = fromString("String"); - - /** - * Creates a new instance of ValueType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ValueType() { - } - - /** - * Creates or finds a ValueType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ValueType. - */ - @JsonCreator - public static ValueType fromString(String name) { - return fromString(name, ValueType.class); - } - - /** - * Gets known ValueType values. - * - * @return known ValueType values. - */ - public static Collection values() { - return values(ValueType.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VendorReference.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VendorReference.java deleted file mode 100644 index 35e714f5c15d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VendorReference.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Vendor reference. */ -@Immutable -public final class VendorReference { - /* - * Link title - */ - @JsonProperty(value = "title", access = JsonProperty.Access.WRITE_ONLY) - private String title; - - /* - * Link url - */ - @JsonProperty(value = "link", access = JsonProperty.Access.WRITE_ONLY) - private String link; - - /** Creates an instance of VendorReference class. */ - public VendorReference() { - } - - /** - * Get the title property: Link title. - * - * @return the title value. - */ - public String title() { - return this.title; - } - - /** - * Get the link property: Link url. - * - * @return the link value. - */ - public String link() { - return this.link; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VmRecommendation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VmRecommendation.java deleted file mode 100644 index 2193a23ffee5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/VmRecommendation.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Represents a machine that is part of a machine group. */ -@Fluent -public final class VmRecommendation { - /* - * The configuration status of the machines group or machine or rule - */ - @JsonProperty(value = "configurationStatus") - private ConfigurationStatus configurationStatus; - - /* - * The recommendation action of the machine or rule - */ - @JsonProperty(value = "recommendationAction") - private RecommendationAction recommendationAction; - - /* - * The full resource id of the machine - */ - @JsonProperty(value = "resourceId") - private String resourceId; - - /* - * The machine supportability of Enforce feature - */ - @JsonProperty(value = "enforcementSupport") - private EnforcementSupport enforcementSupport; - - /** Creates an instance of VmRecommendation class. */ - public VmRecommendation() { - } - - /** - * Get the configurationStatus property: The configuration status of the machines group or machine or rule. - * - * @return the configurationStatus value. - */ - public ConfigurationStatus configurationStatus() { - return this.configurationStatus; - } - - /** - * Set the configurationStatus property: The configuration status of the machines group or machine or rule. - * - * @param configurationStatus the configurationStatus value to set. - * @return the VmRecommendation object itself. - */ - public VmRecommendation withConfigurationStatus(ConfigurationStatus configurationStatus) { - this.configurationStatus = configurationStatus; - return this; - } - - /** - * Get the recommendationAction property: The recommendation action of the machine or rule. - * - * @return the recommendationAction value. - */ - public RecommendationAction recommendationAction() { - return this.recommendationAction; - } - - /** - * Set the recommendationAction property: The recommendation action of the machine or rule. - * - * @param recommendationAction the recommendationAction value to set. - * @return the VmRecommendation object itself. - */ - public VmRecommendation withRecommendationAction(RecommendationAction recommendationAction) { - this.recommendationAction = recommendationAction; - return this; - } - - /** - * Get the resourceId property: The full resource id of the machine. - * - * @return the resourceId value. - */ - public String resourceId() { - return this.resourceId; - } - - /** - * Set the resourceId property: The full resource id of the machine. - * - * @param resourceId the resourceId value to set. - * @return the VmRecommendation object itself. - */ - public VmRecommendation withResourceId(String resourceId) { - this.resourceId = resourceId; - return this; - } - - /** - * Get the enforcementSupport property: The machine supportability of Enforce feature. - * - * @return the enforcementSupport value. - */ - public EnforcementSupport enforcementSupport() { - return this.enforcementSupport; - } - - /** - * Set the enforcementSupport property: The machine supportability of Enforce feature. - * - * @param enforcementSupport the enforcementSupport value to set. - * @return the VmRecommendation object itself. - */ - public VmRecommendation withEnforcementSupport(EnforcementSupport enforcementSupport) { - this.enforcementSupport = enforcementSupport; - 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/WorkspaceSetting.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/WorkspaceSetting.java deleted file mode 100644 index c6b7717a0ce0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/WorkspaceSetting.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; - -/** An immutable client-side representation of WorkspaceSetting. */ -public interface WorkspaceSetting { - /** - * 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 workspaceId property: The full Azure ID of the workspace to save the data in. - * - * @return the workspaceId value. - */ - String workspaceId(); - - /** - * Gets the scope property: All the VMs in this scope will send their security data to the mentioned workspace - * unless overridden by a setting with more specific scope. - * - * @return the scope value. - */ - String scope(); - - /** - * Gets the inner com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner object. - * - * @return the inner object. - */ - WorkspaceSettingInner innerModel(); - - /** The entirety of the WorkspaceSetting definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithCreate { - } - /** The WorkspaceSetting definition stages. */ - interface DefinitionStages { - /** The first stage of the WorkspaceSetting definition. */ - interface Blank extends WithCreate { - } - /** - * The stage of the WorkspaceSetting definition which contains all the minimum required properties for the - * resource to be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate extends DefinitionStages.WithWorkspaceId, DefinitionStages.WithScope { - /** - * Executes the create request. - * - * @return the created resource. - */ - WorkspaceSetting create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - WorkspaceSetting create(Context context); - } - /** The stage of the WorkspaceSetting definition allowing to specify workspaceId. */ - interface WithWorkspaceId { - /** - * Specifies the workspaceId property: The full Azure ID of the workspace to save the data in. - * - * @param workspaceId The full Azure ID of the workspace to save the data in. - * @return the next definition stage. - */ - WithCreate withWorkspaceId(String workspaceId); - } - /** The stage of the WorkspaceSetting definition allowing to specify scope. */ - interface WithScope { - /** - * Specifies the scope property: All the VMs in this scope will send their security data to the mentioned - * workspace unless overridden by a setting with more specific scope. - * - * @param scope All the VMs in this scope will send their security data to the mentioned workspace unless - * overridden by a setting with more specific scope. - * @return the next definition stage. - */ - WithCreate withScope(String scope); - } - } - /** - * Begins update for the WorkspaceSetting resource. - * - * @return the stage of resource update. - */ - WorkspaceSetting.Update update(); - - /** The template for WorkspaceSetting update. */ - interface Update extends UpdateStages.WithWorkspaceId, UpdateStages.WithScope { - /** - * Executes the update request. - * - * @return the updated resource. - */ - WorkspaceSetting apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - WorkspaceSetting apply(Context context); - } - /** The WorkspaceSetting update stages. */ - interface UpdateStages { - /** The stage of the WorkspaceSetting update allowing to specify workspaceId. */ - interface WithWorkspaceId { - /** - * Specifies the workspaceId property: The full Azure ID of the workspace to save the data in. - * - * @param workspaceId The full Azure ID of the workspace to save the data in. - * @return the next definition stage. - */ - Update withWorkspaceId(String workspaceId); - } - /** The stage of the WorkspaceSetting update allowing to specify scope. */ - interface WithScope { - /** - * Specifies the scope property: All the VMs in this scope will send their security data to the mentioned - * workspace unless overridden by a setting with more specific scope. - * - * @param scope All the VMs in this scope will send their security data to the mentioned workspace unless - * overridden by a setting with more specific scope. - * @return the next definition stage. - */ - Update withScope(String scope); - } - } - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - WorkspaceSetting refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - WorkspaceSetting refresh(Context context); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/WorkspaceSettingList.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/WorkspaceSettingList.java deleted file mode 100644 index 9e0e746cc148..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/WorkspaceSettingList.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** List of workspace settings response. */ -@Fluent -public final class WorkspaceSettingList { - /* - * List of workspace settings - */ - @JsonProperty(value = "value", required = true) - private List value; - - /* - * The URI to fetch the next page. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of WorkspaceSettingList class. */ - public WorkspaceSettingList() { - } - - /** - * Get the value property: List of workspace settings. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of workspace settings. - * - * @param value the value value to set. - * @return the WorkspaceSettingList object itself. - */ - public WorkspaceSettingList withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URI to fetch the next page. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model WorkspaceSettingList")); - } else { - value().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(WorkspaceSettingList.class); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/WorkspaceSettings.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/WorkspaceSettings.java deleted file mode 100644 index 64356c81191b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/WorkspaceSettings.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.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 WorkspaceSettings. */ -public interface WorkspaceSettings { - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of workspace settings response as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Context context); - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - Response getWithResponse(String workspaceSettingName, Context context); - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope. - */ - WorkspaceSetting get(String workspaceSettingName); - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteWithResponse(String workspaceSettingName, Context context); - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param workspaceSettingName Name of the security setting. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void delete(String workspaceSettingName); - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - WorkspaceSetting getById(String id); - - /** - * Settings about where we should store your security data and logs. If the result is empty, it means that no - * custom-workspace configuration was set. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return configures where to store the OMS agent data for workspaces under a scope along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param id the resource ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - void deleteById(String id); - - /** - * Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - * - * @param id the resource ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new WorkspaceSetting resource. - * - * @param name resource name. - * @return the first stage of the new WorkspaceSetting definition. - */ - WorkspaceSetting.DefinitionStages.Blank define(String name); -} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/package-info.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/package-info.java deleted file mode 100644 index 943e22f5f4e2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the data models for SecurityCenter. API spec for Microsoft.Security (Azure Security Center) - * resource provider. - */ -package com.azure.resourcemanager.security.models; diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/package-info.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/package-info.java deleted file mode 100644 index 2460d9cab797..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** - * Package containing the classes for SecurityCenter. API spec for Microsoft.Security (Azure Security Center) resource - * provider. - */ -package com.azure.resourcemanager.security; diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/module-info.java b/sdk/security/azure-resourcemanager-security/src/main/java/module-info.java deleted file mode 100644 index e8cd2102d160..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/main/java/module-info.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. - -module com.azure.resourcemanager.security { - requires transitive com.azure.core.management; - - exports com.azure.resourcemanager.security; - exports com.azure.resourcemanager.security.fluent; - exports com.azure.resourcemanager.security.fluent.models; - exports com.azure.resourcemanager.security.models; - - opens com.azure.resourcemanager.security.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.security.models to - com.azure.core, - com.fasterxml.jackson.databind; -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteSamples.java deleted file mode 100644 index 7dad0c29f87f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for AdaptiveApplicationControls Delete. */ -public final class AdaptiveApplicationControlsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/DeleteAdaptiveApplicationControls_example.json - */ - /** - * Sample code: Delete an application control machine group. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteAnApplicationControlMachineGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .adaptiveApplicationControls() - .deleteByResourceGroupWithResponse("centralus", "GROUP1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetSamples.java deleted file mode 100644 index c7c0a57ce429..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for AdaptiveApplicationControls Get. */ -public final class AdaptiveApplicationControlsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/GetAdaptiveApplicationControlsGroup_example.json - */ - /** - * Sample code: Gets a configured application control VM/server group. - * - * @param manager Entry point to SecurityManager. - */ - public static void getsAConfiguredApplicationControlVMServerGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .adaptiveApplicationControls() - .getWithResponse("centralus", "ERELGROUP1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListSamples.java deleted file mode 100644 index f10d7ae3dbbc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for AdaptiveApplicationControls List. */ -public final class AdaptiveApplicationControlsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/GetAdaptiveApplicationControlsSubscription_example.json - */ - /** - * Sample code: Gets a list of application control groups of machines for the subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getsAListOfApplicationControlGroupsOfMachinesForTheSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.adaptiveApplicationControls().listWithResponse(true, false, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutSamples.java deleted file mode 100644 index 978819ba310b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutSamples.java +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -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 { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/PutAdaptiveApplicationControls_example.json - */ - /** - * Sample code: Update an application control machine group by adding a new application. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateAnApplicationControlMachineGroupByAddingANewApplication( - com.azure.resourcemanager.security.SecurityManager manager) { - AdaptiveApplicationControlGroup resource = - manager - .adaptiveApplicationControls() - .getWithResponse("centralus", "ERELGROUP1", com.azure.core.util.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/generated/AdaptiveNetworkHardeningsEnforceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceSamples.java deleted file mode 100644 index 69905511b7b9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceSamples.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningEnforceRequest; -import com.azure.resourcemanager.security.models.Direction; -import com.azure.resourcemanager.security.models.Rule; -import com.azure.resourcemanager.security.models.TransportProtocol; -import java.util.Arrays; - -/** Samples for AdaptiveNetworkHardenings Enforce. */ -public final class AdaptiveNetworkHardeningsEnforceSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/EnforceAdaptiveNetworkHardeningRules_example.json - */ - /** - * Sample code: Enforces the given rules on the NSG(s) listed in the request. - * - * @param manager Entry point to SecurityManager. - */ - public static void enforcesTheGivenRulesOnTheNSGSListedInTheRequest( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .adaptiveNetworkHardenings() - .enforce( - "rg1", - "Microsoft.Compute", - "virtualMachines", - "vm1", - "default", - new AdaptiveNetworkHardeningEnforceRequest() - .withRules( - Arrays - .asList( - new Rule() - .withName("rule1") - .withDirection(Direction.INBOUND) - .withDestinationPort(3389) - .withProtocols(Arrays.asList(TransportProtocol.TCP)) - .withIpAddresses(Arrays.asList("100.10.1.1", "200.20.2.2", "81.199.3.0/24")), - new Rule() - .withName("rule2") - .withDirection(Direction.INBOUND) - .withDestinationPort(22) - .withProtocols(Arrays.asList(TransportProtocol.TCP)) - .withIpAddresses(Arrays.asList()))) - .withNetworkSecurityGroups( - Arrays - .asList( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1", - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg2")), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetSamples.java deleted file mode 100644 index d14b4b39face..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for AdaptiveNetworkHardenings Get. */ -public final class AdaptiveNetworkHardeningsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/GetAdaptiveNetworkHardening_example.json - */ - /** - * Sample code: Get a single Adaptive Network Hardening resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void getASingleAdaptiveNetworkHardeningResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .adaptiveNetworkHardenings() - .getWithResponse( - "rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java deleted file mode 100644 index 32fd0bdd4930..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for AdaptiveNetworkHardenings ListByExtendedResource. */ -public final class AdaptiveNetworkHardeningsListByExtendedResourceSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/ListByExtendedResourceAdaptiveNetworkHardenings_example.json - */ - /** - * Sample code: List Adaptive Network Hardenings resources of an extended resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void listAdaptiveNetworkHardeningsResourcesOfAnExtendedResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .adaptiveNetworkHardenings() - .listByExtendedResource( - "rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionCreateSamples.java deleted file mode 100644 index 887a4ffcae15..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionCreateSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for AdvancedThreatProtection Create. */ -public final class AdvancedThreatProtectionCreateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/PutAdvancedThreatProtectionSettings_example.json - */ - /** - * Sample code: Creates or updates the Advanced Threat Protection settings on a specified resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void createsOrUpdatesTheAdvancedThreatProtectionSettingsOnASpecifiedResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .advancedThreatProtections() - .define() - .withExistingResourceId( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount") - .withIsEnabled(true) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionGetSamples.java deleted file mode 100644 index 07fdc03ea975..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for AdvancedThreatProtection Get. */ -public final class AdvancedThreatProtectionGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/GetAdvancedThreatProtectionSettings_example.json - */ - /** - * Sample code: Gets the Advanced Threat Protection settings for the specified resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void getsTheAdvancedThreatProtectionSettingsForTheSpecifiedResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .advancedThreatProtections() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetResourceGroupLevelSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetResourceGroupLevelSamples.java deleted file mode 100644 index 952df50d555a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetResourceGroupLevelSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Alerts GetResourceGroupLevel. */ -public final class AlertsGetResourceGroupLevelSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertResourceGroupLocation_example.json - */ - /** - * Sample code: Get security alert on a resource group from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityAlertOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .getResourceGroupLevelWithResponse( - "myRg1", - "westeurope", - "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetSubscriptionLevelSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetSubscriptionLevelSamples.java deleted file mode 100644 index 9f7423043677..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsGetSubscriptionLevelSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Alerts GetSubscriptionLevel. */ -public final class AlertsGetSubscriptionLevelSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertSubscriptionLocation_example.json - */ - /** - * Sample code: Get security alert on a subscription from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityAlertOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .getSubscriptionLevelWithResponse( - "westeurope", - "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListByResourceGroupSamples.java deleted file mode 100644 index 60d9a3ab767a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListByResourceGroupSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Alerts ListByResourceGroup. */ -public final class AlertsListByResourceGroupSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsResourceGroup_example.json - */ - /** - * Sample code: Get security alerts on a resource group. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityAlertsOnAResourceGroup(com.azure.resourcemanager.security.SecurityManager manager) { - manager.alerts().listByResourceGroup("myRg1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListResourceGroupLevelByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListResourceGroupLevelByRegionSamples.java deleted file mode 100644 index 05ab47528d2a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Alerts ListResourceGroupLevelByRegion. */ -public final class AlertsListResourceGroupLevelByRegionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsResourceGroupLocation_example.json - */ - /** - * Sample code: Get security alerts on a resource group from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityAlertsOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.alerts().listResourceGroupLevelByRegion("westeurope", "myRg1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSamples.java deleted file mode 100644 index 7c54817f6302..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Alerts List. */ -public final class AlertsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsSubscription_example.json - */ - /** - * Sample code: Get security alerts on a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityAlertsOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.alerts().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSubscriptionLevelByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsListSubscriptionLevelByRegionSamples.java deleted file mode 100644 index c65e44da04b3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Alerts ListSubscriptionLevelByRegion. */ -public final class AlertsListSubscriptionLevelByRegionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsSubscriptionsLocation_example.json - */ - /** - * Sample code: Get security alerts on a subscription from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityAlertsOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.alerts().listSubscriptionLevelByRegion("westeurope", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSimulateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSimulateSamples.java deleted file mode 100644 index cebb570236a8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSimulateSamples.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.AlertSimulatorBundlesRequestProperties; -import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; -import com.azure.resourcemanager.security.models.BundleType; -import java.util.Arrays; - -/** Samples for Alerts Simulate. */ -public final class AlertsSimulateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/SimulateAlerts_example.json - */ - /** - * Sample code: Simulate security alerts on a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void simulateSecurityAlertsOnASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .simulate( - "centralus", - new AlertSimulatorRequestBody() - .withProperties( - new AlertSimulatorBundlesRequestProperties() - .withBundles( - Arrays - .asList( - BundleType.APP_SERVICES, - BundleType.DNS, - BundleType.KEY_VAULTS, - BundleType.KUBERNETES_SERVICE, - BundleType.RESOURCE_MANAGER, - BundleType.SQL_SERVERS, - BundleType.STORAGE_ACCOUNTS, - BundleType.VIRTUAL_MACHINES, - BundleType.COSMOS_DBS))), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteSamples.java deleted file mode 100644 index 569975501b14..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for AlertsSuppressionRules Delete. */ -public final class AlertsSuppressionRulesDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/DeleteAlertsSuppressionRule_example.json - */ - /** - * Sample code: Delete suppression rule data for a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteSuppressionRuleDataForASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.alertsSuppressionRules().deleteWithResponse("dismissIpAnomalyAlerts", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetSamples.java deleted file mode 100644 index c846ef735847..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for AlertsSuppressionRules Get. */ -public final class AlertsSuppressionRulesGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRule_example.json - */ - /** - * Sample code: Get suppression alert rule for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSuppressionAlertRuleForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.alertsSuppressionRules().getWithResponse("dismissIpAnomalyAlerts", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListSamples.java deleted file mode 100644 index a38d3a433c1f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListSamples.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for AlertsSuppressionRules List. */ -public final class AlertsSuppressionRulesListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRules_example.json - */ - /** - * Sample code: Get suppression rules for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSuppressionRulesForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.alertsSuppressionRules().list(null, com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRulesWithAlertType_example.json - */ - /** - * Sample code: Get suppression alert rule for subscription, filtered by AlertType. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSuppressionAlertRuleForSubscriptionFilteredByAlertType( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.alertsSuppressionRules().list("IpAnomaly", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java deleted file mode 100644 index ec5c5a7887c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateSamples.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.ScopeElement; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for AlertsSuppressionRules Update. */ -public final class AlertsSuppressionRulesUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/PutAlertsSuppressionRule_example.json - */ - /** - * Sample code: Update or create suppression rule for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateOrCreateSuppressionRuleForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) throws IOException { - manager - .alertsSuppressionRules() - .updateWithResponse( - "dismissIpAnomalyAlerts", - new AlertsSuppressionRuleInner() - .withAlertType("IpAnomaly") - .withExpirationDateUtc(OffsetDateTime.parse("2019-12-01T19:50:47.083633Z")) - .withReason("FalsePositive") - .withState(RuleState.ENABLED) - .withComment("Test VM") - .withSuppressionAlertsScope( - new SuppressionAlertsScope() - .withAllOf( - Arrays - .asList( - new ScopeElement() - .withField("entities.ip.address") - .withAdditionalProperties( - mapOf( - "in", - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "[\"104.215.95.187\",\"52.164.206.56\"]", - Object.class, - SerializerEncoding.JSON))), - new ScopeElement() - .withField("entities.process.commandline") - .withAdditionalProperties(mapOf("contains", "POWERSHELL.EXE"))))), - com.azure.core.util.Context.NONE); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateSamples.java deleted file mode 100644 index 790c4c6bfce9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Alerts UpdateResourceGroupLevelStateToActivate. */ -public final class AlertsUpdateResourceGroupLevelStateToActivateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_activate_example.json - */ - /** - * Sample code: Update security alert state on a resource group from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateResourceGroupLevelStateToActivateWithResponse( - "myRg2", - "westeurope", - "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissSamples.java deleted file mode 100644 index f241dcebf3c6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Alerts UpdateResourceGroupLevelStateToDismiss. */ -public final class AlertsUpdateResourceGroupLevelStateToDismissSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_dismiss_example.json - */ - /** - * Sample code: Update security alert state on a resource group from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateResourceGroupLevelStateToDismissWithResponse( - "myRg2", - "westeurope", - "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressSamples.java deleted file mode 100644 index 40ecdf0a423b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Alerts UpdateResourceGroupLevelStateToInProgress. */ -public final class AlertsUpdateResourceGroupLevelStateToInProgressSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_inProgress_example.json - */ - /** - * Sample code: Update security alert state on a resource group from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateResourceGroupLevelStateToInProgressWithResponse( - "myRg2", - "westeurope", - "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveSamples.java deleted file mode 100644 index 6cdc7da26390..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Alerts UpdateResourceGroupLevelStateToResolve. */ -public final class AlertsUpdateResourceGroupLevelStateToResolveSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_resolve_example.json - */ - /** - * Sample code: Update security alert state on a resource group from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateSecurityAlertStateOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateResourceGroupLevelStateToResolveWithResponse( - "myRg2", - "westeurope", - "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateSamples.java deleted file mode 100644 index 3a3688aaa059..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Alerts UpdateSubscriptionLevelStateToActivate. */ -public final class AlertsUpdateSubscriptionLevelStateToActivateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_activate_example.json - */ - /** - * Sample code: Update security alert state on a subscription from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateSubscriptionLevelStateToActivateWithResponse( - "westeurope", - "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissSamples.java deleted file mode 100644 index 36390c329158..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Alerts UpdateSubscriptionLevelStateToDismiss. */ -public final class AlertsUpdateSubscriptionLevelStateToDismissSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_dismiss_example.json - */ - /** - * Sample code: Update security alert state on a subscription from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateSubscriptionLevelStateToDismissWithResponse( - "westeurope", - "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressSamples.java deleted file mode 100644 index 91aa9435bf83..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Alerts UpdateSubscriptionLevelStateToInProgress. */ -public final class AlertsUpdateSubscriptionLevelStateToInProgressSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_inProgress_example.json - */ - /** - * Sample code: Update security alert state on a subscription from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateSubscriptionLevelStateToInProgressWithResponse( - "westeurope", - "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveSamples.java deleted file mode 100644 index 824aaf51e636..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Alerts UpdateSubscriptionLevelStateToResolve. */ -public final class AlertsUpdateSubscriptionLevelStateToResolveSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_resolve_example.json - */ - /** - * Sample code: Update security alert state on a subscription from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateSecurityAlertStateOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .alerts() - .updateSubscriptionLevelStateToResolveWithResponse( - "westeurope", - "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetSamples.java deleted file mode 100644 index 0f2261cdc99f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.ConnectionType; - -/** Samples for AllowedConnections Get. */ -public final class AllowedConnectionsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnections_example.json - */ - /** - * Sample code: Get allowed connections. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAllowedConnections(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .allowedConnections() - .getWithResponse("myResourceGroup", "centralus", ConnectionType.INTERNAL, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionSamples.java deleted file mode 100644 index c23bc1bb5ae7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for AllowedConnections ListByHomeRegion. */ -public final class AllowedConnectionsListByHomeRegionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscriptionLocation_example.json - */ - /** - * Sample code: Get allowed connections on a subscription from security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAllowedConnectionsOnASubscriptionFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.allowedConnections().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListSamples.java deleted file mode 100644 index be7943d2ab12..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for AllowedConnections List. */ -public final class AllowedConnectionsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscription_example.json - */ - /** - * Sample code: Get allowed connections on a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAllowedConnectionsOnASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.allowedConnections().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionGetSamples.java deleted file mode 100644 index 91a9efb5966e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for ApiCollection Get. */ -public final class ApiCollectionGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollection_Get_example.json - */ - /** - * Sample code: Gets an Azure API Management API if it has been onboarded to Defender for APIs. - * - * @param manager Entry point to SecurityManager. - */ - public static void getsAnAzureAPIManagementAPIIfItHasBeenOnboardedToDefenderForAPIs( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollections().getWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionListSamples.java deleted file mode 100644 index 2dcb3c2a2e38..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for ApiCollection List. */ -public final class ApiCollectionListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollection_List_example.json - */ - /** - * Sample code: Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. - * - * @param manager Entry point to SecurityManager. - */ - public static void getsAListOfAzureAPIManagementAPIsThatHaveBeenOnboardedToDefenderForAPIs( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.apiCollections().list("rg1", "apimService1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingDeleteSamples.java deleted file mode 100644 index cd679b4b46aa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingDeleteSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for ApiCollectionOffboarding Delete. */ -public final class ApiCollectionOffboardingDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollectionOffboarding_Delete_example.json - */ - /** - * Sample code: Delete a security recommendation task on a resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteASecurityRecommendationTaskOnAResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .apiCollectionOffboardings() - .deleteWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingCreateSamples.java deleted file mode 100644 index 14342e5bb6eb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingCreateSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for ApiCollectionOnboarding Create. */ -public final class ApiCollectionOnboardingCreateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollectionOnboarding_Create_example.json - */ - /** - * Sample code: Onboard an Azure API Management API to Defender for APIs. - * - * @param manager Entry point to SecurityManager. - */ - public static void onboardAnAzureAPIManagementAPIToDefenderForAPIs( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .apiCollectionOnboardings() - .createWithResponse("rg1", "apimService1", "echo-api", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationCreateOrUpdateSamples.java deleted file mode 100644 index 2253d02a578a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationCreateOrUpdateSamples.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.io.IOException; -import java.util.Arrays; - -/** Samples for ApplicationOperation CreateOrUpdate. */ -public final class ApplicationOperationCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/PutApplication_example.json - */ - /** - * Sample code: Create application. - * - * @param manager Entry point to SecurityManager. - */ - public static void createApplication(com.azure.resourcemanager.security.SecurityManager manager) - throws IOException { - manager - .applicationOperations() - .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") - .withDisplayName("Admin's application") - .withDescription("An application on critical recommendations") - .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) - .withConditionSets( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"contains\",\"property\":\"$.Id\",\"value\":\"-bil-\"}]}", - Object.class, - SerializerEncoding.JSON))) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationDeleteSamples.java deleted file mode 100644 index b5240718d70d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for ApplicationOperation Delete. */ -public final class ApplicationOperationDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/DeleteApplication_example.json - */ - /** - * Sample code: Delete security Application. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteSecurityApplication(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .applicationOperations() - .deleteWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationGetSamples.java deleted file mode 100644 index 7254278291e1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationOperationGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for ApplicationOperation Get. */ -public final class ApplicationOperationGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/GetApplication_example.json - */ - /** - * Sample code: Get security application by specific applicationId. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityApplicationBySpecificApplicationId( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .applicationOperations() - .getWithResponse("ad9a8e26-29d9-4829-bb30-e597a58cdbb8", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsListSamples.java deleted file mode 100644 index f3c3cd97e2c5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ApplicationsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Applications List. */ -public final class ApplicationsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ListBySubscriptionApplications_example.json - */ - /** - * Sample code: List applications security by subscription level scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void listApplicationsSecurityBySubscriptionLevelScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.applications().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsCreateOrUpdateSamples.java deleted file mode 100644 index 8902de2fa7f1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsCreateOrUpdateSamples.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.AssessmentStatus; -import com.azure.resourcemanager.security.models.AssessmentStatusCode; -import com.azure.resourcemanager.security.models.AzureResourceDetails; - -/** Samples for Assessments CreateOrUpdate. */ -public final class AssessmentsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/PutAssessment_example.json - */ - /** - * Sample code: Create security recommendation task on a resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void createSecurityRecommendationTaskOnAResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessments() - .define("8bb8be0a-6010-4789-812f-e4d661c4ed0e") - .withExistingResourceId( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2") - .withStatus(new AssessmentStatus().withCode(AssessmentStatusCode.HEALTHY)) - .withResourceDetails(new AzureResourceDetails()) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteSamples.java deleted file mode 100644 index 2e0f60dde9d0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Assessments Delete. */ -public final class AssessmentsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/DeleteAssessment_example.json - */ - /** - * Sample code: Delete a security recommendation task on a resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteASecurityRecommendationTaskOnAResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessments() - .deleteByResourceGroupWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", - "8bb8be0a-6010-4789-812f-e4d661c4ed0e", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsGetSamples.java deleted file mode 100644 index a81c28cd3e70..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsGetSamples.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.ExpandEnum; - -/** Samples for Assessments Get. */ -public final class AssessmentsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessmentWithExpand_example.json - */ - /** - * Sample code: Get security recommendation task from security data location with expand parameter. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityRecommendationTaskFromSecurityDataLocationWithExpandParameter( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessments() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", - "21300918-b2e3-0346-785f-c77ff57d243b", - ExpandEnum.LINKS, - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessment_example.json - */ - /** - * Sample code: Get security recommendation task from security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityRecommendationTaskFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessments() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", - "21300918-b2e3-0346-785f-c77ff57d243b", - null, - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsListSamples.java deleted file mode 100644 index fddca63d4426..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Assessments List. */ -public final class AssessmentsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/ListAssessments_example.json - */ - /** - * Sample code: List security assessments. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityAssessments(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessments() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataCreateInSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataCreateInSubscriptionSamples.java deleted file mode 100644 index 92c27d05bdb6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataCreateInSubscriptionSamples.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.AssessmentType; -import com.azure.resourcemanager.security.models.Categories; -import com.azure.resourcemanager.security.models.ImplementationEffort; -import com.azure.resourcemanager.security.models.Severity; -import com.azure.resourcemanager.security.models.Threats; -import com.azure.resourcemanager.security.models.UserImpact; -import java.util.Arrays; - -/** Samples for AssessmentsMetadata CreateInSubscription. */ -public final class AssessmentsMetadataCreateInSubscriptionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/CreateAssessmentsMetadata_subscription_example.json - */ - /** - * Sample code: Create security assessment metadata for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void createSecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessmentsMetadatas() - .define("ca039e75-a276-4175-aebc-bcd41e4b14b7") - .withDisplayName("Install endpoint protection solution on virtual machine scale sets") - .withDescription( - "Install an endpoint protection solution on your virtual machines scale sets, to protect them from" - + " threats and vulnerabilities.") - .withRemediationDescription( - "To install an endpoint protection solution: 1. Follow" - + " the instructions in How do I turn on antimalware in my virtual machine scale set") - .withCategories(Arrays.asList(Categories.COMPUTE)) - .withSeverity(Severity.MEDIUM) - .withUserImpact(UserImpact.LOW) - .withImplementationEffort(ImplementationEffort.LOW) - .withThreats(Arrays.asList(Threats.DATA_EXFILTRATION, Threats.DATA_SPILLAGE, Threats.MALICIOUS_INSIDER)) - .withAssessmentType(AssessmentType.CUSTOMER_MANAGED) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataDeleteInSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataDeleteInSubscriptionSamples.java deleted file mode 100644 index 63884b1c80c3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for AssessmentsMetadata DeleteInSubscription. */ -public final class AssessmentsMetadataDeleteInSubscriptionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/DeleteAssessmentsMetadata_subscription_example.json - */ - /** - * Sample code: Delete a security assessment metadata for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteASecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessmentsMetadatas() - .deleteInSubscriptionWithResponse("ca039e75-a276-4175-aebc-bcd41e4b14b7", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetInSubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetInSubscriptionSamples.java deleted file mode 100644 index 0f7e228b9cc2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for AssessmentsMetadata GetInSubscription. */ -public final class AssessmentsMetadataGetInSubscriptionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json - */ - /** - * Sample code: Get security assessment metadata for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessmentsMetadatas() - .getInSubscriptionWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetSamples.java deleted file mode 100644 index 2ea20e106553..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for AssessmentsMetadata Get. */ -public final class AssessmentsMetadataGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json - */ - /** - * Sample code: Get security assessment metadata. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityAssessmentMetadata(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .assessmentsMetadatas() - .getWithResponse("21300918-b2e3-0346-785f-c77ff57d243b", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListBySubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListBySubscriptionSamples.java deleted file mode 100644 index 529cd708667e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for AssessmentsMetadata ListBySubscription. */ -public final class AssessmentsMetadataListBySubscriptionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json - */ - /** - * Sample code: List security assessment metadata for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityAssessmentMetadataForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.assessmentsMetadatas().listBySubscription(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListSamples.java deleted file mode 100644 index 0f6d1e92fab4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AssessmentsMetadataListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for AssessmentsMetadata List. */ -public final class AssessmentsMetadataListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json - */ - /** - * Sample code: List security assessment metadata. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityAssessmentMetadata(com.azure.resourcemanager.security.SecurityManager manager) { - manager.assessmentsMetadatas().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateSamples.java deleted file mode 100644 index 3be32ccad5fc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.AutoProvision; - -/** Samples for AutoProvisioningSettings Create. */ -public final class AutoProvisioningSettingsCreateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/CreateAutoProvisioningSettingsSubscription_example.json - */ - /** - * Sample code: Create auto provisioning settings for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void createAutoProvisioningSettingsForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.autoProvisioningSettings().define("default").withAutoProvision(AutoProvision.ON).create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetSamples.java deleted file mode 100644 index 2e2d1d057a8d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for AutoProvisioningSettings Get. */ -public final class AutoProvisioningSettingsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/GetAutoProvisioningSettingSubscription_example.json - */ - /** - * Sample code: Get an auto provisioning setting for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAnAutoProvisioningSettingForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.autoProvisioningSettings().getWithResponse("default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListSamples.java deleted file mode 100644 index 542c3c285e85..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for AutoProvisioningSettings List. */ -public final class AutoProvisioningSettingsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/GetAutoProvisioningSettingsSubscription_example.json - */ - /** - * Sample code: Get auto provisioning settings for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAutoProvisioningSettingsForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.autoProvisioningSettings().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.java deleted file mode 100644 index 7d93c4568637..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateSamples.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.generated; - -import com.azure.resourcemanager.security.models.AutomationActionLogicApp; -import com.azure.resourcemanager.security.models.AutomationRuleSet; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.azure.resourcemanager.security.models.AutomationTriggeringRule; -import com.azure.resourcemanager.security.models.EventSource; -import com.azure.resourcemanager.security.models.Operator; -import com.azure.resourcemanager.security.models.PropertyType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Automations CreateOrUpdate. */ -public final class AutomationsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutAutomationAllAssessments_example.json - */ - /** - * Sample code: Create or update a security automation for all assessments (including all severities). - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateASecurityAutomationForAllAssessmentsIncludingAllSeverities( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .automations() - .define("exampleAutomation") - .withRegion("Central US") - .withExistingResourceGroup("exampleResourceGroup") - .withTags(mapOf()) - .withDescription( - "An example of a security automation that triggers one LogicApp resource (myTest1) on any security" - + " assessment") - .withIsEnabled(true) - .withScopes( - Arrays - .asList( - new AutomationScope() - .withDescription( - "A description that helps to identify this scope - for example: security assessments" - + " that relate to the resource group myResourceGroup within the subscription" - + " a5caac9c-5c04-49af-b3d0-e204f40345d5") - .withScopePath( - "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) - .withSources(Arrays.asList(new AutomationSource().withEventSource(EventSource.ASSESSMENTS))) - .withActions( - Arrays - .asList( - new AutomationActionLogicApp() - .withLogicAppResourceId( - "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri("https://exampleTriggerUri1.com"))) - .create(); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutDisableAutomation_example.json - */ - /** - * Sample code: Disable or enable a security automation. - * - * @param manager Entry point to SecurityManager. - */ - public static void disableOrEnableASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .automations() - .define("exampleAutomation") - .withRegion("Central US") - .withExistingResourceGroup("exampleResourceGroup") - .withTags(mapOf()) - .withDescription( - "An example of a security automation that triggers one LogicApp resource (myTest1) on any security" - + " assessment of type customAssessment") - .withIsEnabled(false) - .withScopes( - Arrays - .asList( - new AutomationScope() - .withDescription( - "A description that helps to identify this scope - for example: security assessments" - + " that relate to the resource group myResourceGroup within the subscription" - + " a5caac9c-5c04-49af-b3d0-e204f40345d5") - .withScopePath( - "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) - .withSources( - Arrays - .asList( - new AutomationSource() - .withEventSource(EventSource.ASSESSMENTS) - .withRuleSets( - Arrays - .asList( - new AutomationRuleSet() - .withRules( - Arrays - .asList( - new AutomationTriggeringRule() - .withPropertyJPath("$.Entity.AssessmentType") - .withPropertyType(PropertyType.STRING) - .withExpectedValue("customAssessment") - .withOperator(Operator.EQUALS))))))) - .withActions( - Arrays - .asList( - new AutomationActionLogicApp() - .withLogicAppResourceId( - "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri("https://exampleTriggerUri1.com"))) - .create(); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutAutomationHighSeverityAssessments_example.json - */ - /** - * Sample code: Create or update a security automation for all high severity assessments. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateASecurityAutomationForAllHighSeverityAssessments( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .automations() - .define("exampleAutomation") - .withRegion("Central US") - .withExistingResourceGroup("exampleResourceGroup") - .withTags(mapOf()) - .withDescription( - "An example of a security automation that triggers one LogicApp resource (myTest1) on any high severity" - + " security assessment") - .withIsEnabled(true) - .withScopes( - Arrays - .asList( - new AutomationScope() - .withDescription( - "A description that helps to identify this scope - for example: security assessments" - + " that relate to the resource group myResourceGroup within the subscription" - + " a5caac9c-5c04-49af-b3d0-e204f40345d5") - .withScopePath( - "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) - .withSources( - Arrays - .asList( - new AutomationSource() - .withEventSource(EventSource.ASSESSMENTS) - .withRuleSets( - Arrays - .asList( - new AutomationRuleSet() - .withRules( - Arrays - .asList( - new AutomationTriggeringRule() - .withPropertyJPath("properties.metadata.severity") - .withPropertyType(PropertyType.STRING) - .withExpectedValue("High") - .withOperator(Operator.EQUALS))))))) - .withActions( - Arrays - .asList( - new AutomationActionLogicApp() - .withLogicAppResourceId( - "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri("https://exampleTriggerUri1.com"))) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsDeleteSamples.java deleted file mode 100644 index 581f4c2760a6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Automations Delete. */ -public final class AutomationsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/DeleteAutomation_example.json - */ - /** - * Sample code: Delete a security automation. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .automations() - .deleteByResourceGroupWithResponse("myRg", "myAutomationName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupSamples.java deleted file mode 100644 index f2cb4ebc832c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Automations GetByResourceGroup. */ -public final class AutomationsGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationResourceGroup_example.json - */ - /** - * Sample code: Retrieve a security automation. - * - * @param manager Entry point to SecurityManager. - */ - public static void retrieveASecurityAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .automations() - .getByResourceGroupWithResponse( - "exampleResourceGroup", "exampleAutomation", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupSamples.java deleted file mode 100644 index 953d54951877..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Automations ListByResourceGroup. */ -public final class AutomationsListByResourceGroupSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationsResourceGroup_example.json - */ - /** - * Sample code: List all security automations of a specified resource group. - * - * @param manager Entry point to SecurityManager. - */ - public static void listAllSecurityAutomationsOfASpecifiedResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.automations().listByResourceGroup("exampleResourceGroup", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsListSamples.java deleted file mode 100644 index a937bba78314..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Automations List. */ -public final class AutomationsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationsSubscription_example.json - */ - /** - * Sample code: List all security automations of a specified subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void listAllSecurityAutomationsOfASpecifiedSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.automations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.java deleted file mode 100644 index 5202ae363608..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/AutomationsValidateSamples.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.generated; - -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.models.AutomationActionLogicApp; -import com.azure.resourcemanager.security.models.AutomationRuleSet; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.azure.resourcemanager.security.models.AutomationTriggeringRule; -import com.azure.resourcemanager.security.models.EventSource; -import com.azure.resourcemanager.security.models.Operator; -import com.azure.resourcemanager.security.models.PropertyType; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Automations Validate. */ -public final class AutomationsValidateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/ValidateAutomation_example.json - */ - /** - * Sample code: Validate the security automation model before create or update. - * - * @param manager Entry point to SecurityManager. - */ - public static void validateTheSecurityAutomationModelBeforeCreateOrUpdate( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .automations() - .validateWithResponse( - "exampleResourceGroup", - "exampleAutomation", - new AutomationInner() - .withLocation("Central US") - .withTags(mapOf()) - .withDescription( - "An example of a security automation that triggers one LogicApp resource (myTest1) on any" - + " security assessment of type customAssessment") - .withIsEnabled(true) - .withScopes( - Arrays - .asList( - new AutomationScope() - .withDescription( - "A description that helps to identify this scope - for example: security" - + " assessments that relate to the resource group myResourceGroup within" - + " the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5") - .withScopePath( - "/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"))) - .withSources( - Arrays - .asList( - new AutomationSource() - .withEventSource(EventSource.ASSESSMENTS) - .withRuleSets( - Arrays - .asList( - new AutomationRuleSet() - .withRules( - Arrays - .asList( - new AutomationTriggeringRule() - .withPropertyJPath("$.Entity.AssessmentType") - .withPropertyType(PropertyType.STRING) - .withExpectedValue("customAssessment") - .withOperator(Operator.EQUALS))))))) - .withActions( - Arrays - .asList( - new AutomationActionLogicApp() - .withLogicAppResourceId( - "/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1") - .withUri("https://exampleTriggerUri1.com"))), - com.azure.core.util.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/generated/ComplianceResultsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetSamples.java deleted file mode 100644 index b0128db04b1a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for ComplianceResults Get. */ -public final class ComplianceResultsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/GetComplianceResults_example.json - */ - /** - * Sample code: Get compliance results on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .complianceResults() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "DesignateMoreThanOneOwner", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsListSamples.java deleted file mode 100644 index 4a8d4514ccd9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ComplianceResultsListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for ComplianceResults List. */ -public final class ComplianceResultsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/ListComplianceResults_example.json - */ - /** - * Sample code: Get compliance results on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getComplianceResultsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .complianceResults() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesGetSamples.java deleted file mode 100644 index 4d6fad326e2b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Compliances Get. */ -public final class CompliancesGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliance_example.json - */ - /** - * Sample code: Get security compliance data for a day. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityComplianceDataForADay(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .compliances() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesListSamples.java deleted file mode 100644 index c9903d8e3c29..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CompliancesListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Compliances List. */ -public final class CompliancesListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliances_example.json - */ - /** - * Sample code: Get security compliance data over time. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityComplianceDataOverTime(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .compliances() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsCreateOrUpdateSamples.java deleted file mode 100644 index 719de2db1c9a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsCreateOrUpdateSamples.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AwAssumeRoleAuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.AwsCredsAuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.GcpCredentialsDetailsProperties; -import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; -import com.azure.resourcemanager.security.models.ProxyServerProperties; -import com.azure.resourcemanager.security.models.ServicePrincipalProperties; - -/** Samples for Connectors CreateOrUpdate. */ -public final class ConnectorsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateGcpCredentialsConnectorSubscription_example.json - */ - /** - * Sample code: gcpCredentials - Create a cloud account connector for a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void gcpCredentialsCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .connectors() - .define("gcp_dev") - .withHybridComputeSettings(new HybridComputeSettingsProperties().withAutoProvision(AutoProvision.OFF)) - .withAuthenticationDetails( - new GcpCredentialsDetailsProperties() - .withOrganizationId("AscDemoOrg") - .withType("service_account") - .withProjectId("asc-project-1234") - .withPrivateKeyId("fakeTokenPlaceholder") - .withPrivateKey("fakeTokenPlaceholder") - .withClientEmail("asc-135@asc-project-1234.iam.gserviceaccount.com") - .withClientId("105889053725632919854") - .withAuthUri("https://accounts.google.com/o/oauth2/auth") - .withTokenUri("fakeTokenPlaceholder") - .withAuthProviderX509CertUrl("https://www.googleapis.com/oauth2/v1/certs") - .withClientX509CertUrl( - "https://www.googleapis.com/robot/v1/metadata/x509/asc-135%40asc-project-1234.iam.gserviceaccount.com")) - .create(); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsCredConnectorSubscription_example.json - */ - /** - * Sample code: AwsCred - Create a cloud account connector for a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void awsCredCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .connectors() - .define("aws_dev1") - .withHybridComputeSettings( - new HybridComputeSettingsProperties() - .withAutoProvision(AutoProvision.ON) - .withResourceGroupName("AwsConnectorRG") - .withRegion("West US 2") - .withProxyServer(new ProxyServerProperties().withIp("167.220.197.140").withPort("34")) - .withServicePrincipal( - new ServicePrincipalProperties() - .withApplicationId("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1") - .withSecret("fakeTokenPlaceholder"))) - .withAuthenticationDetails( - new AwsCredsAuthenticationDetailsProperties() - .withAwsAccessKeyId("fakeTokenPlaceholder") - .withAwsSecretAccessKey("fakeTokenPlaceholder")) - .create(); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsAssumeRoleConnectorSubscription_example.json - */ - /** - * Sample code: AwsAssumeRole - Create a cloud account connector for a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void awsAssumeRoleCreateACloudAccountConnectorForASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .connectors() - .define("aws_dev2") - .withHybridComputeSettings( - new HybridComputeSettingsProperties() - .withAutoProvision(AutoProvision.ON) - .withResourceGroupName("AwsConnectorRG") - .withRegion("West US 2") - .withProxyServer(new ProxyServerProperties().withIp("167.220.197.140").withPort("34")) - .withServicePrincipal( - new ServicePrincipalProperties() - .withApplicationId("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1") - .withSecret("fakeTokenPlaceholder"))) - .withAuthenticationDetails( - new AwAssumeRoleAuthenticationDetailsProperties() - .withAwsAssumeRoleArn("arn:aws:iam::81231569658:role/AscConnector") - .withAwsExternalId("20ff7fc3-e762-44dd-bd96-b71116dcdc23")) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteSamples.java deleted file mode 100644 index e4250d1c1387..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Connectors Delete. */ -public final class ConnectorsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/DeleteConnectorSubscription_example.json - */ - /** - * Sample code: Delete a cloud account connector from a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteACloudAccountConnectorFromASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().deleteWithResponse("aws_dev1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsGetSamples.java deleted file mode 100644 index fc7aa92f844d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Connectors Get. */ -public final class ConnectorsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/GetConnectorSubscription_example.json - */ - /** - * Sample code: Details of a specific cloud account connector. - * - * @param manager Entry point to SecurityManager. - */ - public static void detailsOfASpecificCloudAccountConnector( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().getWithResponse("aws_dev1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ConnectorsListSamples.java deleted file mode 100644 index f13798406aee..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Connectors List. */ -public final class ConnectorsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/GetListConnectorSubscription_example.json - */ - /** - * Sample code: Get all cloud accounts connectors of a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAllCloudAccountsConnectorsOfASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.connectors().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsCreateSamples.java deleted file mode 100644 index 4f4eda42a660..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsCreateSamples.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; - -/** Samples for CustomAssessmentAutomations Create. */ -public final class CustomAssessmentAutomationsCreateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationCreate_example.json - */ - /** - * Sample code: Create a Custom Assessment Automation. - * - * @param manager Entry point to SecurityManager. - */ - public static void createACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customAssessmentAutomations() - .define("MyCustomAssessmentAutomation") - .withExistingResourceGroup("TestResourceGroup") - .withCompressedQuery( - "DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA=") - .withSupportedCloud(SupportedCloudEnum.AWS) - .withSeverity(SeverityEnum.MEDIUM) - .withDisplayName("Password Policy") - .withDescription("Data should be encrypted") - .withRemediationDescription("Encrypt store by...") - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteSamples.java deleted file mode 100644 index b5221d8c248c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for CustomAssessmentAutomations Delete. */ -public final class CustomAssessmentAutomationsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationDelete_example.json - */ - /** - * Sample code: Delete a Custom Assessment Automation. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customAssessmentAutomations() - .deleteByResourceGroupWithResponse( - "TestResourceGroup", "MyCustomAssessmentAutomation", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsGetByResourceGroupSamples.java deleted file mode 100644 index 672b037c9413..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsGetByResourceGroupSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for CustomAssessmentAutomations GetByResourceGroup. */ -public final class CustomAssessmentAutomationsGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationGet_example.json - */ - /** - * Sample code: Get a Custom Assessment Automation. - * - * @param manager Entry point to SecurityManager. - */ - public static void getACustomAssessmentAutomation(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customAssessmentAutomations() - .getByResourceGroupWithResponse( - "TestResourceGroup", "MyCustomAssessmentAutomation", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListByResourceGroupSamples.java deleted file mode 100644 index 9dfd8616b586..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListByResourceGroupSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for CustomAssessmentAutomations ListByResourceGroup. */ -public final class CustomAssessmentAutomationsListByResourceGroupSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationListByResourceGroup_example.json - */ - /** - * Sample code: List Custom Assessment Automations in a subscription and a resource group. - * - * @param manager Entry point to SecurityManager. - */ - public static void listCustomAssessmentAutomationsInASubscriptionAndAResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customAssessmentAutomations() - .listByResourceGroup("TestResourceGroup", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListSamples.java deleted file mode 100644 index f7cd322e5127..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for CustomAssessmentAutomations List. */ -public final class CustomAssessmentAutomationsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationListBySubscription_example.json - */ - /** - * Sample code: List Custom Assessment Automations in a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void listCustomAssessmentAutomationsInASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.customAssessmentAutomations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsCreateSamples.java deleted file mode 100644 index e06c26adafb2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsCreateSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for CustomEntityStoreAssignments Create. */ -public final class CustomEntityStoreAssignmentsCreateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentCreate_example.json - */ - /** - * Sample code: Create a custom entity store assignment. - * - * @param manager Entry point to SecurityManager. - */ - public static void createACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customEntityStoreAssignments() - .define("33e7cc6e-a139-4723-a0e5-76993aee0771") - .withExistingResourceGroup("TestResourceGroup") - .withPrincipal("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47") - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteSamples.java deleted file mode 100644 index fefbea30f2ac..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for CustomEntityStoreAssignments Delete. */ -public final class CustomEntityStoreAssignmentsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentDelete_example.json - */ - /** - * Sample code: Delete a custom entity store assignment. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customEntityStoreAssignments() - .deleteByResourceGroupWithResponse( - "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupSamples.java deleted file mode 100644 index 80714a727fc2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for CustomEntityStoreAssignments GetByResourceGroup. */ -public final class CustomEntityStoreAssignmentsGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentGet_example.json - */ - /** - * Sample code: Get a custom entity store assignment. - * - * @param manager Entry point to SecurityManager. - */ - public static void getACustomEntityStoreAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customEntityStoreAssignments() - .getByResourceGroupWithResponse( - "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupSamples.java deleted file mode 100644 index d03aaad838ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for CustomEntityStoreAssignments ListByResourceGroup. */ -public final class CustomEntityStoreAssignmentsListByResourceGroupSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentListByResourceGroup_example.json - */ - /** - * Sample code: List custom entity store assignments in a subscription and a resource group. - * - * @param manager Entry point to SecurityManager. - */ - public static void listCustomEntityStoreAssignmentsInASubscriptionAndAResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .customEntityStoreAssignments() - .listByResourceGroup("TestResourceGroup", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListSamples.java deleted file mode 100644 index 3684ba56655b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for CustomEntityStoreAssignments List. */ -public final class CustomEntityStoreAssignmentsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentListBySubscription_example.json - */ - /** - * Sample code: List custom entity store assignments in a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void listCustomEntityStoreAssignmentsInASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.customEntityStoreAssignments().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateSamples.java deleted file mode 100644 index 24125fcaa96a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateSamples.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.ActiveConnectionsNotInAllowedRange; -import java.time.Duration; -import java.util.Arrays; - -/** Samples for DeviceSecurityGroups CreateOrUpdate. */ -public final class DeviceSecurityGroupsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/PutDeviceSecurityGroups_example.json - */ - /** - * Sample code: Create or update a device security group for the specified IoT hub resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateADeviceSecurityGroupForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .deviceSecurityGroups() - .define("samplesecuritygroup") - .withExistingResourceId( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub") - .withTimeWindowRules( - Arrays - .asList( - new ActiveConnectionsNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(0) - .withMaxThreshold(30) - .withTimeWindowSize(Duration.parse("PT05M")))) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteSamples.java deleted file mode 100644 index 345e341c162b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for DeviceSecurityGroups Delete. */ -public final class DeviceSecurityGroupsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/DeleteDeviceSecurityGroups_example.json - */ - /** - * Sample code: Delete a device security group for the specified IoT Hub resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteADeviceSecurityGroupForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .deviceSecurityGroups() - .deleteByResourceGroupWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - "samplesecuritygroup", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetSamples.java deleted file mode 100644 index 3f8034b69f59..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for DeviceSecurityGroups Get. */ -public final class DeviceSecurityGroupsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/GetDeviceSecurityGroups_example.json - */ - /** - * Sample code: Get a device security group for the specified IoT Hub resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void getADeviceSecurityGroupForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .deviceSecurityGroups() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - "samplesecuritygroup", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListSamples.java deleted file mode 100644 index 22ad1ada2ae7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for DeviceSecurityGroups List. */ -public final class DeviceSecurityGroupsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ListDeviceSecurityGroups_example.json - */ - /** - * Sample code: List all device security groups for the specified IoT Hub resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void listAllDeviceSecurityGroupsForTheSpecifiedIoTHubResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .deviceSecurityGroups() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetSamples.java deleted file mode 100644 index 6940d814d7fa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for DiscoveredSecuritySolutions Get. */ -public final class DiscoveredSecuritySolutionsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionResourceGroupLocation_example.json - */ - /** - * Sample code: Get discovered security solution from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getDiscoveredSecuritySolutionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .discoveredSecuritySolutions() - .getWithResponse("myRg2", "centralus", "paloalto7", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionSamples.java deleted file mode 100644 index 4c3e263cecee..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for DiscoveredSecuritySolutions ListByHomeRegion. */ -public final class DiscoveredSecuritySolutionsListByHomeRegionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscriptionLocation_example.json - */ - /** - * Sample code: Get discovered security solutions from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getDiscoveredSecuritySolutionsFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.discoveredSecuritySolutions().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListSamples.java deleted file mode 100644 index 51c9fbbd26eb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for DiscoveredSecuritySolutions List. */ -public final class DiscoveredSecuritySolutionsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscription_example.json - */ - /** - * Sample code: Get discovered security solutions. - * - * @param manager Entry point to SecurityManager. - */ - public static void getDiscoveredSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { - manager.discoveredSecuritySolutions().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetSamples.java deleted file mode 100644 index dd9e89a7c610..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for ExternalSecuritySolutions Get. */ -public final class ExternalSecuritySolutionsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolution_example.json - */ - /** - * Sample code: Get external security solution. - * - * @param manager Entry point to SecurityManager. - */ - public static void getExternalSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .externalSecuritySolutions() - .getWithResponse( - "defaultresourcegroup-eus", - "centralus", - "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionSamples.java deleted file mode 100644 index c36eb6179874..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for ExternalSecuritySolutions ListByHomeRegion. */ -public final class ExternalSecuritySolutionsListByHomeRegionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscriptionLocation_example.json - */ - /** - * Sample code: Get external security solutions on a subscription from security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getExternalSecuritySolutionsOnASubscriptionFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.externalSecuritySolutions().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListSamples.java deleted file mode 100644 index 4e71e4cbcf33..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for ExternalSecuritySolutions List. */ -public final class ExternalSecuritySolutionsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscription_example.json - */ - /** - * Sample code: Get external security solutions on a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getExternalSecuritySolutionsOnASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.externalSecuritySolutions().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsCreateOrUpdateSamples.java deleted file mode 100644 index 9b0514cd87a8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsCreateOrUpdateSamples.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.time.OffsetDateTime; - -/** Samples for GovernanceAssignments CreateOrUpdate. */ -public final class GovernanceAssignmentsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/PutGovernanceAssignment_example.json - */ - /** - * Sample code: Create Governance assignment. - * - * @param manager Entry point to SecurityManager. - */ - public static void createGovernanceAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceAssignments() - .define("6634ff9f-127b-4bf2-8e6e-b1737f5e789c") - .withExistingAssessment( - "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", - "6b9421dd-5555-2251-9b3d-2be58e2f82cd") - .withOwner("user@contoso.com") - .withRemediationDueDate(OffsetDateTime.parse("2022-01-07T13:00:00.0000000Z")) - .withRemediationEta( - new RemediationEta() - .withEta(OffsetDateTime.parse("2022-01-08T13:00:00.0000000Z")) - .withJustification("Justification of ETA")) - .withIsGracePeriod(true) - .withGovernanceEmailNotification( - new GovernanceEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(false)) - .withAdditionalData( - new GovernanceAssignmentAdditionalData() - .withTicketNumber(123123) - .withTicketLink("https://snow.com") - .withTicketStatus("Active")) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteSamples.java deleted file mode 100644 index 9a9b5dcf84d8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for GovernanceAssignments Delete. */ -public final class GovernanceAssignmentsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/DeleteGovernanceAssignment_example.json - */ - /** - * Sample code: Delete security assignment. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteSecurityAssignment(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceAssignments() - .deleteWithResponse( - "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", - "6b9421dd-5555-2251-9b3d-2be58e2f82cd", - "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetSamples.java deleted file mode 100644 index 4b5463850876..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for GovernanceAssignments Get. */ -public final class GovernanceAssignmentsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/GetGovernanceAssignment_example.json - */ - /** - * Sample code: Get governanceAssignment by specific governanceAssignmentKey. - * - * @param manager Entry point to SecurityManager. - */ - public static void getGovernanceAssignmentBySpecificGovernanceAssignmentKey( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceAssignments() - .getWithResponse( - "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", - "6b9421dd-5555-2251-9b3d-2be58e2f82cd", - "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListSamples.java deleted file mode 100644 index 110e4c159f01..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for GovernanceAssignments List. */ -public final class GovernanceAssignmentsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/ListGovernanceAssignments_example.json - */ - /** - * Sample code: List governance assignments. - * - * @param manager Entry point to SecurityManager. - */ - public static void listGovernanceAssignments(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceAssignments() - .list( - "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd", - "6b9421dd-5555-2251-9b3d-2be58e2f82cd", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateSamples.java deleted file mode 100644 index dc001c41ee49..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateSamples.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.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.io.IOException; -import java.util.Arrays; - -/** Samples for GovernanceRules CreateOrUpdate. */ -public final class GovernanceRulesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutManagementGroupGovernanceRule_example.json - */ - /** - * Sample code: Create or update governance rule over management group scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateGovernanceRuleOverManagementGroupScope( - com.azure.resourcemanager.security.SecurityManager manager) throws IOException { - manager - .governanceRules() - .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") - .withExistingScope("providers/Microsoft.Management/managementGroups/contoso") - .withDisplayName("Management group rule") - .withDescription("A rule for a management group") - .withRemediationTimeframe("7.00:00:00") - .withIsGracePeriod(true) - .withRulePriority(200) - .withIsDisabled(false) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withExcludedScopes(Arrays.asList("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23")) - .withConditionSets( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\"," - + " \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", - Object.class, - SerializerEncoding.JSON))) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.MANUALLY) - .withValue("user@contoso.com")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(true) - .withDisableOwnerEmailNotification(false)) - .create(); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Create or update governance rule over security connector scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateGovernanceRuleOverSecurityConnectorScope( - com.azure.resourcemanager.security.SecurityManager manager) throws IOException { - manager - .governanceRules() - .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") - .withExistingScope( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector") - .withDisplayName("GCP Admin's rule") - .withDescription("A rule on critical GCP recommendations") - .withRemediationTimeframe("7.00:00:00") - .withIsGracePeriod(true) - .withRulePriority(200) - .withIsDisabled(false) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withConditionSets( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\"," - + " \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", - Object.class, - SerializerEncoding.JSON))) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.MANUALLY) - .withValue("user@contoso.com")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(true) - .withDisableOwnerEmailNotification(false)) - .create(); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutGovernanceRule_example.json - */ - /** - * Sample code: Create or update governance rule over subscription scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateGovernanceRuleOverSubscriptionScope( - com.azure.resourcemanager.security.SecurityManager manager) throws IOException { - manager - .governanceRules() - .define("ad9a8e26-29d9-4829-bb30-e597a58cdbb8") - .withExistingScope("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") - .withDisplayName("Admin's rule") - .withDescription("A rule for critical recommendations") - .withRemediationTimeframe("7.00:00:00") - .withIsGracePeriod(true) - .withRulePriority(200) - .withIsDisabled(false) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withConditionSets( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"In\",\"property\":\"$.AssessmentKey\",\"value\":\"[\\\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\\\"," - + " \\\"fe83f80b-073d-4ccf-93d9-6797eb870201\\\"]\"}]}", - Object.class, - SerializerEncoding.JSON))) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.MANUALLY) - .withValue("user@contoso.com")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(false)) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteSamples.java deleted file mode 100644 index aa1be6c40893..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteSamples.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for GovernanceRules Delete. */ -public final class GovernanceRulesDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json - */ - /** - * Sample code: Delete a Governance rule over management group scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteAGovernanceRuleOverManagementGroupScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .delete( - "providers/Microsoft.Management/managementGroups/contoso", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteGovernanceRule_example.json - */ - /** - * Sample code: Delete a Governance rule over subscription scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteAGovernanceRuleOverSubscriptionScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .delete( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Delete a Governance rule over security connector scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteAGovernanceRuleOverSecurityConnectorScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .delete( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesExecuteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesExecuteSamples.java deleted file mode 100644 index 800f8a6d6c05..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesExecuteSamples.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for GovernanceRules Execute. */ -public final class GovernanceRulesExecuteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Execute governance rule over security connector scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void executeGovernanceRuleOverSecurityConnectorScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .execute( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - null, - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostGovernanceRule_example.json - */ - /** - * Sample code: Execute Governance rule over subscription scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void executeGovernanceRuleOverSubscriptionScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .execute( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - null, - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostManagementGroupGovernanceRule_example.json - */ - /** - * Sample code: Execute governance rule over management group scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void executeGovernanceRuleOverManagementGroupScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .execute( - "providers/Microsoft.Management/managementGroups/contoso", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - null, - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetSamples.java deleted file mode 100644 index 0f9bf067895d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetSamples.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for GovernanceRules Get. */ -public final class GovernanceRulesGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRule_example.json - */ - /** - * Sample code: Get a governance rule over management group scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAGovernanceRuleOverManagementGroupScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .getWithResponse( - "providers/Microsoft.Management/managementGroups/contoso", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRule_example.json - */ - /** - * Sample code: Get a governance rule over subscription scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAGovernanceRuleOverSubscriptionScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRule_example.json - */ - /** - * Sample code: Get a governance rule over security connector scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAGovernanceRuleOverSecurityConnectorScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .getWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesListSamples.java deleted file mode 100644 index 63aec77cac6c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesListSamples.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for GovernanceRules List. */ -public final class GovernanceRulesListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySubscriptionGovernanceRules_example.json - */ - /** - * Sample code: List governance rules by subscription scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void listGovernanceRulesBySubscriptionScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .list("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySecurityConnectorGovernanceRules_example.json - */ - /** - * Sample code: List governance rules by security connector scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void listGovernanceRulesBySecurityConnectorScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListByManagementGroupGovernanceRules_example.json - */ - /** - * Sample code: List governance rules by management group scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void listGovernanceRulesByManagementGroupScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .list("providers/Microsoft.Management/managementGroups/contoso", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsSamples.java deleted file mode 100644 index 8c7df88fec26..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsSamples.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for GovernanceRules OperationResults. */ -public final class GovernanceRulesOperationResultsSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json - */ - /** - * Sample code: Get governance rules long run operation result over management group. - * - * @param manager Entry point to SecurityManager. - */ - public static void getGovernanceRulesLongRunOperationResultOverManagementGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .operationResultsWithResponse( - "providers/Microsoft.Management/managementGroups/contoso", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json - */ - /** - * Sample code: Get governance rules long run operation result over security connector. - * - * @param manager Entry point to SecurityManager. - */ - public static void getGovernanceRulesLongRunOperationResultOverSecurityConnector( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .operationResultsWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json - */ - /** - * Sample code: Get governance rules long run operation result over subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getGovernanceRulesLongRunOperationResultOverSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .governanceRules() - .operationResultsWithResponse( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportOperationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportOperationGetSamples.java deleted file mode 100644 index 04042dc0cc79..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportOperationGetSamples.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for HealthReportOperation Get. */ -public final class HealthReportOperationGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/HealthReports/GetHealthReport_example.json - */ - /** - * Sample code: Get health report of resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void getHealthReportOfResource(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .healthReportOperations() - .getWithResponse( - "subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/E2E-IBB0WX/providers/Microsoft.Security/securityconnectors/AwsConnectorAllOfferings", - "909c629a-bf39-4521-8e4f-10b443a0bc02", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsListSamples.java deleted file mode 100644 index 2a7ee29833eb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/HealthReportsListSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for HealthReports List. */ -public final class HealthReportsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/HealthReports/ListHealthReports_example.json - */ - /** - * Sample code: List health reports. - * - * @param manager Entry point to SecurityManager. - */ - public static void listHealthReports(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .healthReports() - .list("subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateSamples.java deleted file mode 100644 index d55fa59839ea..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateSamples.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.InformationProtectionKeyword; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; -import com.azure.resourcemanager.security.models.InformationType; -import com.azure.resourcemanager.security.models.SensitivityLabel; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -/** Samples for InformationProtectionPolicies CreateOrUpdate. */ -public final class InformationProtectionPoliciesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/CreateOrUpdateInformationProtectionPolicy_example.json - */ - /** - * Sample code: Create or update an information protection policy for a management group. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateAnInformationProtectionPolicyForAManagementGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .informationProtectionPolicies() - .define(InformationProtectionPolicyName.CUSTOM) - .withExistingScope("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e") - .withLabels( - mapOf( - "1345da73-bc5a-4a8f-b7dd-3820eb713da8", - new SensitivityLabel().withDisplayName("Public").withOrder(100).withEnabled(true), - "575739d2-3d53-4df0-9042-4c7772d5c7b1", - new SensitivityLabel().withDisplayName("Confidential").withOrder(300).withEnabled(true), - "7aa516c7-5a53-4857-bc6e-6808c6acd542", - new SensitivityLabel().withDisplayName("General").withOrder(200).withEnabled(true))) - .withInformationTypes( - mapOf( - "3bf35491-99b8-41f2-86d5-c1200a7df658", - new InformationType() - .withDisplayName("Custom") - .withOrder(1400) - .withRecommendedLabelId(UUID.fromString("7aa516c7-5a53-4857-bc6e-6808c6acd542")) - .withEnabled(true) - .withCustom(true) - .withKeywords( - Arrays - .asList( - new InformationProtectionKeyword() - .withPattern("%custom%") - .withCustom(true) - .withCanBeNumeric(true))), - "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07", - new InformationType() - .withDisplayName("Networking") - .withOrder(100) - .withRecommendedLabelId(UUID.fromString("575739d2-3d53-4df0-9042-4c7772d5c7b1")) - .withEnabled(true) - .withCustom(false) - .withKeywords( - Arrays - .asList( - new InformationProtectionKeyword() - .withPattern("%networking%") - .withCustom(true) - .withCanBeNumeric(false))))) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetSamples.java deleted file mode 100644 index 7cb89afb693d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetSamples.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; - -/** Samples for InformationProtectionPolicies Get. */ -public final class InformationProtectionPoliciesGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/GetCustomInformationProtectionPolicy_example.json - */ - /** - * Sample code: Get the customized information protection policy for a management group. - * - * @param manager Entry point to SecurityManager. - */ - public static void getTheCustomizedInformationProtectionPolicyForAManagementGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .informationProtectionPolicies() - .getWithResponse( - "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", - InformationProtectionPolicyName.CUSTOM, - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/GetEffectiveInformationProtectionPolicy_example.json - */ - /** - * Sample code: Get the effective information protection policy for a management group. - * - * @param manager Entry point to SecurityManager. - */ - public static void getTheEffectiveInformationProtectionPolicyForAManagementGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .informationProtectionPolicies() - .getWithResponse( - "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", - InformationProtectionPolicyName.EFFECTIVE, - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListSamples.java deleted file mode 100644 index 967f89da9bdc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for InformationProtectionPolicies List. */ -public final class InformationProtectionPoliciesListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/ListInformationProtectionPolicies_example.json - */ - /** - * Sample code: Get information protection policies. - * - * @param manager Entry point to SecurityManager. - */ - public static void getInformationProtectionPolicies(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .informationProtectionPolicies() - .list( - "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateSamples.java deleted file mode 100644 index 822344341a76..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IngestionSettings Create. */ -public final class IngestionSettingsCreateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/CreateIngestionSetting_example.json - */ - /** - * Sample code: Create an ingestion setting for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void createAnIngestionSettingForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().define("default").create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java deleted file mode 100644 index 4951d449f9f3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IngestionSettings Delete. */ -public final class IngestionSettingsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/DeleteIngestionSetting_example.json - */ - /** - * Sample code: Delete an ingestion setting for the subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteAnIngestionSettingForTheSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().deleteWithResponse("default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetSamples.java deleted file mode 100644 index ef8e1251dfc4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IngestionSettings Get. */ -public final class IngestionSettingsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSetting_example.json - */ - /** - * Sample code: Get a ingestion setting on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAIngestionSettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().getWithResponse("default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java deleted file mode 100644 index ada2d9866152..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IngestionSettings ListConnectionStrings. */ -public final class IngestionSettingsListConnectionStringsSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListConnectionStrings_example.json - */ - /** - * Sample code: List connection strings for ingesting security data and logs. - * - * @param manager Entry point to SecurityManager. - */ - public static void listConnectionStringsForIngestingSecurityDataAndLogs( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().listConnectionStringsWithResponse("default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListSamples.java deleted file mode 100644 index 32d658d01c4a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IngestionSettings List. */ -public final class IngestionSettingsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSettings_example.json - */ - /** - * Sample code: Get ingestion settings on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getIngestionSettingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java deleted file mode 100644 index 62bf0af3b48b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IngestionSettingsListTokensSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IngestionSettings ListTokens. */ -public final class IngestionSettingsListTokensSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListTokensIngestionSetting_example.json - */ - /** - * Sample code: List ingestion setting tokens. - * - * @param manager Entry point to SecurityManager. - */ - public static void listIngestionSettingTokens(com.azure.resourcemanager.security.SecurityManager manager) { - manager.ingestionSettings().listTokensWithResponse("default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetSamples.java deleted file mode 100644 index 3e2799e0950c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IotSecuritySolutionAnalytics Get. */ -public final class IotSecuritySolutionAnalyticsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalytics.json - */ - /** - * Sample code: Get Security Solution Analytics. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutionAnalytics().getWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListSamples.java deleted file mode 100644 index 970f32858c27..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IotSecuritySolutionAnalytics List. */ -public final class IotSecuritySolutionAnalyticsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalyticsList.json - */ - /** - * Sample code: Get Security Solution Analytics. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecuritySolutionAnalytics(com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutionAnalytics().listWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionCreateOrUpdateSamples.java deleted file mode 100644 index 3b20451ebc2e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionCreateOrUpdateSamples.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.RecommendationConfigStatus; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for IotSecuritySolution CreateOrUpdate. */ -public final class IotSecuritySolutionCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/CreateIoTSecuritySolution.json - */ - /** - * Sample code: Create or update a IoT security solution. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutions() - .define("default") - .withExistingResourceGroup("MyGroup") - .withRegion("East Us") - .withTags(mapOf()) - .withWorkspace( - "/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1") - .withDisplayName("Solution Default") - .withStatus(SecuritySolutionStatus.ENABLED) - .withExport(Arrays.asList()) - .withDisabledDataSources(Arrays.asList()) - .withIotHubs( - Arrays - .asList( - "/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")) - .withUserDefinedResources( - new UserDefinedResourcesProperties() - .withQuery("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\"") - .withQuerySubscriptions(Arrays.asList("075423e9-7d33-4166-8bdf-3920b04e3735"))) - .withRecommendationsConfiguration( - Arrays - .asList( - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_OPEN_PORTS) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_SHARED_CREDENTIALS) - .withStatus(RecommendationConfigStatus.DISABLED))) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.ENABLED) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionDeleteSamples.java deleted file mode 100644 index fdb129e8fe06..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IotSecuritySolution Delete. */ -public final class IotSecuritySolutionDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/DeleteIoTSecuritySolution.json - */ - /** - * Sample code: Delete an IoT security solution. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteAnIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutions() - .deleteByResourceGroupWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionGetByResourceGroupSamples.java deleted file mode 100644 index 11e0c535e440..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionGetByResourceGroupSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IotSecuritySolution GetByResourceGroup. */ -public final class IotSecuritySolutionGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolution.json - */ - /** - * Sample code: Get a IoT security solution. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAIoTSecuritySolution(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutions() - .getByResourceGroupWithResponse("MyGroup", "default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListByResourceGroupSamples.java deleted file mode 100644 index aae2ee5ad120..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListByResourceGroupSamples.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IotSecuritySolution ListByResourceGroup. */ -public final class IotSecuritySolutionListByResourceGroupSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHubAndRg.json - */ - /** - * Sample code: List IoT Security solutions by resource group and IoT Hub. - * - * @param manager Entry point to SecurityManager. - */ - public static void listIoTSecuritySolutionsByResourceGroupAndIoTHub( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutions() - .listByResourceGroup( - "MyRg", - "properties.iotHubs/any(i eq" - + " \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByRg.json - */ - /** - * Sample code: List IoT Security solutions by resource group. - * - * @param manager Entry point to SecurityManager. - */ - public static void listIoTSecuritySolutionsByResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutions().listByResourceGroup("MyGroup", null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListSamples.java deleted file mode 100644 index d9db4bb4ee72..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionListSamples.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IotSecuritySolution List. */ -public final class IotSecuritySolutionListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsList.json - */ - /** - * Sample code: List IoT Security solutions by subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void listIoTSecuritySolutionsBySubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.iotSecuritySolutions().list(null, com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHub.json - */ - /** - * Sample code: List IoT Security solutions by IoT Hub. - * - * @param manager Entry point to SecurityManager. - */ - public static void listIoTSecuritySolutionsByIoTHub(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutions() - .list( - "properties.iotHubs/any(i eq" - + " \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java deleted file mode 100644 index a051bd1be9ad..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionUpdateSamples.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; -import com.azure.resourcemanager.security.models.RecommendationConfigStatus; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for IotSecuritySolution Update. */ -public final class IotSecuritySolutionUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/UpdateIoTSecuritySolution.json - */ - /** - * Sample code: Use this method to update existing IoT Security solution. - * - * @param manager Entry point to SecurityManager. - */ - public static void useThisMethodToUpdateExistingIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager manager) { - IoTSecuritySolutionModel resource = - manager - .iotSecuritySolutions() - .getByResourceGroupWithResponse("myRg", "default", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf("foo", "bar")) - .withUserDefinedResources( - new UserDefinedResourcesProperties() - .withQuery("where type != \"microsoft.devices/iothubs\" | where name contains \"v2\"") - .withQuerySubscriptions(Arrays.asList("075423e9-7d33-4166-8bdf-3920b04e3735"))) - .withRecommendationsConfiguration( - Arrays - .asList( - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_OPEN_PORTS) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_SHARED_CREDENTIALS) - .withStatus(RecommendationConfigStatus.DISABLED))) - .apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java deleted file mode 100644 index a0de4c8e4457..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Dismiss. */ -public final class IotSecuritySolutionsAnalyticsAggregatedAlertDismissSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/PostIoTSecuritySolutionsSecurityAggregatedAlertDismiss.json - */ - /** - * Sample code: Dismiss an aggregated IoT Security Solution Alert. - * - * @param manager Entry point to SecurityManager. - */ - public static void dismissAnAggregatedIoTSecuritySolutionAlert( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .dismissWithResponse( - "IoTEdgeResources", - "default", - "IoT_Bruteforce_Fail/2019-02-02/dismiss", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples.java deleted file mode 100644 index 7f3477220cbc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert Get. */ -public final class IotSecuritySolutionsAnalyticsAggregatedAlertGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlert.json - */ - /** - * Sample code: Get the aggregated security analytics alert of yours IoT Security solution. This aggregation is - * performed by alert name. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getTheAggregatedSecurityAnalyticsAlertOfYoursIoTSecuritySolutionThisAggregationIsPerformedByAlertName( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .getWithResponse("MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java deleted file mode 100644 index 1118e3bf77cf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for IotSecuritySolutionsAnalyticsAggregatedAlert List. */ -public final class IotSecuritySolutionsAnalyticsAggregatedAlertListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlertList.json - */ - /** - * Sample code: Get the aggregated alert list of yours IoT Security solution. - * - * @param manager Entry point to SecurityManager. - */ - public static void getTheAggregatedAlertListOfYoursIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .list("MyGroup", "default", null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationGetSamples.java deleted file mode 100644 index f97da5af90ae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for IotSecuritySolutionsAnalyticsRecommendation Get. */ -public final class IotSecuritySolutionsAnalyticsRecommendationGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendation.json - */ - /** - * Sample code: Get the aggregated security analytics recommendation of yours IoT Security solution. - * - * @param manager Entry point to SecurityManager. - */ - public static void getTheAggregatedSecurityAnalyticsRecommendationOfYoursIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutionsAnalyticsRecommendations() - .getWithResponse("IoTEdgeResources", "default", "OpenPortsOnDevice", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationListSamples.java deleted file mode 100644 index 8c0c7b4fb1e0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for IotSecuritySolutionsAnalyticsRecommendation List. */ -public final class IotSecuritySolutionsAnalyticsRecommendationListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendationList.json - */ - /** - * Sample code: Get the list of aggregated security analytics recommendations of yours IoT Security solution. - * - * @param manager Entry point to SecurityManager. - */ - public static void getTheListOfAggregatedSecurityAnalyticsRecommendationsOfYoursIoTSecuritySolution( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .iotSecuritySolutionsAnalyticsRecommendations() - .list("IoTEdgeResources", "default", null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateSamples.java deleted file mode 100644 index 733f04468703..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateSamples.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; -import com.azure.resourcemanager.security.models.JitNetworkAccessPortRule; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestPort; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestVirtualMachine; -import com.azure.resourcemanager.security.models.Protocol; -import com.azure.resourcemanager.security.models.Status; -import com.azure.resourcemanager.security.models.StatusReason; -import java.time.OffsetDateTime; -import java.util.Arrays; - -/** Samples for JitNetworkAccessPolicies CreateOrUpdate. */ -public final class JitNetworkAccessPoliciesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/CreateJitNetworkAccessPolicy_example.json - */ - /** - * Sample code: Create JIT network access policy. - * - * @param manager Entry point to SecurityManager. - */ - public static void createJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .jitNetworkAccessPolicies() - .define("default") - .withExistingLocation("myRg1", "westeurope") - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessPolicyVirtualMachine() - .withId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") - .withPorts( - Arrays - .asList( - new JitNetworkAccessPortRule() - .withNumber(22) - .withProtocol(Protocol.ASTERISK) - .withAllowedSourceAddressPrefix("*") - .withMaxRequestAccessDuration("PT3H"), - new JitNetworkAccessPortRule() - .withNumber(3389) - .withProtocol(Protocol.ASTERISK) - .withAllowedSourceAddressPrefix("*") - .withMaxRequestAccessDuration("PT3H"))))) - .withKind("Basic") - .withRequests( - Arrays - .asList( - new JitNetworkAccessRequestInner() - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessRequestVirtualMachine() - .withId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") - .withPorts( - Arrays - .asList( - new JitNetworkAccessRequestPort() - .withNumber(3389) - .withAllowedSourceAddressPrefix("192.127.0.2") - .withEndTimeUtc( - OffsetDateTime.parse("2018-05-17T09:06:45.5691611Z")) - .withStatus(Status.INITIATED) - .withStatusReason(StatusReason.USER_REQUESTED))))) - .withStartTimeUtc(OffsetDateTime.parse("2018-05-17T08:06:45.5691611Z")) - .withRequestor("barbara@contoso.com"))) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteSamples.java deleted file mode 100644 index 681a042bb529..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for JitNetworkAccessPolicies Delete. */ -public final class JitNetworkAccessPoliciesDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/DeleteJitNetworkAccessPolicy_example.json - */ - /** - * Sample code: Delete a JIT network access policy. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteAJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .jitNetworkAccessPolicies() - .deleteWithResponse("myRg1", "westeurope", "default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetSamples.java deleted file mode 100644 index ab72d150b50e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for JitNetworkAccessPolicies Get. */ -public final class JitNetworkAccessPoliciesGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPolicy_example.json - */ - /** - * Sample code: Get JIT network access policy. - * - * @param manager Entry point to SecurityManager. - */ - public static void getJITNetworkAccessPolicy(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .jitNetworkAccessPolicies() - .getWithResponse("myRg1", "westeurope", "default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateSamples.java deleted file mode 100644 index 9d338d8dffea..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateSamples.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiatePort; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateVirtualMachine; -import java.util.Arrays; - -/** Samples for JitNetworkAccessPolicies Initiate. */ -public final class JitNetworkAccessPoliciesInitiateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/InitiateJitNetworkAccessPolicy_example.json - */ - /** - * Sample code: Initiate an action on a JIT network access policy. - * - * @param manager Entry point to SecurityManager. - */ - public static void initiateAnActionOnAJITNetworkAccessPolicy( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .jitNetworkAccessPolicies() - .initiateWithResponse( - "myRg1", - "westeurope", - "default", - new JitNetworkAccessPolicyInitiateRequest() - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1") - .withPorts( - Arrays - .asList( - new JitNetworkAccessPolicyInitiatePort() - .withNumber(3389) - .withAllowedSourceAddressPrefix("192.127.0.2"))))) - .withJustification("testing a new version of the product"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionSamples.java deleted file mode 100644 index 9406cd00796c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for JitNetworkAccessPolicies ListByRegion. */ -public final class JitNetworkAccessPoliciesListByRegionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscriptionLocation_example.json - */ - /** - * Sample code: Get JIT network access policies on a subscription from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getJITNetworkAccessPoliciesOnASubscriptionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().listByRegion("westeurope", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java deleted file mode 100644 index 36a229436cf0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for JitNetworkAccessPolicies ListByResourceGroupAndRegion. */ -public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroupLocation_example.json - */ - /** - * Sample code: Get JIT network access policies on a resource group from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getJITNetworkAccessPoliciesOnAResourceGroupFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .jitNetworkAccessPolicies() - .listByResourceGroupAndRegion("myRg1", "westeurope", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupSamples.java deleted file mode 100644 index 2959d77976c6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for JitNetworkAccessPolicies ListByResourceGroup. */ -public final class JitNetworkAccessPoliciesListByResourceGroupSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroup_example.json - */ - /** - * Sample code: Get JIT network access policies on a resource group. - * - * @param manager Entry point to SecurityManager. - */ - public static void getJITNetworkAccessPoliciesOnAResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().listByResourceGroup("myRg1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListSamples.java deleted file mode 100644 index fed5a8ee0a89..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for JitNetworkAccessPolicies List. */ -public final class JitNetworkAccessPoliciesListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscription_example.json - */ - /** - * Sample code: Get JIT network access policies on a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getJITNetworkAccessPoliciesOnASubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.jitNetworkAccessPolicies().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsGetSamples.java deleted file mode 100644 index cb46980fa1c7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Locations Get. */ -public final class LocationsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/GetLocation_example.json - */ - /** - * Sample code: Get security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityDataLocation(com.azure.resourcemanager.security.SecurityManager manager) { - manager.locations().getWithResponse("centralus", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/LocationsListSamples.java deleted file mode 100644 index 2dd2e99e2b86..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Locations List. */ -public final class LocationsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/GetLocations_example.json - */ - /** - * Sample code: Get security data locations. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityDataLocations(com.azure.resourcemanager.security.SecurityManager manager) { - manager.locations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetSamples.java deleted file mode 100644 index 427bf4a9f955..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for MdeOnboardings Get. */ -public final class MdeOnboardingsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/GetMdeOnboardings_example.json - */ - /** - * Sample code: The default configuration or data needed to onboard the machine to MDE. - * - * @param manager Entry point to SecurityManager. - */ - public static void theDefaultConfigurationOrDataNeededToOnboardTheMachineToMDE( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.mdeOnboardings().getWithResponse(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListSamples.java deleted file mode 100644 index 61075a1ba98b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for MdeOnboardings List. */ -public final class MdeOnboardingsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/ListMdeOnboardings_example.json - */ - /** - * Sample code: The configuration or data needed to onboard the machine to MDE. - * - * @param manager Entry point to SecurityManager. - */ - public static void theConfigurationOrDataNeededToOnboardTheMachineToMDE( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.mdeOnboardings().listWithResponse(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsGetSamples.java deleted file mode 100644 index e8d83047aa5d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsGetSamples.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Pricings Get. */ -public final class PricingsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameCloudPosture_example.json - */ - /** - * Sample code: Get pricings on subscription - CloudPosture plan. - * - * @param manager Entry point to SecurityManager. - */ - public static void getPricingsOnSubscriptionCloudPosturePlan( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().getWithResponse("CloudPosture", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameDns_example.json - */ - /** - * Sample code: Get pricings on subscription - Dns plan. - * - * @param manager Entry point to SecurityManager. - */ - public static void getPricingsOnSubscriptionDnsPlan(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().getWithResponse("Dns", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameContainers_example.json - */ - /** - * Sample code: Get pricings on subscription - Containers plan. - * - * @param manager Entry point to SecurityManager. - */ - public static void getPricingsOnSubscriptionContainersPlan( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().getWithResponse("Containers", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameStorageAccounts_example.json - */ - /** - * Sample code: Get pricings on subscription - StorageAccounts plan. - * - * @param manager Entry point to SecurityManager. - */ - public static void getPricingsOnSubscriptionStorageAccountsPlan( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().getWithResponse("StorageAccounts", com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameVirtualMachines_example.json - */ - /** - * Sample code: Get pricings on subscription - VirtualMachines plan. - * - * @param manager Entry point to SecurityManager. - */ - public static void getPricingsOnSubscriptionVirtualMachinesPlan( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().getWithResponse("VirtualMachines", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsListSamples.java deleted file mode 100644 index d60f200d034d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Pricings List. */ -public final class PricingsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/ListPricings_example.json - */ - /** - * Sample code: Get pricings on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getPricingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.pricings().listWithResponse(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsUpdateSamples.java deleted file mode 100644 index 633b37ca924d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/PricingsUpdateSamples.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.models.PricingTier; - -/** Samples for Pricings Update. */ -public final class PricingsUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/PutPricingByNamePartialSuccess_example.json - */ - /** - * Sample code: Update pricing on subscription - partial success. - * - * @param manager Entry point to SecurityManager. - */ - public static void updatePricingOnSubscriptionPartialSuccess( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .pricings() - .updateWithResponse( - "CloudPosture", - new PricingInner().withPricingTier(PricingTier.STANDARD), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/PutPricingByName_example.json - */ - /** - * Sample code: Update pricing on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void updatePricingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .pricings() - .updateWithResponse( - "CloudPosture", - new PricingInner().withPricingTier(PricingTier.STANDARD), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetSamples.java deleted file mode 100644 index dd1e94f9e368..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for RegulatoryComplianceAssessments Get. */ -public final class RegulatoryComplianceAssessmentsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceAssessment_example.json - */ - /** - * Sample code: Get selected regulatory compliance assessment details and state. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSelectedRegulatoryComplianceAssessmentDetailsAndState( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .regulatoryComplianceAssessments() - .getWithResponse( - "PCI-DSS-3.2", "1.1", "968548cb-02b3-8cd2-11f8-0cf64ab1a347", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListSamples.java deleted file mode 100644 index 20cb2b2db966..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for RegulatoryComplianceAssessments List. */ -public final class RegulatoryComplianceAssessmentsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceAssessmentList_example.json - */ - /** - * Sample code: Get all assessments mapped to selected regulatory compliance control. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAllAssessmentsMappedToSelectedRegulatoryComplianceControl( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceAssessments().list("PCI-DSS-3.2", "1.1", null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetSamples.java deleted file mode 100644 index 6e2e8932e063..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for RegulatoryComplianceControls Get. */ -public final class RegulatoryComplianceControlsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceControl_example.json - */ - /** - * Sample code: Get selected regulatory compliance control details and state. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSelectedRegulatoryComplianceControlDetailsAndState( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceControls().getWithResponse("PCI-DSS-3.2", "1.1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListSamples.java deleted file mode 100644 index 5ec769b1b499..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for RegulatoryComplianceControls List. */ -public final class RegulatoryComplianceControlsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceControlList_example.json - */ - /** - * Sample code: Get all regulatory compliance controls details and state for selected standard. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAllRegulatoryComplianceControlsDetailsAndStateForSelectedStandard( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceControls().list("PCI-DSS-3.2", null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetSamples.java deleted file mode 100644 index 2210e7590771..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for RegulatoryComplianceStandards Get. */ -public final class RegulatoryComplianceStandardsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandard_example.json - */ - /** - * Sample code: Get selected regulatory compliance standard details and state. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSelectedRegulatoryComplianceStandardDetailsAndState( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceStandards().getWithResponse("PCI-DSS-3.2", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListSamples.java deleted file mode 100644 index 67096678032e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for RegulatoryComplianceStandards List. */ -public final class RegulatoryComplianceStandardsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandardList_example.json - */ - /** - * Sample code: Get all supported regulatory compliance standards details and state. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAllSupportedRegulatoryComplianceStandardsDetailsAndState( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.regulatoryComplianceStandards().list(null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionSamples.java deleted file mode 100644 index 7fb94aceb9c1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SecureScoreControlDefinitions ListBySubscription. */ -public final class SecureScoreControlDefinitionsListBySubscriptionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_subscription_example.json - */ - /** - * Sample code: List security controls definition by subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityControlsDefinitionBySubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScoreControlDefinitions().listBySubscription(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListSamples.java deleted file mode 100644 index c79e4f49431c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecureScoreControlDefinitions List. */ -public final class SecureScoreControlDefinitionsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_example.json - */ - /** - * Sample code: List security controls definition. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityControlsDefinition(com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScoreControlDefinitions().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreSamples.java deleted file mode 100644 index 49d280c3fa99..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreSamples.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.ExpandControlsEnum; - -/** Samples for SecureScoreControls ListBySecureScore. */ -public final class SecureScoreControlsListBySecureScoreSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForNameWithExpand_builtin_example.json - */ - /** - * Sample code: Get security controls and their current score for the specified initiative with the expand - * parameter. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiativeWithTheExpandParameter( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .secureScoreControls() - .listBySecureScore("ascScore", ExpandControlsEnum.DEFINITION, com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForName_builtin_example.json - */ - /** - * Sample code: Get security controls and their current score for the specified initiative. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiative( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScoreControls().listBySecureScore("ascScore", null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListSamples.java deleted file mode 100644 index 7a8e372c9394..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SecureScoreControls List. */ -public final class SecureScoreControlsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControls_example.json - */ - /** - * Sample code: List all secure scores controls. - * - * @param manager Entry point to SecurityManager. - */ - public static void listAllSecureScoresControls(com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScoreControls().list(null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresGetSamples.java deleted file mode 100644 index 7c03ad1b4864..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SecureScores Get. */ -public final class SecureScoresGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/GetSecureScoresSingle_example.json - */ - /** - * Sample code: Get single secure score. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSingleSecureScore(com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScores().getWithResponse("ascScore", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecureScoresListSamples.java deleted file mode 100644 index 8e80e1a1ec05..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SecureScores List. */ -public final class SecureScoresListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScores_example.json - */ - /** - * Sample code: List secure scores. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecureScores(com.azure.resourcemanager.security.SecurityManager manager) { - manager.secureScores().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationCreateOrUpdateSamples.java deleted file mode 100644 index 201991a09b7e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationCreateOrUpdateSamples.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.io.IOException; -import java.util.Arrays; - -/** Samples for SecurityConnectorApplicationOperation CreateOrUpdate. */ -public final class SecurityConnectorApplicationOperationCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/PutSecurityConnectorApplication_example.json - */ - /** - * Sample code: Create Application. - * - * @param manager Entry point to SecurityManager. - */ - public static void createApplication(com.azure.resourcemanager.security.SecurityManager manager) - throws IOException { - manager - .securityConnectorApplicationOperations() - .createOrUpdateWithResponse( - "gcpResourceGroup", - "gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - new ApplicationInner() - .withDisplayName("GCP Admin's application") - .withDescription("An application on critical GCP recommendations") - .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) - .withConditionSets( - Arrays - .asList( - SerializerFactory - .createDefaultManagementSerializerAdapter() - .deserialize( - "{\"conditions\":[{\"operator\":\"contains\",\"property\":\"$.Id\",\"value\":\"-prod-\"}]}", - Object.class, - SerializerEncoding.JSON))), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationDeleteSamples.java deleted file mode 100644 index abb0121eb39f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationDeleteSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecurityConnectorApplicationOperation Delete. */ -public final class SecurityConnectorApplicationOperationDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/DeleteSecurityConnectorApplication_example.json - */ - /** - * Sample code: Delete security Application. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteSecurityApplication(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectorApplicationOperations() - .deleteWithResponse( - "gcpResourceGroup", - "gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationGetSamples.java deleted file mode 100644 index 821fb72764d0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationGetSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecurityConnectorApplicationOperation Get. */ -public final class SecurityConnectorApplicationOperationGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/GetSecurityConnectorApplication_example.json - */ - /** - * Sample code: Get security applications by specific applicationId. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityApplicationsBySpecificApplicationId( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectorApplicationOperations() - .getWithResponse( - "gcpResourceGroup", - "gcpconnector", - "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListSamples.java deleted file mode 100644 index ec5b0b68372e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecurityConnectorApplications List. */ -public final class SecurityConnectorApplicationsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ListBySecurityConnectorApplications_example.json - */ - /** - * Sample code: List security applications by security connector level scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityApplicationsBySecurityConnectorLevelScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectorApplications() - .list("gcpResourceGroup", "gcpconnector", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateSamples.java deleted file mode 100644 index 50662f107f7b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateSamples.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.AwsEnvironmentData; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.CspmMonitorAwsOffering; -import com.azure.resourcemanager.security.models.CspmMonitorAwsOfferingNativeCloudConnection; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for SecurityConnectors CreateOrUpdate. */ -public final class SecurityConnectorsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/PutSecurityConnector_example.json - */ - /** - * Sample code: Create or update a security connector. - * - * @param manager Entry point to SecurityManager. - */ - public static void createOrUpdateASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectors() - .define("exampleSecurityConnectorName") - .withRegion("Central US") - .withExistingResourceGroup("exampleResourceGroup") - .withTags(mapOf()) - .withHierarchyIdentifier("exampleHierarchyId") - .withEnvironmentName(CloudName.AWS) - .withOfferings( - Arrays - .asList( - new CspmMonitorAwsOffering() - .withNativeCloudConnection( - new CspmMonitorAwsOfferingNativeCloudConnection() - .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) - .withEnvironmentData(new AwsEnvironmentData()) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java deleted file mode 100644 index 7efdb44bb18b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecurityConnectors Delete. */ -public final class SecurityConnectorsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/DeleteSecurityConnector_example.json - */ - /** - * Sample code: Delete a security connector. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectors() - .deleteByResourceGroupWithResponse("myRg", "mySecurityConnectorName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java deleted file mode 100644 index 1f308e583139..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecurityConnectors GetByResourceGroup. */ -public final class SecurityConnectorsGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorSingleResource_example.json - */ - /** - * Sample code: Retrieve a security connector. - * - * @param manager Entry point to SecurityManager. - */ - public static void retrieveASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityConnectors() - .getByResourceGroupWithResponse( - "exampleResourceGroup", "exampleSecurityConnectorName", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java deleted file mode 100644 index 649474989719..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecurityConnectors ListByResourceGroup. */ -public final class SecurityConnectorsListByResourceGroupSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorsResourceGroup_example.json - */ - /** - * Sample code: List all security connectors of a specified resource group. - * - * @param manager Entry point to SecurityManager. - */ - public static void listAllSecurityConnectorsOfASpecifiedResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectors().listByResourceGroup("exampleResourceGroup", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java deleted file mode 100644 index d2178cf30549..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListSamples.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecurityConnectors List. */ -public final class SecurityConnectorsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorsSubscription_example.json - */ - /** - * Sample code: List all security connectors of a specified subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void listAllSecurityConnectorsOfASpecifiedSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityConnectors().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java deleted file mode 100644 index 9f3ffaccc23a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityConnectorsUpdateSamples.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.AwsEnvironmentData; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.CspmMonitorAwsOffering; -import com.azure.resourcemanager.security.models.CspmMonitorAwsOfferingNativeCloudConnection; -import com.azure.resourcemanager.security.models.SecurityConnector; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for SecurityConnectors Update. */ -public final class SecurityConnectorsUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-03-01-preview/examples/SecurityConnectors/PatchSecurityConnector_example.json - */ - /** - * Sample code: Update a security connector. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateASecurityConnector(com.azure.resourcemanager.security.SecurityManager manager) { - SecurityConnector resource = - manager - .securityConnectors() - .getByResourceGroupWithResponse( - "exampleResourceGroup", "exampleSecurityConnectorName", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf()) - .withHierarchyIdentifier("exampleHierarchyId") - .withEnvironmentName(CloudName.AWS) - .withOfferings( - Arrays - .asList( - new CspmMonitorAwsOffering() - .withNativeCloudConnection( - new CspmMonitorAwsOfferingNativeCloudConnection() - .withCloudRoleArn("arn:aws:iam::00000000:role/ASCMonitor")))) - .withEnvironmentData(new AwsEnvironmentData()) - .apply(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateSamples.java deleted file mode 100644 index 4627324d104d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateSamples.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.Roles; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import com.azure.resourcemanager.security.models.State; -import java.util.Arrays; - -/** Samples for SecurityContacts Create. */ -public final class SecurityContactsCreateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/CreateSecurityContact_example.json - */ - /** - * Sample code: Create security contact data. - * - * @param manager Entry point to SecurityManager. - */ - public static void createSecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityContacts() - .define("default") - .withEmails("john@contoso.com;jane@contoso.com") - .withPhone("(214)275-4038") - .withAlertNotifications( - new SecurityContactPropertiesAlertNotifications() - .withState(State.fromString("On")) - .withMinimalSeverity(MinimalSeverity.LOW)) - .withNotificationsByRole( - new SecurityContactPropertiesNotificationsByRole() - .withState(State.fromString("On")) - .withRoles(Arrays.asList(Roles.OWNER))) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteSamples.java deleted file mode 100644 index 98c33bc4588f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SecurityContacts Delete. */ -public final class SecurityContactsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/DeleteSecurityContact_example.json - */ - /** - * Sample code: Deletes a security contact data. - * - * @param manager Entry point to SecurityManager. - */ - public static void deletesASecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts().deleteWithResponse("default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsGetSamples.java deleted file mode 100644 index dae37c8f541a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecurityContacts Get. */ -public final class SecurityContactsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/GetSecurityContact_example.json - */ - /** - * Sample code: Get a security contact. - * - * @param manager Entry point to SecurityManager. - */ - public static void getASecurityContact(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts().getWithResponse("default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsListSamples.java deleted file mode 100644 index 5faedd5eb8e6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityContactsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecurityContacts List. */ -public final class SecurityContactsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/GetSecurityContactsSubscription_example.json - */ - /** - * Sample code: List security contact data. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityContactData(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityContacts().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsCreateOrUpdateSamples.java deleted file mode 100644 index 7c3df1c5f7af..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsCreateOrUpdateSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecurityOperators CreateOrUpdate. */ -public final class SecurityOperatorsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/PutSecurityOperatorByName_example.json - */ - /** - * Sample code: Create a security operator on the given scope. - * - * @param manager Entry point to SecurityManager. - */ - public static void createASecurityOperatorOnTheGivenScope( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityOperators() - .createOrUpdateWithResponse( - "CloudPosture", "DefenderCSPMSecurityOperator", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsDeleteSamples.java deleted file mode 100644 index adcfb5eca9b0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsDeleteSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecurityOperators Delete. */ -public final class SecurityOperatorsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/DeleteSecurityOperatorByName_example.json - */ - /** - * Sample code: Delete SecurityOperator on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteSecurityOperatorOnSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityOperators() - .deleteByResourceGroupWithResponse( - "CloudPosture", "DefenderCSPMSecurityOperator", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsGetSamples.java deleted file mode 100644 index ad5c63907d76..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecurityOperators Get. */ -public final class SecurityOperatorsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/GetSecurityOperatorByName_example.json - */ - /** - * Sample code: Get a specific security operator by scope and securityOperatorName. - * - * @param manager Entry point to SecurityManager. - */ - public static void getASpecificSecurityOperatorByScopeAndSecurityOperatorName( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securityOperators() - .getWithResponse("CloudPosture", "DefenderCSPMSecurityOperator", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsListSamples.java deleted file mode 100644 index 9261288d508d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecurityOperatorsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecurityOperators List. */ -public final class SecurityOperatorsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/ListSecurityOperators_example.json - */ - /** - * Sample code: List SecurityOperators. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecurityOperators(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securityOperators().listWithResponse("CloudPosture", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetSamples.java deleted file mode 100644 index 8e97ea287cbc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecuritySolutions Get. */ -public final class SecuritySolutionsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/GetSecuritySolutionsResourceGroupLocation_example.json - */ - /** - * Sample code: Get a security solution from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getASecuritySolutionFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securitySolutions() - .getWithResponse("myRg2", "centralus", "paloalto7", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListSamples.java deleted file mode 100644 index cd069ae64f54..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SecuritySolutions List. */ -public final class SecuritySolutionsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/GetSecuritySolutionsSubscription_example.json - */ - /** - * Sample code: Get security solutions. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securitySolutions().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListByHomeRegionSamples.java deleted file mode 100644 index 95bd65225042..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListByHomeRegionSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SecuritySolutionsReferenceData ListByHomeRegion. */ -public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscriptionLocation_example.json - */ - /** - * Sample code: Get security solutions from a security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecuritySolutionsFromASecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .securitySolutionsReferenceDatas() - .listByHomeRegionWithResponse("westcentralus", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListSamples.java deleted file mode 100644 index a8d096022f4d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SecuritySolutionsReferenceData List. */ -public final class SecuritySolutionsReferenceDataListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscription_example.json - */ - /** - * Sample code: Get security solutions. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecuritySolutions(com.azure.resourcemanager.security.SecurityManager manager) { - manager.securitySolutionsReferenceDatas().listWithResponse(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java deleted file mode 100644 index ed274653d4c6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentCreateOrUpdateSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for ServerVulnerabilityAssessment CreateOrUpdate. */ -public final class ServerVulnerabilityAssessmentCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/CreateServerVulnerabilityAssessments_example.json - */ - /** - * Sample code: Create a server vulnerability assessments on a resource. Only 'default' resource is supported. Once - * creating the resource, the server will be onboarded to vulnerability assessment by Microsoft.Security. - * - * @param manager Entry point to SecurityManager. - */ - public static void - createAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceCreatingTheResourceTheServerWillBeOnboardedToVulnerabilityAssessmentByMicrosoftSecurity( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .serverVulnerabilityAssessments() - .createOrUpdateWithResponse( - "rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentDeleteSamples.java deleted file mode 100644 index f21b5996ca05..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for ServerVulnerabilityAssessment Delete. */ -public final class ServerVulnerabilityAssessmentDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/DeleteServerVulnerabilityAssessments_example.json - */ - /** - * Sample code: Delete a server vulnerability assessments on a resource. Only 'default' resource is supported. Once - * deleting, Microsoft.Security will not provide vulnerability assessment findings on the resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void - deleteAServerVulnerabilityAssessmentsOnAResourceOnlyDefaultResourceIsSupportedOnceDeletingMicrosoftSecurityWillNotProvideVulnerabilityAssessmentFindingsOnTheResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .serverVulnerabilityAssessments() - .delete("rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentGetSamples.java deleted file mode 100644 index c09f90755c08..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for ServerVulnerabilityAssessment Get. */ -public final class ServerVulnerabilityAssessmentGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/GetServerVulnerabilityAssessments_example.json - */ - /** - * Sample code: Get a server vulnerability assessments onboarding status on a resource. Currently Microsoft.Security - * only supports the single 'default' resource. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getAServerVulnerabilityAssessmentsOnboardingStatusOnAResourceCurrentlyMicrosoftSecurityOnlySupportsTheSingleDefaultResource( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .serverVulnerabilityAssessments() - .getWithResponse("rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java deleted file mode 100644 index 452d11d29830..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentListByExtendedResourceSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for ServerVulnerabilityAssessment ListByExtendedResource. */ -public final class ServerVulnerabilityAssessmentListByExtendedResourceSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/ListByExtendedResourceServerVulnerabilityAssessments_example.json - */ - /** - * Sample code: Get a list of server vulnerability assessments on a resource. Though this API returns a list, - * Currently Microsoft.Security only supports a single default type of server vulnerability assessment. - * - * @param manager Entry point to SecurityManager. - */ - public static void - getAListOfServerVulnerabilityAssessmentsOnAResourceThoughThisAPIReturnsAListCurrentlyMicrosoftSecurityOnlySupportsASingleDefaultTypeOfServerVulnerabilityAssessment( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .serverVulnerabilityAssessments() - .listByExtendedResourceWithResponse( - "rg1", "Microsoft.Compute", "virtualMachines", "vm1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsGetSamples.java deleted file mode 100644 index 058d115b4ebe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsGetSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.SettingName; - -/** Samples for Settings Get. */ -public final class SettingsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example.json - */ - /** - * Sample code: Get a setting on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getASettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.settings().getWithResponse(SettingName.WDATP, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsListSamples.java deleted file mode 100644 index f86c285f8210..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Settings List. */ -public final class SettingsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json - */ - /** - * Sample code: Get settings of subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSettingsOfSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.settings().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsUpdateSamples.java deleted file mode 100644 index 5a1fa53dafbe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SettingsUpdateSamples.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.DataExportSettings; -import com.azure.resourcemanager.security.models.SettingName; - -/** Samples for Settings Update. */ -public final class SettingsUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/UpdateSetting_example.json - */ - /** - * Sample code: Update a setting for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateASettingForSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .settings() - .updateWithResponse( - SettingName.WDATP, new DataExportSettings().withEnabled(true), com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetSamples.java deleted file mode 100644 index 8a2b88493c57..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SoftwareInventories Get. */ -public final class SoftwareInventoriesGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/GetSoftware_example.json - */ - /** - * Sample code: Gets a single software data of the virtual machine. - * - * @param manager Entry point to SecurityManager. - */ - public static void getsASingleSoftwareDataOfTheVirtualMachine( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .softwareInventories() - .getWithResponse( - "EITAN-TESTS", - "Microsoft.Compute", - "virtualMachines", - "Eitan-Test1", - "outlook_16.0.10371.20060", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceSamples.java deleted file mode 100644 index 83a8fa334a83..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SoftwareInventories ListByExtendedResource. */ -public final class SoftwareInventoriesListByExtendedResourceSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/ListByExtendedResourceSoftwareInventories_example.json - */ - /** - * Sample code: Gets the software inventory of the virtual machine. - * - * @param manager Entry point to SecurityManager. - */ - public static void getsTheSoftwareInventoryOfTheVirtualMachine( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .softwareInventories() - .listByExtendedResource( - "EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListSamples.java deleted file mode 100644 index 466e95d79592..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SoftwareInventories List. */ -public final class SoftwareInventoriesListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/ListBySubscriptionSoftwareInventories_example.json - */ - /** - * Sample code: Gets the software inventory of all virtual machines in the subscriptions. - * - * @param manager Entry point to SecurityManager. - */ - public static void getsTheSoftwareInventoryOfAllVirtualMachinesInTheSubscriptions( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.softwareInventories().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java deleted file mode 100644 index c2a326cd6392..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddSamples.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.RulesResultsInput; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** Samples for SqlVulnerabilityAssessmentBaselineRules Add. */ -public final class SqlVulnerabilityAssessmentBaselineRulesAddSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Add.json - */ - /** - * Sample code: Create a baseline for all rules. - * - * @param manager Entry point to SecurityManager. - */ - public static void createABaselineForAllRules(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentBaselineRules() - .addWithResponse( - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - new RulesResultsInput() - .withLatestScan(false) - .withResults( - mapOf( - "VA1234", - Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT")), - "VA5678", - Arrays.asList(Arrays.asList("Test", "0.0.0.0", "125.125.125.125")))), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_AddLatest.json - */ - /** - * Sample code: Create a baseline for all rules using the latest scan results. - * - * @param manager Entry point to SecurityManager. - */ - public static void createABaselineForAllRulesUsingTheLatestScanResults( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentBaselineRules() - .addWithResponse( - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - new RulesResultsInput().withLatestScan(true).withResults(mapOf()), - com.azure.core.util.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/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java deleted file mode 100644 index e7a520b74f21..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import java.util.Arrays; - -/** Samples for SqlVulnerabilityAssessmentBaselineRules CreateOrUpdate. */ -public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_PutLatest.json - */ - /** - * Sample code: Create a baseline using the latest scan results. - * - * @param manager Entry point to SecurityManager. - */ - public static void createABaselineUsingTheLatestScanResults( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentBaselineRules() - .define("VA1234") - .withExistingResourceId( - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master") - .withLatestScan(true) - .withResults(Arrays.asList()) - .withWorkspaceId("55555555-6666-7777-8888-999999999999") - .create(); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Put.json - */ - /** - * Sample code: Create a baseline. - * - * @param manager Entry point to SecurityManager. - */ - public static void createABaseline(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentBaselineRules() - .define("VA1234") - .withExistingResourceId( - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master") - .withLatestScan(false) - .withResults(Arrays.asList(Arrays.asList("userA", "SELECT"), Arrays.asList("userB", "SELECT"))) - .withWorkspaceId("55555555-6666-7777-8888-999999999999") - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteSamples.java deleted file mode 100644 index 85019c61a57f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SqlVulnerabilityAssessmentBaselineRules Delete. */ -public final class SqlVulnerabilityAssessmentBaselineRulesDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Delete.json - */ - /** - * Sample code: Delete the baseline. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteTheBaseline(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentBaselineRules() - .deleteWithResponse( - "VA1234", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetSamples.java deleted file mode 100644 index 7b46ac27add6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SqlVulnerabilityAssessmentBaselineRules Get. */ -public final class SqlVulnerabilityAssessmentBaselineRulesGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Get.json - */ - /** - * Sample code: Get the baseline. - * - * @param manager Entry point to SecurityManager. - */ - public static void getTheBaseline(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentBaselineRules() - .getWithResponse( - "VA1234", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListSamples.java deleted file mode 100644 index c30093dd44f7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SqlVulnerabilityAssessmentBaselineRules List. */ -public final class SqlVulnerabilityAssessmentBaselineRulesListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_List.json - */ - /** - * Sample code: List baseline for all rules. - * - * @param manager Entry point to SecurityManager. - */ - public static void listBaselineForAllRules(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentBaselineRules() - .listWithResponse( - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetSamples.java deleted file mode 100644 index c3c8bfa04554..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetSamples.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SqlVulnerabilityAssessmentScanResults Get. */ -public final class SqlVulnerabilityAssessmentScanResultsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_Get.json - */ - /** - * Sample code: Get scan details of a scan record. - * - * @param manager Entry point to SecurityManager. - */ - public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentScanResults() - .getWithResponse( - "Scheduled-20200623", - "VA2063", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_GetLatest.json - */ - /** - * Sample code: Get scan details of the latest scan record. - * - * @param manager Entry point to SecurityManager. - */ - public static void getScanDetailsOfTheLatestScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentScanResults() - .getWithResponse( - "latest", - "VA2063", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListSamples.java deleted file mode 100644 index 098caee04195..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListSamples.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SqlVulnerabilityAssessmentScanResults List. */ -public final class SqlVulnerabilityAssessmentScanResultsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_ListLatest.json - */ - /** - * Sample code: List scan results of the latest scan. - * - * @param manager Entry point to SecurityManager. - */ - public static void listScanResultsOfTheLatestScan(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentScanResults() - .listWithResponse( - "latest", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_List.json - */ - /** - * Sample code: List scan results. - * - * @param manager Entry point to SecurityManager. - */ - public static void listScanResults(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentScanResults() - .listWithResponse( - "Scheduled-20200623", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetSamples.java deleted file mode 100644 index b99cdce70a1d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetSamples.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SqlVulnerabilityAssessmentScans Get. */ -public final class SqlVulnerabilityAssessmentScansGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_Get.json - */ - /** - * Sample code: Get scan details of a scan record. - * - * @param manager Entry point to SecurityManager. - */ - public static void getScanDetailsOfAScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentScans() - .getWithResponse( - "Scheduled-20200623", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_GetLatest.json - */ - /** - * Sample code: Get scan details of the latest scan record. - * - * @param manager Entry point to SecurityManager. - */ - public static void getScanDetailsOfTheLatestScanRecord(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentScans() - .getWithResponse( - "latest", - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListSamples.java deleted file mode 100644 index 3c9a74495737..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SqlVulnerabilityAssessmentScans List. */ -public final class SqlVulnerabilityAssessmentScansListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_List.json - */ - /** - * Sample code: List scan details. - * - * @param manager Entry point to SecurityManager. - */ - public static void listScanDetails(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .sqlVulnerabilityAssessmentScans() - .listWithResponse( - "55555555-6666-7777-8888-999999999999", - "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsGetSamples.java deleted file mode 100644 index 74ccfe4b7b9f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SubAssessments Get. */ -public final class SubAssessmentsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/GetSubAssessment_example.json - */ - /** - * Sample code: Get security recommendation task from security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityRecommendationTaskFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .subAssessments() - .getWithResponse( - "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2", - "1195afff-c881-495e-9bc5-1486211ae03f", - "95f7da9c-a2a4-1322-0758-fcd24ef09b85", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListAllSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListAllSamples.java deleted file mode 100644 index 5e92a236f32c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListAllSamples.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for SubAssessments ListAll. */ -public final class SubAssessmentsListAllSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubscriptionSubAssessments_example.json - */ - /** - * Sample code: List security sub-assessments. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .subAssessments() - .listAll("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/SubAssessmentsListSamples.java deleted file mode 100644 index 0b526b319fab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for SubAssessments List. */ -public final class SubAssessmentsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubAssessments_example.json - */ - /** - * Sample code: List security sub-assessments. - * - * @param manager Entry point to SecurityManager. - */ - public static void listSecuritySubAssessments(com.azure.resourcemanager.security.SecurityManager manager) { - manager - .subAssessments() - .list( - "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", - "82e20e14-edc5-4373-bfc4-f13121257c37", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskSamples.java deleted file mode 100644 index afaf7627eff1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Tasks GetResourceGroupLevelTask. */ -public final class TasksGetResourceGroupLevelTaskSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskResourceGroupLocation_example.json - */ - /** - * Sample code: Get security recommendation task in a resource group. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityRecommendationTaskInAResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .tasks() - .getResourceGroupLevelTaskWithResponse( - "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskSamples.java deleted file mode 100644 index 91f312037256..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskSamples.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Tasks GetSubscriptionLevelTask. */ -public final class TasksGetSubscriptionLevelTaskSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskSubscriptionLocation_example.json - */ - /** - * Sample code: Get security recommendation task from security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityRecommendationTaskFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .tasks() - .getSubscriptionLevelTaskWithResponse( - "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionSamples.java deleted file mode 100644 index 4c70b24b9cb3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Tasks ListByHomeRegion. */ -public final class TasksListByHomeRegionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscriptionLocation_example.json - */ - /** - * Sample code: Get security recommendations tasks from security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityRecommendationsTasksFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.tasks().listByHomeRegion("westeurope", null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupSamples.java deleted file mode 100644 index c47d54fe6d70..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Tasks ListByResourceGroup. */ -public final class TasksListByResourceGroupSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksResourceGroupLocation_example.json - */ - /** - * Sample code: Get security recommendation tasks in a resource group. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityRecommendationTasksInAResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.tasks().listByResourceGroup("myRg", "westeurope", null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListSamples.java deleted file mode 100644 index 5a8d972d8aa6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for Tasks List. */ -public final class TasksListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscription_example.json - */ - /** - * Sample code: Get security recommendations tasks. - * - * @param manager Entry point to SecurityManager. - */ - public static void getSecurityRecommendationsTasks(com.azure.resourcemanager.security.SecurityManager manager) { - manager.tasks().list(null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateSamples.java deleted file mode 100644 index cd5b5f66f01f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.TaskUpdateActionType; - -/** Samples for Tasks UpdateResourceGroupLevelTaskState. */ -public final class TasksUpdateResourceGroupLevelTaskStateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/UpdateTaskResourceGroupLocation_example.json - */ - /** - * Sample code: Change security recommendation task state. - * - * @param manager Entry point to SecurityManager. - */ - public static void changeSecurityRecommendationTaskState( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .tasks() - .updateResourceGroupLevelTaskStateWithResponse( - "myRg", - "westeurope", - "d55b4dc0-779c-c66c-33e5-d7bce24c4222", - TaskUpdateActionType.DISMISS, - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateSamples.java deleted file mode 100644 index d90f3ab1966a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateSamples.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.TaskUpdateActionType; - -/** Samples for Tasks UpdateSubscriptionLevelTaskState. */ -public final class TasksUpdateSubscriptionLevelTaskStateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/UpdateTaskSubscriptionLocation_example.json - */ - /** - * Sample code: Change security recommendation task state. - * - * @param manager Entry point to SecurityManager. - */ - public static void changeSecurityRecommendationTaskState( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .tasks() - .updateSubscriptionLevelTaskStateWithResponse( - "westeurope", - "62609ee7-d0a5-8616-9fe4-1df5cca7758d", - TaskUpdateActionType.DISMISS, - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyGetSamples.java deleted file mode 100644 index 05a3dae07640..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Topology Get. */ -public final class TopologyGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopology_example.json - */ - /** - * Sample code: Get topology. - * - * @param manager Entry point to SecurityManager. - */ - public static void getTopology(com.azure.resourcemanager.security.SecurityManager manager) { - manager.topologies().getWithResponse("myservers", "centralus", "vnets", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListByHomeRegionSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListByHomeRegionSamples.java deleted file mode 100644 index 75842d2af62e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Topology ListByHomeRegion. */ -public final class TopologyListByHomeRegionSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscriptionLocation_example.json - */ - /** - * Sample code: Get topology on a subscription from security data location. - * - * @param manager Entry point to SecurityManager. - */ - public static void getTopologyOnASubscriptionFromSecurityDataLocation( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.topologies().listByHomeRegion("centralus", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/TopologyListSamples.java deleted file mode 100644 index b6e52888605a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for Topology List. */ -public final class TopologyListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscription_example.json - */ - /** - * Sample code: Get topology on a subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getTopologyOnASubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.topologies().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateSamples.java deleted file mode 100644 index f0b501ff063a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateSamples.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for WorkspaceSettings Create. */ -public final class WorkspaceSettingsCreateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/CreateWorkspaceSetting_example.json - */ - /** - * Sample code: Create a workspace setting data for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void createAWorkspaceSettingDataForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - manager - .workspaceSettings() - .define("default") - .withWorkspaceId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace") - .withScope("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23") - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteSamples.java deleted file mode 100644 index 19c01da6846c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/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.generated; - -/** Samples for WorkspaceSettings Delete. */ -public final class WorkspaceSettingsDeleteSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/DeleteWorkspaceSetting_example.json - */ - /** - * Sample code: Delete a workspace setting data for resource group. - * - * @param manager Entry point to SecurityManager. - */ - public static void deleteAWorkspaceSettingDataForResourceGroup( - com.azure.resourcemanager.security.SecurityManager manager) { - manager.workspaceSettings().deleteWithResponse("default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetSamples.java deleted file mode 100644 index 08c7f4dbd305..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for WorkspaceSettings Get. */ -public final class WorkspaceSettingsGetSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/GetWorkspaceSetting_example.json - */ - /** - * Sample code: Get a workspace setting on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getAWorkspaceSettingOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.workspaceSettings().getWithResponse("default", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListSamples.java deleted file mode 100644 index df53ac48f04e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListSamples.java +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -/** Samples for WorkspaceSettings List. */ -public final class WorkspaceSettingsListSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/GetWorkspaceSettings_example.json - */ - /** - * Sample code: Get workspace settings on subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void getWorkspaceSettingsOnSubscription(com.azure.resourcemanager.security.SecurityManager manager) { - manager.workspaceSettings().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsUpdateSamples.java b/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsUpdateSamples.java deleted file mode 100644 index 2fbcebb231ae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/samples/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsUpdateSamples.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.resourcemanager.security.models.WorkspaceSetting; - -/** Samples for WorkspaceSettings Update. */ -public final class WorkspaceSettingsUpdateSamples { - /* - * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/UpdateWorkspaceSetting_example.json - */ - /** - * Sample code: Update a workspace setting data for subscription. - * - * @param manager Entry point to SecurityManager. - */ - public static void updateAWorkspaceSettingDataForSubscription( - com.azure.resourcemanager.security.SecurityManager manager) { - WorkspaceSetting resource = - manager.workspaceSettings().getWithResponse("default", com.azure.core.util.Context.NONE).getValue(); - resource - .update() - .withWorkspaceId( - "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace") - .apply(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadConnectivityStateAutoGeneratedTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadConnectivityStateAutoGeneratedTests.java deleted file mode 100644 index 6017d8ddf8b6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadConnectivityStateAutoGeneratedTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AadConnectivityState; -import com.azure.resourcemanager.security.models.AadConnectivityStateAutoGenerated; -import org.junit.jupiter.api.Assertions; - -public final class AadConnectivityStateAutoGeneratedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AadConnectivityStateAutoGenerated model = - BinaryData - .fromString("{\"connectivityState\":\"NotLicensed\"}") - .toObject(AadConnectivityStateAutoGenerated.class); - Assertions.assertEquals(AadConnectivityState.NOT_LICENSED, model.connectivityState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AadConnectivityStateAutoGenerated model = - new AadConnectivityStateAutoGenerated().withConnectivityState(AadConnectivityState.NOT_LICENSED); - model = BinaryData.fromObject(model).toObject(AadConnectivityStateAutoGenerated.class); - Assertions.assertEquals(AadConnectivityState.NOT_LICENSED, model.connectivityState()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadExternalSecuritySolutionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadExternalSecuritySolutionTests.java deleted file mode 100644 index c50ccc6f7816..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadExternalSecuritySolutionTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AadConnectivityState; -import com.azure.resourcemanager.security.models.AadExternalSecuritySolution; -import com.azure.resourcemanager.security.models.AadSolutionProperties; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class AadExternalSecuritySolutionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AadExternalSecuritySolution model = - BinaryData - .fromString( - "{\"kind\":\"AAD\",\"properties\":{\"connectivityState\":\"NotLicensed\",\"deviceVendor\":\"pezkis\",\"deviceType\":\"jm\",\"workspace\":{\"id\":\"syparybjufp\"},\"\":{\"uiyqvldaswvppi\":\"dataczjnc\",\"rr\":\"dataqqzlgcndhz\",\"uww\":\"datacfsrhkhgsn\"}},\"location\":\"phefsbzxlbz\",\"id\":\"omeikjcl\",\"name\":\"zacn\",\"type\":\"wpfsuqtaaz\"}") - .toObject(AadExternalSecuritySolution.class); - Assertions.assertEquals("pezkis", model.properties().deviceVendor()); - Assertions.assertEquals("jm", model.properties().deviceType()); - Assertions.assertEquals("syparybjufp", model.properties().workspace().id()); - Assertions.assertEquals(AadConnectivityState.NOT_LICENSED, model.properties().connectivityState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AadExternalSecuritySolution model = - new AadExternalSecuritySolution() - .withProperties( - new AadSolutionProperties() - .withDeviceVendor("pezkis") - .withDeviceType("jm") - .withWorkspace(new ConnectedWorkspace().withId("syparybjufp")) - .withConnectivityState(AadConnectivityState.NOT_LICENSED)); - model = BinaryData.fromObject(model).toObject(AadExternalSecuritySolution.class); - Assertions.assertEquals("pezkis", model.properties().deviceVendor()); - Assertions.assertEquals("jm", model.properties().deviceType()); - Assertions.assertEquals("syparybjufp", model.properties().workspace().id()); - Assertions.assertEquals(AadConnectivityState.NOT_LICENSED, model.properties().connectivityState()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadSolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadSolutionPropertiesTests.java deleted file mode 100644 index 37e583a94f5b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AadSolutionPropertiesTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AadConnectivityState; -import com.azure.resourcemanager.security.models.AadSolutionProperties; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class AadSolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AadSolutionProperties model = - BinaryData - .fromString( - "{\"connectivityState\":\"Discovered\",\"deviceVendor\":\"yxoyfp\",\"deviceType\":\"qi\",\"workspace\":{\"id\":\"xlhdj\"},\"\":{\"jriyb\":\"datacadwvpsozjii\",\"epnxwd\":\"datarz\",\"xaurs\":\"datawnjkgvfn\",\"pnqn\":\"dataftibtyibuyvpirfq\"}}") - .toObject(AadSolutionProperties.class); - Assertions.assertEquals("yxoyfp", model.deviceVendor()); - Assertions.assertEquals("qi", model.deviceType()); - Assertions.assertEquals("xlhdj", model.workspace().id()); - Assertions.assertEquals(AadConnectivityState.DISCOVERED, model.connectivityState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AadSolutionProperties model = - new AadSolutionProperties() - .withDeviceVendor("yxoyfp") - .withDeviceType("qi") - .withWorkspace(new ConnectedWorkspace().withId("xlhdj")) - .withConnectivityState(AadConnectivityState.DISCOVERED); - model = BinaryData.fromObject(model).toObject(AadSolutionProperties.class); - Assertions.assertEquals("yxoyfp", model.deviceVendor()); - Assertions.assertEquals("qi", model.deviceType()); - Assertions.assertEquals("xlhdj", model.workspace().id()); - Assertions.assertEquals(AadConnectivityState.DISCOVERED, model.connectivityState()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ActiveConnectionsNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ActiveConnectionsNotInAllowedRangeTests.java deleted file mode 100644 index 07c05e9dbb03..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ActiveConnectionsNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ActiveConnectionsNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class ActiveConnectionsNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ActiveConnectionsNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"ActiveConnectionsNotInAllowedRange\",\"timeWindowSize\":\"PT166H22M2S\",\"minThreshold\":1327259513,\"maxThreshold\":713961317,\"displayName\":\"n\",\"description\":\"mehllizhceu\",\"isEnabled\":true}") - .toObject(ActiveConnectionsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1327259513, model.minThreshold()); - Assertions.assertEquals(713961317, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT166H22M2S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ActiveConnectionsNotInAllowedRange model = - new ActiveConnectionsNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(1327259513) - .withMaxThreshold(713961317) - .withTimeWindowSize(Duration.parse("PT166H22M2S")); - model = BinaryData.fromObject(model).toObject(ActiveConnectionsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1327259513, model.minThreshold()); - Assertions.assertEquals(713961317, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT166H22M2S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupDataTests.java deleted file mode 100644 index 05cb8413a6c2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupDataTests.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupData; -import com.azure.resourcemanager.security.models.ConfigurationStatus; -import com.azure.resourcemanager.security.models.EnforcementMode; -import com.azure.resourcemanager.security.models.EnforcementSupport; -import com.azure.resourcemanager.security.models.FileType; -import com.azure.resourcemanager.security.models.PathRecommendation; -import com.azure.resourcemanager.security.models.ProtectionMode; -import com.azure.resourcemanager.security.models.PublisherInfo; -import com.azure.resourcemanager.security.models.RecommendationAction; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.VmRecommendation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveApplicationControlGroupDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveApplicationControlGroupData model = - BinaryData - .fromString( - "{\"enforcementMode\":\"Audit\",\"protectionMode\":{\"exe\":\"None\",\"msi\":\"None\",\"script\":\"None\",\"executable\":\"Audit\"},\"configurationStatus\":\"InProgress\",\"recommendationStatus\":\"NotRecommended\",\"issues\":[{\"issue\":\"RulesViolatedManually\",\"numberOfVms\":15.610468}],\"sourceSystem\":\"Azure_AuditD\",\"vmRecommendations\":[{\"configurationStatus\":\"NoStatus\",\"recommendationAction\":\"Recommended\",\"resourceId\":\"hlf\",\"enforcementSupport\":\"Supported\"}],\"pathRecommendations\":[{\"path\":\"wahfbousnfepgfew\",\"action\":\"Add\",\"type\":\"IoT_SharedCredentials\",\"publisherInfo\":{\"publisherName\":\"ncxykxhdjhlimm\",\"productName\":\"x\",\"binaryName\":\"bcporxvxcjzhqizx\",\"version\":\"xtgqscjavftjuh\"},\"common\":true,\"userSids\":[\"mtggu\"],\"usernames\":[],\"fileType\":\"Script\",\"configurationStatus\":\"Failed\"}]}") - .toObject(AdaptiveApplicationControlGroupData.class); - Assertions.assertEquals(EnforcementMode.AUDIT, model.enforcementMode()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().exe()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().msi()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().script()); - Assertions.assertEquals(EnforcementMode.AUDIT, model.protectionMode().executable()); - Assertions.assertEquals(ConfigurationStatus.NO_STATUS, model.vmRecommendations().get(0).configurationStatus()); - Assertions - .assertEquals(RecommendationAction.RECOMMENDED, model.vmRecommendations().get(0).recommendationAction()); - Assertions.assertEquals("hlf", model.vmRecommendations().get(0).resourceId()); - Assertions.assertEquals(EnforcementSupport.SUPPORTED, model.vmRecommendations().get(0).enforcementSupport()); - Assertions.assertEquals("wahfbousnfepgfew", model.pathRecommendations().get(0).path()); - Assertions.assertEquals(RecommendationAction.ADD, model.pathRecommendations().get(0).action()); - Assertions.assertEquals(RecommendationType.IO_T_SHARED_CREDENTIALS, model.pathRecommendations().get(0).type()); - Assertions.assertEquals("ncxykxhdjhlimm", model.pathRecommendations().get(0).publisherInfo().publisherName()); - Assertions.assertEquals("x", model.pathRecommendations().get(0).publisherInfo().productName()); - Assertions.assertEquals("bcporxvxcjzhqizx", model.pathRecommendations().get(0).publisherInfo().binaryName()); - Assertions.assertEquals("xtgqscjavftjuh", model.pathRecommendations().get(0).publisherInfo().version()); - Assertions.assertEquals(true, model.pathRecommendations().get(0).common()); - Assertions.assertEquals("mtggu", model.pathRecommendations().get(0).userSids().get(0)); - Assertions.assertEquals(FileType.SCRIPT, model.pathRecommendations().get(0).fileType()); - Assertions.assertEquals(ConfigurationStatus.FAILED, model.pathRecommendations().get(0).configurationStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveApplicationControlGroupData model = - new AdaptiveApplicationControlGroupData() - .withEnforcementMode(EnforcementMode.AUDIT) - .withProtectionMode( - new ProtectionMode() - .withExe(EnforcementMode.NONE) - .withMsi(EnforcementMode.NONE) - .withScript(EnforcementMode.NONE) - .withExecutable(EnforcementMode.AUDIT)) - .withVmRecommendations( - Arrays - .asList( - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.NO_STATUS) - .withRecommendationAction(RecommendationAction.RECOMMENDED) - .withResourceId("hlf") - .withEnforcementSupport(EnforcementSupport.SUPPORTED))) - .withPathRecommendations( - Arrays - .asList( - new PathRecommendation() - .withPath("wahfbousnfepgfew") - .withAction(RecommendationAction.ADD) - .withType(RecommendationType.IO_T_SHARED_CREDENTIALS) - .withPublisherInfo( - new PublisherInfo() - .withPublisherName("ncxykxhdjhlimm") - .withProductName("x") - .withBinaryName("bcporxvxcjzhqizx") - .withVersion("xtgqscjavftjuh")) - .withCommon(true) - .withUserSids(Arrays.asList("mtggu")) - .withUsernames(Arrays.asList()) - .withFileType(FileType.SCRIPT) - .withConfigurationStatus(ConfigurationStatus.FAILED))); - model = BinaryData.fromObject(model).toObject(AdaptiveApplicationControlGroupData.class); - Assertions.assertEquals(EnforcementMode.AUDIT, model.enforcementMode()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().exe()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().msi()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().script()); - Assertions.assertEquals(EnforcementMode.AUDIT, model.protectionMode().executable()); - Assertions.assertEquals(ConfigurationStatus.NO_STATUS, model.vmRecommendations().get(0).configurationStatus()); - Assertions - .assertEquals(RecommendationAction.RECOMMENDED, model.vmRecommendations().get(0).recommendationAction()); - Assertions.assertEquals("hlf", model.vmRecommendations().get(0).resourceId()); - Assertions.assertEquals(EnforcementSupport.SUPPORTED, model.vmRecommendations().get(0).enforcementSupport()); - Assertions.assertEquals("wahfbousnfepgfew", model.pathRecommendations().get(0).path()); - Assertions.assertEquals(RecommendationAction.ADD, model.pathRecommendations().get(0).action()); - Assertions.assertEquals(RecommendationType.IO_T_SHARED_CREDENTIALS, model.pathRecommendations().get(0).type()); - Assertions.assertEquals("ncxykxhdjhlimm", model.pathRecommendations().get(0).publisherInfo().publisherName()); - Assertions.assertEquals("x", model.pathRecommendations().get(0).publisherInfo().productName()); - Assertions.assertEquals("bcporxvxcjzhqizx", model.pathRecommendations().get(0).publisherInfo().binaryName()); - Assertions.assertEquals("xtgqscjavftjuh", model.pathRecommendations().get(0).publisherInfo().version()); - Assertions.assertEquals(true, model.pathRecommendations().get(0).common()); - Assertions.assertEquals("mtggu", model.pathRecommendations().get(0).userSids().get(0)); - Assertions.assertEquals(FileType.SCRIPT, model.pathRecommendations().get(0).fileType()); - Assertions.assertEquals(ConfigurationStatus.FAILED, model.pathRecommendations().get(0).configurationStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupInnerTests.java deleted file mode 100644 index 77f3305d4bde..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupInnerTests.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupInner; -import com.azure.resourcemanager.security.models.ConfigurationStatus; -import com.azure.resourcemanager.security.models.EnforcementMode; -import com.azure.resourcemanager.security.models.EnforcementSupport; -import com.azure.resourcemanager.security.models.FileType; -import com.azure.resourcemanager.security.models.PathRecommendation; -import com.azure.resourcemanager.security.models.ProtectionMode; -import com.azure.resourcemanager.security.models.RecommendationAction; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.VmRecommendation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveApplicationControlGroupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveApplicationControlGroupInner model = - BinaryData - .fromString( - "{\"properties\":{\"enforcementMode\":\"Enforce\",\"protectionMode\":{\"exe\":\"Audit\",\"msi\":\"Enforce\",\"script\":\"None\",\"executable\":\"Audit\"},\"configurationStatus\":\"Configured\",\"recommendationStatus\":\"NoStatus\",\"issues\":[{\"issue\":\"ExecutableViolationsAudited\",\"numberOfVms\":81.69838},{\"issue\":\"ExecutableViolationsAudited\",\"numberOfVms\":25.884687},{\"issue\":\"ViolationsBlocked\",\"numberOfVms\":0.6237805}],\"sourceSystem\":\"None\",\"vmRecommendations\":[{\"configurationStatus\":\"Failed\",\"recommendationAction\":\"Remove\",\"resourceId\":\"hlabrq\",\"enforcementSupport\":\"Unknown\"},{\"configurationStatus\":\"NoStatus\",\"recommendationAction\":\"Recommended\",\"resourceId\":\"trgaehvv\",\"enforcementSupport\":\"NotSupported\"},{\"configurationStatus\":\"NoStatus\",\"recommendationAction\":\"Remove\",\"resourceId\":\"oqbeitpkxzt\",\"enforcementSupport\":\"Supported\"},{\"configurationStatus\":\"InProgress\",\"recommendationAction\":\"Remove\",\"resourceId\":\"idgfc\",\"enforcementSupport\":\"NotSupported\"}],\"pathRecommendations\":[{\"path\":\"aqxzhemjyho\",\"action\":\"Remove\",\"type\":\"IoT_EdgeLoggingOptions\",\"common\":true,\"userSids\":[],\"usernames\":[],\"fileType\":\"Script\",\"configurationStatus\":\"Configured\"}]},\"location\":\"kb\",\"id\":\"wpfaj\",\"name\":\"jwltlwtjjgu\",\"type\":\"talhsnvkcdmxzr\"}") - .toObject(AdaptiveApplicationControlGroupInner.class); - Assertions.assertEquals(EnforcementMode.ENFORCE, model.enforcementMode()); - Assertions.assertEquals(EnforcementMode.AUDIT, model.protectionMode().exe()); - Assertions.assertEquals(EnforcementMode.ENFORCE, model.protectionMode().msi()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().script()); - Assertions.assertEquals(EnforcementMode.AUDIT, model.protectionMode().executable()); - Assertions.assertEquals(ConfigurationStatus.FAILED, model.vmRecommendations().get(0).configurationStatus()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.vmRecommendations().get(0).recommendationAction()); - Assertions.assertEquals("hlabrq", model.vmRecommendations().get(0).resourceId()); - Assertions.assertEquals(EnforcementSupport.UNKNOWN, model.vmRecommendations().get(0).enforcementSupport()); - Assertions.assertEquals("aqxzhemjyho", model.pathRecommendations().get(0).path()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.pathRecommendations().get(0).action()); - Assertions - .assertEquals(RecommendationType.IO_T_EDGE_LOGGING_OPTIONS, model.pathRecommendations().get(0).type()); - Assertions.assertEquals(true, model.pathRecommendations().get(0).common()); - Assertions.assertEquals(FileType.SCRIPT, model.pathRecommendations().get(0).fileType()); - Assertions - .assertEquals(ConfigurationStatus.CONFIGURED, model.pathRecommendations().get(0).configurationStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveApplicationControlGroupInner model = - new AdaptiveApplicationControlGroupInner() - .withEnforcementMode(EnforcementMode.ENFORCE) - .withProtectionMode( - new ProtectionMode() - .withExe(EnforcementMode.AUDIT) - .withMsi(EnforcementMode.ENFORCE) - .withScript(EnforcementMode.NONE) - .withExecutable(EnforcementMode.AUDIT)) - .withVmRecommendations( - Arrays - .asList( - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.FAILED) - .withRecommendationAction(RecommendationAction.REMOVE) - .withResourceId("hlabrq") - .withEnforcementSupport(EnforcementSupport.UNKNOWN), - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.NO_STATUS) - .withRecommendationAction(RecommendationAction.RECOMMENDED) - .withResourceId("trgaehvv") - .withEnforcementSupport(EnforcementSupport.NOT_SUPPORTED), - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.NO_STATUS) - .withRecommendationAction(RecommendationAction.REMOVE) - .withResourceId("oqbeitpkxzt") - .withEnforcementSupport(EnforcementSupport.SUPPORTED), - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.IN_PROGRESS) - .withRecommendationAction(RecommendationAction.REMOVE) - .withResourceId("idgfc") - .withEnforcementSupport(EnforcementSupport.NOT_SUPPORTED))) - .withPathRecommendations( - Arrays - .asList( - new PathRecommendation() - .withPath("aqxzhemjyho") - .withAction(RecommendationAction.REMOVE) - .withType(RecommendationType.IO_T_EDGE_LOGGING_OPTIONS) - .withCommon(true) - .withUserSids(Arrays.asList()) - .withUsernames(Arrays.asList()) - .withFileType(FileType.SCRIPT) - .withConfigurationStatus(ConfigurationStatus.CONFIGURED))); - model = BinaryData.fromObject(model).toObject(AdaptiveApplicationControlGroupInner.class); - Assertions.assertEquals(EnforcementMode.ENFORCE, model.enforcementMode()); - Assertions.assertEquals(EnforcementMode.AUDIT, model.protectionMode().exe()); - Assertions.assertEquals(EnforcementMode.ENFORCE, model.protectionMode().msi()); - Assertions.assertEquals(EnforcementMode.NONE, model.protectionMode().script()); - Assertions.assertEquals(EnforcementMode.AUDIT, model.protectionMode().executable()); - Assertions.assertEquals(ConfigurationStatus.FAILED, model.vmRecommendations().get(0).configurationStatus()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.vmRecommendations().get(0).recommendationAction()); - Assertions.assertEquals("hlabrq", model.vmRecommendations().get(0).resourceId()); - Assertions.assertEquals(EnforcementSupport.UNKNOWN, model.vmRecommendations().get(0).enforcementSupport()); - Assertions.assertEquals("aqxzhemjyho", model.pathRecommendations().get(0).path()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.pathRecommendations().get(0).action()); - Assertions - .assertEquals(RecommendationType.IO_T_EDGE_LOGGING_OPTIONS, model.pathRecommendations().get(0).type()); - Assertions.assertEquals(true, model.pathRecommendations().get(0).common()); - Assertions.assertEquals(FileType.SCRIPT, model.pathRecommendations().get(0).fileType()); - Assertions - .assertEquals(ConfigurationStatus.CONFIGURED, model.pathRecommendations().get(0).configurationStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupsInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupsInnerTests.java deleted file mode 100644 index 3dc11f75363d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlGroupsInnerTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupInner; -import com.azure.resourcemanager.security.fluent.models.AdaptiveApplicationControlGroupsInner; -import com.azure.resourcemanager.security.models.EnforcementMode; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveApplicationControlGroupsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveApplicationControlGroupsInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"enforcementMode\":\"Audit\",\"configurationStatus\":\"InProgress\",\"recommendationStatus\":\"Recommended\",\"issues\":[],\"sourceSystem\":\"None\",\"vmRecommendations\":[],\"pathRecommendations\":[]},\"location\":\"cojocqwogfnzjvus\",\"id\":\"zldmozuxy\",\"name\":\"fsbtkad\",\"type\":\"ysownbtgkbug\"},{\"properties\":{\"enforcementMode\":\"Enforce\",\"configurationStatus\":\"Failed\",\"recommendationStatus\":\"NotRecommended\",\"issues\":[],\"sourceSystem\":\"None\",\"vmRecommendations\":[],\"pathRecommendations\":[]},\"location\":\"eypefojyqd\",\"id\":\"cuplcplcwkhih\",\"name\":\"hlhzdsqtzbsrgno\",\"type\":\"cjhfgmvecactxmw\"},{\"properties\":{\"enforcementMode\":\"None\",\"configurationStatus\":\"InProgress\",\"recommendationStatus\":\"NotAvailable\",\"issues\":[],\"sourceSystem\":\"Azure_AppLocker\",\"vmRecommendations\":[],\"pathRecommendations\":[]},\"location\":\"qvgqouw\",\"id\":\"fzmpjwyivq\",\"name\":\"kfxcvhrfs\",\"type\":\"huagrttikteusqc\"},{\"properties\":{\"enforcementMode\":\"Audit\",\"configurationStatus\":\"Failed\",\"recommendationStatus\":\"NotAvailable\",\"issues\":[],\"sourceSystem\":\"NonAzure_AuditD\",\"vmRecommendations\":[],\"pathRecommendations\":[]},\"location\":\"mmfblcqcuubgqib\",\"id\":\"talmett\",\"name\":\"wgdsl\",\"type\":\"xih\"}]}") - .toObject(AdaptiveApplicationControlGroupsInner.class); - Assertions.assertEquals(EnforcementMode.AUDIT, model.value().get(0).enforcementMode()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveApplicationControlGroupsInner model = - new AdaptiveApplicationControlGroupsInner() - .withValue( - Arrays - .asList( - new AdaptiveApplicationControlGroupInner() - .withEnforcementMode(EnforcementMode.AUDIT) - .withVmRecommendations(Arrays.asList()) - .withPathRecommendations(Arrays.asList()), - new AdaptiveApplicationControlGroupInner() - .withEnforcementMode(EnforcementMode.ENFORCE) - .withVmRecommendations(Arrays.asList()) - .withPathRecommendations(Arrays.asList()), - new AdaptiveApplicationControlGroupInner() - .withEnforcementMode(EnforcementMode.NONE) - .withVmRecommendations(Arrays.asList()) - .withPathRecommendations(Arrays.asList()), - new AdaptiveApplicationControlGroupInner() - .withEnforcementMode(EnforcementMode.AUDIT) - .withVmRecommendations(Arrays.asList()) - .withPathRecommendations(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(AdaptiveApplicationControlGroupsInner.class); - Assertions.assertEquals(EnforcementMode.AUDIT, model.value().get(0).enforcementMode()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlIssueSummaryTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlIssueSummaryTests.java deleted file mode 100644 index 697071e2a2b5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlIssueSummaryTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlIssue; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlIssueSummary; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveApplicationControlIssueSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveApplicationControlIssueSummary model = - BinaryData - .fromString("{\"issue\":\"ViolationsAudited\",\"numberOfVms\":60.195232}") - .toObject(AdaptiveApplicationControlIssueSummary.class); - Assertions.assertEquals(AdaptiveApplicationControlIssue.VIOLATIONS_AUDITED, model.issue()); - Assertions.assertEquals(60.195232F, model.numberOfVms()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveApplicationControlIssueSummary model = - new AdaptiveApplicationControlIssueSummary() - .withIssue(AdaptiveApplicationControlIssue.VIOLATIONS_AUDITED) - .withNumberOfVms(60.195232F); - model = BinaryData.fromObject(model).toObject(AdaptiveApplicationControlIssueSummary.class); - Assertions.assertEquals(AdaptiveApplicationControlIssue.VIOLATIONS_AUDITED, model.issue()); - Assertions.assertEquals(60.195232F, model.numberOfVms()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 6c7d348dab9a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdaptiveApplicationControlsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .adaptiveApplicationControls() - .deleteByResourceGroupWithResponse("cfogxhcxnwjt", "fdz", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetWithResponseMockTests.java deleted file mode 100644 index f5db92120fbc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroup; -import com.azure.resourcemanager.security.models.EnforcementMode; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdaptiveApplicationControlsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"enforcementMode\":\"Enforce\",\"protectionMode\":{\"exe\":\"Enforce\",\"msi\":\"Enforce\",\"script\":\"None\",\"executable\":\"Enforce\"},\"configurationStatus\":\"NoStatus\",\"recommendationStatus\":\"Recommended\",\"issues\":[],\"sourceSystem\":\"NonAzure_AuditD\",\"vmRecommendations\":[],\"pathRecommendations\":[]},\"location\":\"mef\",\"id\":\"vhkmoogjrhskbwgm\",\"name\":\"g\",\"type\":\"u\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdaptiveApplicationControlGroup response = - manager - .adaptiveApplicationControls() - .getWithResponse("sgwqpsqaz", "hqodv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(EnforcementMode.ENFORCE, response.enforcementMode()); - Assertions.assertEquals(EnforcementMode.ENFORCE, response.protectionMode().exe()); - Assertions.assertEquals(EnforcementMode.ENFORCE, response.protectionMode().msi()); - Assertions.assertEquals(EnforcementMode.NONE, response.protectionMode().script()); - Assertions.assertEquals(EnforcementMode.ENFORCE, response.protectionMode().executable()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListWithResponseMockTests.java deleted file mode 100644 index 69308fc853bb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsListWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroups; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdaptiveApplicationControlsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"pfuofixcnpcfykkp\",\"id\":\"ycpawm\",\"name\":\"jp\",\"type\":\"dpwrp\"},{\"location\":\"pcf\",\"id\":\"fwzlgzawkgyepeya\",\"name\":\"nnidmdiawpzxk\",\"type\":\"rntmkctdhu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdaptiveApplicationControlGroups response = - manager - .adaptiveApplicationControls() - .listWithResponse(false, true, com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutWithResponseMockTests.java deleted file mode 100644 index 4a6d08c82594..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveApplicationControlsPutWithResponseMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdaptiveApplicationControlGroup; -import com.azure.resourcemanager.security.models.EnforcementMode; -import com.azure.resourcemanager.security.models.ProtectionMode; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdaptiveApplicationControlsPutWithResponseMockTests { - @Test - public void testPutWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"enforcementMode\":\"Enforce\",\"protectionMode\":{\"exe\":\"None\",\"msi\":\"Audit\",\"script\":\"None\",\"executable\":\"Enforce\"},\"configurationStatus\":\"InProgress\",\"recommendationStatus\":\"NoStatus\",\"issues\":[],\"sourceSystem\":\"Azure_AuditD\",\"vmRecommendations\":[],\"pathRecommendations\":[]},\"location\":\"zusitoqcahfs\",\"id\":\"bjmlreesrfwssz\",\"name\":\"lc\",\"type\":\"lisolntfxxc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdaptiveApplicationControlGroup response = - manager - .adaptiveApplicationControls() - .define("uzfwo") - .withExistingLocation("c") - .withEnforcementMode(EnforcementMode.AUDIT) - .withProtectionMode( - new ProtectionMode() - .withExe(EnforcementMode.ENFORCE) - .withMsi(EnforcementMode.ENFORCE) - .withScript(EnforcementMode.ENFORCE) - .withExecutable(EnforcementMode.ENFORCE)) - .withVmRecommendations(Arrays.asList()) - .withPathRecommendations(Arrays.asList()) - .create(); - - Assertions.assertEquals(EnforcementMode.ENFORCE, response.enforcementMode()); - Assertions.assertEquals(EnforcementMode.NONE, response.protectionMode().exe()); - Assertions.assertEquals(EnforcementMode.AUDIT, response.protectionMode().msi()); - Assertions.assertEquals(EnforcementMode.NONE, response.protectionMode().script()); - Assertions.assertEquals(EnforcementMode.ENFORCE, response.protectionMode().executable()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningEnforceRequestTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningEnforceRequestTests.java deleted file mode 100644 index 42e85757a0fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningEnforceRequestTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningEnforceRequest; -import com.azure.resourcemanager.security.models.Direction; -import com.azure.resourcemanager.security.models.Rule; -import com.azure.resourcemanager.security.models.TransportProtocol; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveNetworkHardeningEnforceRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveNetworkHardeningEnforceRequest model = - BinaryData - .fromString( - "{\"rules\":[{\"name\":\"vyc\",\"direction\":\"Inbound\",\"destinationPort\":1491139189,\"protocols\":[\"UDP\"],\"ipAddresses\":[\"nfnw\",\"btmvpdvjdhttza\",\"fedxihchrphkm\",\"rjdqnsdfzp\"]}],\"networkSecurityGroups\":[\"tg\",\"ylkdghrje\",\"utlwxezwzhok\"]}") - .toObject(AdaptiveNetworkHardeningEnforceRequest.class); - Assertions.assertEquals("vyc", model.rules().get(0).name()); - Assertions.assertEquals(Direction.INBOUND, model.rules().get(0).direction()); - Assertions.assertEquals(1491139189, model.rules().get(0).destinationPort()); - Assertions.assertEquals(TransportProtocol.UDP, model.rules().get(0).protocols().get(0)); - Assertions.assertEquals("nfnw", model.rules().get(0).ipAddresses().get(0)); - Assertions.assertEquals("tg", model.networkSecurityGroups().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveNetworkHardeningEnforceRequest model = - new AdaptiveNetworkHardeningEnforceRequest() - .withRules( - Arrays - .asList( - new Rule() - .withName("vyc") - .withDirection(Direction.INBOUND) - .withDestinationPort(1491139189) - .withProtocols(Arrays.asList(TransportProtocol.UDP)) - .withIpAddresses( - Arrays.asList("nfnw", "btmvpdvjdhttza", "fedxihchrphkm", "rjdqnsdfzp")))) - .withNetworkSecurityGroups(Arrays.asList("tg", "ylkdghrje", "utlwxezwzhok")); - model = BinaryData.fromObject(model).toObject(AdaptiveNetworkHardeningEnforceRequest.class); - Assertions.assertEquals("vyc", model.rules().get(0).name()); - Assertions.assertEquals(Direction.INBOUND, model.rules().get(0).direction()); - Assertions.assertEquals(1491139189, model.rules().get(0).destinationPort()); - Assertions.assertEquals(TransportProtocol.UDP, model.rules().get(0).protocols().get(0)); - Assertions.assertEquals("nfnw", model.rules().get(0).ipAddresses().get(0)); - Assertions.assertEquals("tg", model.networkSecurityGroups().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningInnerTests.java deleted file mode 100644 index da41e2e59d87..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningInnerTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningInner; -import com.azure.resourcemanager.security.models.Direction; -import com.azure.resourcemanager.security.models.EffectiveNetworkSecurityGroups; -import com.azure.resourcemanager.security.models.Rule; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveNetworkHardeningInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveNetworkHardeningInner model = - BinaryData - .fromString( - "{\"properties\":{\"rules\":[{\"name\":\"rfe\",\"direction\":\"Outbound\",\"destinationPort\":301630864,\"protocols\":[],\"ipAddresses\":[]},{\"name\":\"hcans\",\"direction\":\"Inbound\",\"destinationPort\":1800110701,\"protocols\":[],\"ipAddresses\":[]},{\"name\":\"igdivbkbxg\",\"direction\":\"Inbound\",\"destinationPort\":2081513021,\"protocols\":[],\"ipAddresses\":[]},{\"name\":\"sqvdaeyygux\",\"direction\":\"Outbound\",\"destinationPort\":1119953964,\"protocols\":[],\"ipAddresses\":[]}],\"rulesCalculationTime\":\"2021-01-11T12:34:59Z\",\"effectiveNetworkSecurityGroups\":[{\"networkInterface\":\"gims\",\"networkSecurityGroups\":[]},{\"networkInterface\":\"asi\",\"networkSecurityGroups\":[]}]},\"id\":\"dyvvjskgfmocwahp\",\"name\":\"gat\",\"type\":\"eaahhvjhhn\"}") - .toObject(AdaptiveNetworkHardeningInner.class); - Assertions.assertEquals("rfe", model.rules().get(0).name()); - Assertions.assertEquals(Direction.OUTBOUND, model.rules().get(0).direction()); - Assertions.assertEquals(301630864, model.rules().get(0).destinationPort()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T12:34:59Z"), model.rulesCalculationTime()); - Assertions.assertEquals("gims", model.effectiveNetworkSecurityGroups().get(0).networkInterface()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveNetworkHardeningInner model = - new AdaptiveNetworkHardeningInner() - .withRules( - Arrays - .asList( - new Rule() - .withName("rfe") - .withDirection(Direction.OUTBOUND) - .withDestinationPort(301630864) - .withProtocols(Arrays.asList()) - .withIpAddresses(Arrays.asList()), - new Rule() - .withName("hcans") - .withDirection(Direction.INBOUND) - .withDestinationPort(1800110701) - .withProtocols(Arrays.asList()) - .withIpAddresses(Arrays.asList()), - new Rule() - .withName("igdivbkbxg") - .withDirection(Direction.INBOUND) - .withDestinationPort(2081513021) - .withProtocols(Arrays.asList()) - .withIpAddresses(Arrays.asList()), - new Rule() - .withName("sqvdaeyygux") - .withDirection(Direction.OUTBOUND) - .withDestinationPort(1119953964) - .withProtocols(Arrays.asList()) - .withIpAddresses(Arrays.asList()))) - .withRulesCalculationTime(OffsetDateTime.parse("2021-01-11T12:34:59Z")) - .withEffectiveNetworkSecurityGroups( - Arrays - .asList( - new EffectiveNetworkSecurityGroups() - .withNetworkInterface("gims") - .withNetworkSecurityGroups(Arrays.asList()), - new EffectiveNetworkSecurityGroups() - .withNetworkInterface("asi") - .withNetworkSecurityGroups(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(AdaptiveNetworkHardeningInner.class); - Assertions.assertEquals("rfe", model.rules().get(0).name()); - Assertions.assertEquals(Direction.OUTBOUND, model.rules().get(0).direction()); - Assertions.assertEquals(301630864, model.rules().get(0).destinationPort()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T12:34:59Z"), model.rulesCalculationTime()); - Assertions.assertEquals("gims", model.effectiveNetworkSecurityGroups().get(0).networkInterface()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningPropertiesTests.java deleted file mode 100644 index 171862be894e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningPropertiesTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningProperties; -import com.azure.resourcemanager.security.models.Direction; -import com.azure.resourcemanager.security.models.EffectiveNetworkSecurityGroups; -import com.azure.resourcemanager.security.models.Rule; -import com.azure.resourcemanager.security.models.TransportProtocol; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveNetworkHardeningPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveNetworkHardeningProperties model = - BinaryData - .fromString( - "{\"rules\":[{\"name\":\"bbjjidjksyxk\",\"direction\":\"Inbound\",\"destinationPort\":1732474011,\"protocols\":[\"TCP\",\"UDP\"],\"ipAddresses\":[\"dnlj\",\"age\"]},{\"name\":\"ulxunsmjbnkpp\",\"direction\":\"Outbound\",\"destinationPort\":2047909976,\"protocols\":[\"TCP\",\"TCP\",\"TCP\",\"TCP\"],\"ipAddresses\":[\"gwklnsr\"]}],\"rulesCalculationTime\":\"2021-08-04T15:57:37Z\",\"effectiveNetworkSecurityGroups\":[{\"networkInterface\":\"xcktpiymerteeamm\",\"networkSecurityGroups\":[\"ekkkzd\",\"rtkgdojbmxvavref\",\"eesvecu\",\"jpxtxsuwprtuj\"]},{\"networkInterface\":\"awddjibab\",\"networkSecurityGroups\":[\"titvtzeexavox\",\"fglecdmdqbwp\",\"pqtgsfjac\",\"slhhxudbxv\"]},{\"networkInterface\":\"htnsi\",\"networkSecurityGroups\":[\"hzmme\",\"ckdlpag\",\"rcxfailcfxwmdb\"]}]}") - .toObject(AdaptiveNetworkHardeningProperties.class); - Assertions.assertEquals("bbjjidjksyxk", model.rules().get(0).name()); - Assertions.assertEquals(Direction.INBOUND, model.rules().get(0).direction()); - Assertions.assertEquals(1732474011, model.rules().get(0).destinationPort()); - Assertions.assertEquals(TransportProtocol.TCP, model.rules().get(0).protocols().get(0)); - Assertions.assertEquals("dnlj", model.rules().get(0).ipAddresses().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-04T15:57:37Z"), model.rulesCalculationTime()); - Assertions.assertEquals("xcktpiymerteeamm", model.effectiveNetworkSecurityGroups().get(0).networkInterface()); - Assertions.assertEquals("ekkkzd", model.effectiveNetworkSecurityGroups().get(0).networkSecurityGroups().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveNetworkHardeningProperties model = - new AdaptiveNetworkHardeningProperties() - .withRules( - Arrays - .asList( - new Rule() - .withName("bbjjidjksyxk") - .withDirection(Direction.INBOUND) - .withDestinationPort(1732474011) - .withProtocols(Arrays.asList(TransportProtocol.TCP, TransportProtocol.UDP)) - .withIpAddresses(Arrays.asList("dnlj", "age")), - new Rule() - .withName("ulxunsmjbnkpp") - .withDirection(Direction.OUTBOUND) - .withDestinationPort(2047909976) - .withProtocols( - Arrays - .asList( - TransportProtocol.TCP, - TransportProtocol.TCP, - TransportProtocol.TCP, - TransportProtocol.TCP)) - .withIpAddresses(Arrays.asList("gwklnsr")))) - .withRulesCalculationTime(OffsetDateTime.parse("2021-08-04T15:57:37Z")) - .withEffectiveNetworkSecurityGroups( - Arrays - .asList( - new EffectiveNetworkSecurityGroups() - .withNetworkInterface("xcktpiymerteeamm") - .withNetworkSecurityGroups( - Arrays.asList("ekkkzd", "rtkgdojbmxvavref", "eesvecu", "jpxtxsuwprtuj")), - new EffectiveNetworkSecurityGroups() - .withNetworkInterface("awddjibab") - .withNetworkSecurityGroups( - Arrays.asList("titvtzeexavox", "fglecdmdqbwp", "pqtgsfjac", "slhhxudbxv")), - new EffectiveNetworkSecurityGroups() - .withNetworkInterface("htnsi") - .withNetworkSecurityGroups(Arrays.asList("hzmme", "ckdlpag", "rcxfailcfxwmdb")))); - model = BinaryData.fromObject(model).toObject(AdaptiveNetworkHardeningProperties.class); - Assertions.assertEquals("bbjjidjksyxk", model.rules().get(0).name()); - Assertions.assertEquals(Direction.INBOUND, model.rules().get(0).direction()); - Assertions.assertEquals(1732474011, model.rules().get(0).destinationPort()); - Assertions.assertEquals(TransportProtocol.TCP, model.rules().get(0).protocols().get(0)); - Assertions.assertEquals("dnlj", model.rules().get(0).ipAddresses().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-04T15:57:37Z"), model.rulesCalculationTime()); - Assertions.assertEquals("xcktpiymerteeamm", model.effectiveNetworkSecurityGroups().get(0).networkInterface()); - Assertions.assertEquals("ekkkzd", model.effectiveNetworkSecurityGroups().get(0).networkSecurityGroups().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceMockTests.java deleted file mode 100644 index ca9b785dd927..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsEnforceMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningEnforceRequest; -import com.azure.resourcemanager.security.models.Direction; -import com.azure.resourcemanager.security.models.Rule; -import com.azure.resourcemanager.security.models.TransportProtocol; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdaptiveNetworkHardeningsEnforceMockTests { - @Test - public void testEnforce() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .adaptiveNetworkHardenings() - .enforce( - "qs", - "eiihfymko", - "ihyeseu", - "gcigzh", - "gsmgb", - new AdaptiveNetworkHardeningEnforceRequest() - .withRules( - Arrays - .asList( - new Rule() - .withName("dwrqbeb") - .withDirection(Direction.OUTBOUND) - .withDestinationPort(2023900183) - .withProtocols(Arrays.asList(TransportProtocol.TCP)) - .withIpAddresses(Arrays.asList("vkbiw", "nhtfgfi", "udy")))) - .withNetworkSecurityGroups(Arrays.asList("zpacz", "uhbcak")), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetWithResponseMockTests.java deleted file mode 100644 index 8e5c9412fac9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardening; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdaptiveNetworkHardeningsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"rules\":[],\"rulesCalculationTime\":\"2021-08-13T04:35:03Z\",\"effectiveNetworkSecurityGroups\":[]},\"id\":\"ybkekym\",\"name\":\"fztsi\",\"type\":\"sc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdaptiveNetworkHardening response = - manager - .adaptiveNetworkHardenings() - .getWithResponse("ktwtk", "ih", "pfliwo", "nguuzhwvla", "p", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(OffsetDateTime.parse("2021-08-13T04:35:03Z"), response.rulesCalculationTime()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceMockTests.java deleted file mode 100644 index 3e866aa96567..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListByExtendedResourceMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardening; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdaptiveNetworkHardeningsListByExtendedResourceMockTests { - @Test - public void testListByExtendedResource() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"rules\":[],\"rulesCalculationTime\":\"2021-10-09T16:12:07Z\",\"effectiveNetworkSecurityGroups\":[]},\"id\":\"qmqipaydhfnzoc\",\"name\":\"mtfshksnyzmspa\",\"type\":\"wbwmbnlslcefiq\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .adaptiveNetworkHardenings() - .listByExtendedResource( - "qmipfj", "foygizmshxxba", "zabulnvgsk", "toxjdzj", com.azure.core.util.Context.NONE); - - Assertions - .assertEquals( - OffsetDateTime.parse("2021-10-09T16:12:07Z"), response.iterator().next().rulesCalculationTime()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListTests.java deleted file mode 100644 index dbf2ff91a164..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdaptiveNetworkHardeningsListTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdaptiveNetworkHardeningInner; -import com.azure.resourcemanager.security.models.AdaptiveNetworkHardeningsList; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdaptiveNetworkHardeningsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdaptiveNetworkHardeningsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"rules\":[],\"rulesCalculationTime\":\"2021-02-04T03:03:52Z\",\"effectiveNetworkSecurityGroups\":[]},\"id\":\"pgclrciv\",\"name\":\"soxfrken\",\"type\":\"pmyyefrpmpdnqq\"},{\"properties\":{\"rules\":[],\"rulesCalculationTime\":\"2021-07-14T06:34:32Z\",\"effectiveNetworkSecurityGroups\":[]},\"id\":\"qvmmbn\",\"name\":\"qfr\",\"type\":\"qlkzme\"}],\"nextLink\":\"itgvkx\"}") - .toObject(AdaptiveNetworkHardeningsList.class); - Assertions - .assertEquals(OffsetDateTime.parse("2021-02-04T03:03:52Z"), model.value().get(0).rulesCalculationTime()); - Assertions.assertEquals("itgvkx", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdaptiveNetworkHardeningsList model = - new AdaptiveNetworkHardeningsList() - .withValue( - Arrays - .asList( - new AdaptiveNetworkHardeningInner() - .withRules(Arrays.asList()) - .withRulesCalculationTime(OffsetDateTime.parse("2021-02-04T03:03:52Z")) - .withEffectiveNetworkSecurityGroups(Arrays.asList()), - new AdaptiveNetworkHardeningInner() - .withRules(Arrays.asList()) - .withRulesCalculationTime(OffsetDateTime.parse("2021-07-14T06:34:32Z")) - .withEffectiveNetworkSecurityGroups(Arrays.asList()))) - .withNextLink("itgvkx"); - model = BinaryData.fromObject(model).toObject(AdaptiveNetworkHardeningsList.class); - Assertions - .assertEquals(OffsetDateTime.parse("2021-02-04T03:03:52Z"), model.value().get(0).rulesCalculationTime()); - Assertions.assertEquals("itgvkx", model.nextLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdditionalDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdditionalDataTests.java deleted file mode 100644 index eba091dd52f7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdditionalDataTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AdditionalData; - -public final class AdditionalDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdditionalData model = - BinaryData.fromString("{\"assessedResourceType\":\"AdditionalData\"}").toObject(AdditionalData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdditionalData model = new AdditionalData(); - model = BinaryData.fromObject(model).toObject(AdditionalData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdditionalWorkspacesPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdditionalWorkspacesPropertiesTests.java deleted file mode 100644 index d6a5a12cda1c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdditionalWorkspacesPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AdditionalWorkspaceDataType; -import com.azure.resourcemanager.security.models.AdditionalWorkspaceType; -import com.azure.resourcemanager.security.models.AdditionalWorkspacesProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AdditionalWorkspacesPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdditionalWorkspacesProperties model = - BinaryData - .fromString("{\"workspace\":\"yq\",\"type\":\"Sentinel\",\"dataTypes\":[\"Alerts\",\"RawEvents\"]}") - .toObject(AdditionalWorkspacesProperties.class); - Assertions.assertEquals("yq", model.workspace()); - Assertions.assertEquals(AdditionalWorkspaceType.SENTINEL, model.type()); - Assertions.assertEquals(AdditionalWorkspaceDataType.ALERTS, model.dataTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdditionalWorkspacesProperties model = - new AdditionalWorkspacesProperties() - .withWorkspace("yq") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes( - Arrays.asList(AdditionalWorkspaceDataType.ALERTS, AdditionalWorkspaceDataType.RAW_EVENTS)); - model = BinaryData.fromObject(model).toObject(AdditionalWorkspacesProperties.class); - Assertions.assertEquals("yq", model.workspace()); - Assertions.assertEquals(AdditionalWorkspaceType.SENTINEL, model.type()); - Assertions.assertEquals(AdditionalWorkspaceDataType.ALERTS, model.dataTypes().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionPropertiesTests.java deleted file mode 100644 index 1f1bceab6521..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionProperties; -import org.junit.jupiter.api.Assertions; - -public final class AdvancedThreatProtectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdvancedThreatProtectionProperties model = - BinaryData.fromString("{\"isEnabled\":false}").toObject(AdvancedThreatProtectionProperties.class); - Assertions.assertEquals(false, model.isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdvancedThreatProtectionProperties model = new AdvancedThreatProtectionProperties().withIsEnabled(false); - model = BinaryData.fromObject(model).toObject(AdvancedThreatProtectionProperties.class); - Assertions.assertEquals(false, model.isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionSettingInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionSettingInnerTests.java deleted file mode 100644 index 91035c765ee1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionSettingInnerTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AdvancedThreatProtectionSettingInner; -import org.junit.jupiter.api.Assertions; - -public final class AdvancedThreatProtectionSettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AdvancedThreatProtectionSettingInner model = - BinaryData - .fromString( - "{\"properties\":{\"isEnabled\":true},\"id\":\"ijcmmx\",\"name\":\"cufufsrpymz\",\"type\":\"dnsezcxtbzs\"}") - .toObject(AdvancedThreatProtectionSettingInner.class); - Assertions.assertEquals(true, model.isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AdvancedThreatProtectionSettingInner model = new AdvancedThreatProtectionSettingInner().withIsEnabled(true); - model = BinaryData.fromObject(model).toObject(AdvancedThreatProtectionSettingInner.class); - Assertions.assertEquals(true, model.isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionsCreateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionsCreateWithResponseMockTests.java deleted file mode 100644 index a9ecc1d834ab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionsCreateWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdvancedThreatProtectionSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdvancedThreatProtectionsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isEnabled\":true},\"id\":\"lwljss\",\"name\":\"ctsnldkpwol\",\"type\":\"isubxbteog\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdvancedThreatProtectionSetting response = - manager.advancedThreatProtections().define().withExistingResourceId("ezay").withIsEnabled(true).create(); - - Assertions.assertEquals(true, response.isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionsGetWithResponseMockTests.java deleted file mode 100644 index 094f2c1cb2ab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AdvancedThreatProtectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AdvancedThreatProtectionSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AdvancedThreatProtectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"isEnabled\":true},\"id\":\"minxojjluxxdh\",\"name\":\"lzzdz\",\"type\":\"qjm\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AdvancedThreatProtectionSetting response = - manager.advancedThreatProtections().getWithResponse("jlf", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(true, response.isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertEntityTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertEntityTests.java deleted file mode 100644 index 8db52d56935a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertEntityTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AlertEntity; -import java.util.HashMap; -import java.util.Map; - -public final class AlertEntityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertEntity model = - BinaryData - .fromString( - "{\"type\":\"hqjjys\",\"\":{\"mpqvwwsk\":\"datalpshhkvpedwqslsr\",\"uvqejosovyrrle\":\"datandcbrwi\"}}") - .toObject(AlertEntity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertEntity model = new AlertEntity().withAdditionalProperties(mapOf("type", "hqjjys")); - model = BinaryData.fromObject(model).toObject(AlertEntity.class); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertPropertiesSupportingEvidenceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertPropertiesSupportingEvidenceTests.java deleted file mode 100644 index dce644a75666..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertPropertiesSupportingEvidenceTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AlertPropertiesSupportingEvidence; -import java.util.HashMap; -import java.util.Map; - -public final class AlertPropertiesSupportingEvidenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertPropertiesSupportingEvidence model = - BinaryData - .fromString( - "{\"type\":\"sinuqtljqobbpih\",\"\":{\"bmpxdlvykfrexc\":\"dataecybmrqbrj\",\"qwjksghudgz\":\"datas\",\"ggsvoujkxibdaf\":\"dataxog\",\"xfbvfb\":\"datarkmdyom\"}}") - .toObject(AlertPropertiesSupportingEvidence.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertPropertiesSupportingEvidence model = - new AlertPropertiesSupportingEvidence().withAdditionalProperties(mapOf("type", "sinuqtljqobbpih")); - model = BinaryData.fromObject(model).toObject(AlertPropertiesSupportingEvidence.class); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorBundlesRequestPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorBundlesRequestPropertiesTests.java deleted file mode 100644 index 3188369dec35..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorBundlesRequestPropertiesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AlertSimulatorBundlesRequestProperties; -import com.azure.resourcemanager.security.models.BundleType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AlertSimulatorBundlesRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertSimulatorBundlesRequestProperties model = - BinaryData - .fromString( - "{\"kind\":\"Bundles\",\"bundles\":[\"DNS\"],\"\":{\"dtfohfaog\":\"datakywymxgaabj\",\"ykcrraue\":\"datavkiwrsiwdyjqu\",\"ddacbcbgydlqidy\":\"datakcsueho\"}}") - .toObject(AlertSimulatorBundlesRequestProperties.class); - Assertions.assertEquals(BundleType.DNS, model.bundles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertSimulatorBundlesRequestProperties model = - new AlertSimulatorBundlesRequestProperties().withBundles(Arrays.asList(BundleType.DNS)); - model = BinaryData.fromObject(model).toObject(AlertSimulatorBundlesRequestProperties.class); - Assertions.assertEquals(BundleType.DNS, model.bundles().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorRequestBodyTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorRequestBodyTests.java deleted file mode 100644 index 346f3c6d98e1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorRequestBodyTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AlertSimulatorRequestBody; -import com.azure.resourcemanager.security.models.AlertSimulatorRequestProperties; -import java.util.HashMap; -import java.util.Map; - -public final class AlertSimulatorRequestBodyTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertSimulatorRequestBody model = - BinaryData - .fromString( - "{\"properties\":{\"kind\":\"AlertSimulatorRequestProperties\",\"\":{\"gddeimaw\":\"datarhpw\"}}}") - .toObject(AlertSimulatorRequestBody.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertSimulatorRequestBody model = - new AlertSimulatorRequestBody() - .withProperties( - new AlertSimulatorRequestProperties() - .withAdditionalProperties(mapOf("kind", "AlertSimulatorRequestProperties"))); - model = BinaryData.fromObject(model).toObject(AlertSimulatorRequestBody.class); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorRequestPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorRequestPropertiesTests.java deleted file mode 100644 index e6ff4dc8f323..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSimulatorRequestPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AlertSimulatorRequestProperties; -import java.util.HashMap; -import java.util.Map; - -public final class AlertSimulatorRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertSimulatorRequestProperties model = - BinaryData - .fromString("{\"kind\":\"AlertSimulatorRequestProperties\",\"\":{\"aztb\":\"datagkkumuikjcj\"}}") - .toObject(AlertSimulatorRequestProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertSimulatorRequestProperties model = - new AlertSimulatorRequestProperties() - .withAdditionalProperties(mapOf("kind", "AlertSimulatorRequestProperties")); - model = BinaryData.fromObject(model).toObject(AlertSimulatorRequestProperties.class); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSyncSettingPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSyncSettingPropertiesTests.java deleted file mode 100644 index 6020bd948993..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSyncSettingPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AlertSyncSettingProperties; -import org.junit.jupiter.api.Assertions; - -public final class AlertSyncSettingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertSyncSettingProperties model = - BinaryData.fromString("{\"enabled\":true}").toObject(AlertSyncSettingProperties.class); - Assertions.assertEquals(true, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertSyncSettingProperties model = new AlertSyncSettingProperties().withEnabled(true); - model = BinaryData.fromObject(model).toObject(AlertSyncSettingProperties.class); - Assertions.assertEquals(true, model.enabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSyncSettingsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSyncSettingsTests.java deleted file mode 100644 index 29517813259d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertSyncSettingsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AlertSyncSettings; -import org.junit.jupiter.api.Assertions; - -public final class AlertSyncSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertSyncSettings model = - BinaryData - .fromString( - "{\"kind\":\"AlertSyncSettings\",\"properties\":{\"enabled\":false},\"id\":\"leexahvmywh\",\"name\":\"brcary\",\"type\":\"sjjzyvoaqajuveh\"}") - .toObject(AlertSyncSettings.class); - Assertions.assertEquals(false, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertSyncSettings model = new AlertSyncSettings().withEnabled(false); - model = BinaryData.fromObject(model).toObject(AlertSyncSettings.class); - Assertions.assertEquals(false, model.enabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRuleInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRuleInnerTests.java deleted file mode 100644 index 579dcb7c5fe3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRuleInnerTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AlertsSuppressionRuleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertsSuppressionRuleInner model = - BinaryData - .fromString( - "{\"properties\":{\"alertType\":\"vhmxtdrjfu\",\"lastModifiedUtc\":\"2021-09-25T19:58:32Z\",\"expirationDateUtc\":\"2021-07-27T22:13:32Z\",\"reason\":\"bj\",\"state\":\"Expired\",\"comment\":\"zcjznmwcpmgua\",\"suppressionAlertsScope\":{\"allOf\":[]}},\"id\":\"aufactkahzovajjz\",\"name\":\"uxxpshne\",\"type\":\"kulfg\"}") - .toObject(AlertsSuppressionRuleInner.class); - Assertions.assertEquals("vhmxtdrjfu", model.alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-27T22:13:32Z"), model.expirationDateUtc()); - Assertions.assertEquals("bj", model.reason()); - Assertions.assertEquals(RuleState.EXPIRED, model.state()); - Assertions.assertEquals("zcjznmwcpmgua", model.comment()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertsSuppressionRuleInner model = - new AlertsSuppressionRuleInner() - .withAlertType("vhmxtdrjfu") - .withExpirationDateUtc(OffsetDateTime.parse("2021-07-27T22:13:32Z")) - .withReason("bj") - .withState(RuleState.EXPIRED) - .withComment("zcjznmwcpmgua") - .withSuppressionAlertsScope(new SuppressionAlertsScope().withAllOf(Arrays.asList())); - model = BinaryData.fromObject(model).toObject(AlertsSuppressionRuleInner.class); - Assertions.assertEquals("vhmxtdrjfu", model.alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-27T22:13:32Z"), model.expirationDateUtc()); - Assertions.assertEquals("bj", model.reason()); - Assertions.assertEquals(RuleState.EXPIRED, model.state()); - Assertions.assertEquals("zcjznmwcpmgua", model.comment()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulePropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulePropertiesTests.java deleted file mode 100644 index 431476f96438..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulePropertiesTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleProperties; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.ScopeElement; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AlertsSuppressionRulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertsSuppressionRuleProperties model = - BinaryData - .fromString( - "{\"alertType\":\"lqubkwdlen\",\"lastModifiedUtc\":\"2021-02-18T06:07:47Z\",\"expirationDateUtc\":\"2021-03-05T15:56:58Z\",\"reason\":\"ujbazpjuohminyfl\",\"state\":\"Enabled\",\"comment\":\"wmd\",\"suppressionAlertsScope\":{\"allOf\":[{\"field\":\"klvxwmyg\",\"\":{}},{\"field\":\"gpqch\",\"\":{}}]}}") - .toObject(AlertsSuppressionRuleProperties.class); - Assertions.assertEquals("lqubkwdlen", model.alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-05T15:56:58Z"), model.expirationDateUtc()); - Assertions.assertEquals("ujbazpjuohminyfl", model.reason()); - Assertions.assertEquals(RuleState.ENABLED, model.state()); - Assertions.assertEquals("wmd", model.comment()); - Assertions.assertEquals("klvxwmyg", model.suppressionAlertsScope().allOf().get(0).field()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertsSuppressionRuleProperties model = - new AlertsSuppressionRuleProperties() - .withAlertType("lqubkwdlen") - .withExpirationDateUtc(OffsetDateTime.parse("2021-03-05T15:56:58Z")) - .withReason("ujbazpjuohminyfl") - .withState(RuleState.ENABLED) - .withComment("wmd") - .withSuppressionAlertsScope( - new SuppressionAlertsScope() - .withAllOf( - Arrays - .asList( - new ScopeElement().withField("klvxwmyg").withAdditionalProperties(mapOf()), - new ScopeElement().withField("gpqch").withAdditionalProperties(mapOf())))); - model = BinaryData.fromObject(model).toObject(AlertsSuppressionRuleProperties.class); - Assertions.assertEquals("lqubkwdlen", model.alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-05T15:56:58Z"), model.expirationDateUtc()); - Assertions.assertEquals("ujbazpjuohminyfl", model.reason()); - Assertions.assertEquals(RuleState.ENABLED, model.state()); - Assertions.assertEquals("wmd", model.comment()); - Assertions.assertEquals("klvxwmyg", model.suppressionAlertsScope().allOf().get(0).field()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteWithResponseMockTests.java deleted file mode 100644 index b3a229222dad..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsSuppressionRulesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.alertsSuppressionRules().deleteWithResponse("bkl", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetWithResponseMockTests.java deleted file mode 100644 index 538b05331343..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesGetWithResponseMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AlertsSuppressionRule; -import com.azure.resourcemanager.security.models.RuleState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsSuppressionRulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"alertType\":\"jqqwmtqsmoxsazu\",\"lastModifiedUtc\":\"2021-10-28T14:39:50Z\",\"expirationDateUtc\":\"2021-11-13T00:25:40Z\",\"reason\":\"ecywn\",\"state\":\"Disabled\",\"comment\":\"zzaczsinqbdn\",\"suppressionAlertsScope\":{\"allOf\":[]}},\"id\":\"bbozsyvr\",\"name\":\"kjmyitrchwudlx\",\"type\":\"eihtpmnoejh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AlertsSuppressionRule response = - manager.alertsSuppressionRules().getWithResponse("bpnjodf", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("jqqwmtqsmoxsazu", response.alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-13T00:25:40Z"), response.expirationDateUtc()); - Assertions.assertEquals("ecywn", response.reason()); - Assertions.assertEquals(RuleState.DISABLED, response.state()); - Assertions.assertEquals("zzaczsinqbdn", response.comment()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListMockTests.java deleted file mode 100644 index d366dd8edd49..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AlertsSuppressionRule; -import com.azure.resourcemanager.security.models.RuleState; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsSuppressionRulesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"alertType\":\"ntujmoilunwemhd\",\"lastModifiedUtc\":\"2021-12-02T08:52:50Z\",\"expirationDateUtc\":\"2021-10-18T05:10:35Z\",\"reason\":\"lkyozdsfzj\",\"state\":\"Enabled\",\"comment\":\"rhrhtsl\",\"suppressionAlertsScope\":{\"allOf\":[]}},\"id\":\"tv\",\"name\":\"j\",\"type\":\"xvgjbfi\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.alertsSuppressionRules().list("dsaidjanormovdxx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ntujmoilunwemhd", response.iterator().next().alertType()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-10-18T05:10:35Z"), response.iterator().next().expirationDateUtc()); - Assertions.assertEquals("lkyozdsfzj", response.iterator().next().reason()); - Assertions.assertEquals(RuleState.ENABLED, response.iterator().next().state()); - Assertions.assertEquals("rhrhtsl", response.iterator().next().comment()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListTests.java deleted file mode 100644 index be6e6b5ea835..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesListTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.AlertsSuppressionRulesList; -import com.azure.resourcemanager.security.models.RuleState; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AlertsSuppressionRulesListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AlertsSuppressionRulesList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"alertType\":\"hvbbxuripltfnh\",\"lastModifiedUtc\":\"2021-05-19T04:32:03Z\",\"expirationDateUtc\":\"2021-08-21T19:13:45Z\",\"reason\":\"gx\",\"state\":\"Expired\",\"comment\":\"ckpyklyhplu\"},\"id\":\"pvruudlg\",\"name\":\"ibthostgktstvd\",\"type\":\"eclze\"},{\"properties\":{\"alertType\":\"bcvhzlhpl\",\"lastModifiedUtc\":\"2021-07-07T17:09:43Z\",\"expirationDateUtc\":\"2021-05-30T19:04:16Z\",\"reason\":\"lwwqfbumlkxtrqj\",\"state\":\"Disabled\",\"comment\":\"lmbtxhwgfwsrt\"},\"id\":\"coezbrhubskh\",\"name\":\"dyg\",\"type\":\"ookk\"},{\"properties\":{\"alertType\":\"qjbvleorfmlu\",\"lastModifiedUtc\":\"2021-07-18T04:19:58Z\",\"expirationDateUtc\":\"2021-10-19T17:51:06Z\",\"reason\":\"fa\",\"state\":\"Disabled\",\"comment\":\"nqqyba\"},\"id\":\"euayjkqabqgzsles\",\"name\":\"cbhernntiewdj\",\"type\":\"vbquwr\"}],\"nextLink\":\"hwagohbuffkmrqe\"}") - .toObject(AlertsSuppressionRulesList.class); - Assertions.assertEquals("hvbbxuripltfnh", model.value().get(0).alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-21T19:13:45Z"), model.value().get(0).expirationDateUtc()); - Assertions.assertEquals("gx", model.value().get(0).reason()); - Assertions.assertEquals(RuleState.EXPIRED, model.value().get(0).state()); - Assertions.assertEquals("ckpyklyhplu", model.value().get(0).comment()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AlertsSuppressionRulesList model = - new AlertsSuppressionRulesList() - .withValue( - Arrays - .asList( - new AlertsSuppressionRuleInner() - .withAlertType("hvbbxuripltfnh") - .withExpirationDateUtc(OffsetDateTime.parse("2021-08-21T19:13:45Z")) - .withReason("gx") - .withState(RuleState.EXPIRED) - .withComment("ckpyklyhplu"), - new AlertsSuppressionRuleInner() - .withAlertType("bcvhzlhpl") - .withExpirationDateUtc(OffsetDateTime.parse("2021-05-30T19:04:16Z")) - .withReason("lwwqfbumlkxtrqj") - .withState(RuleState.DISABLED) - .withComment("lmbtxhwgfwsrt"), - new AlertsSuppressionRuleInner() - .withAlertType("qjbvleorfmlu") - .withExpirationDateUtc(OffsetDateTime.parse("2021-10-19T17:51:06Z")) - .withReason("fa") - .withState(RuleState.DISABLED) - .withComment("nqqyba"))); - model = BinaryData.fromObject(model).toObject(AlertsSuppressionRulesList.class); - Assertions.assertEquals("hvbbxuripltfnh", model.value().get(0).alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-21T19:13:45Z"), model.value().get(0).expirationDateUtc()); - Assertions.assertEquals("gx", model.value().get(0).reason()); - Assertions.assertEquals(RuleState.EXPIRED, model.value().get(0).state()); - Assertions.assertEquals("ckpyklyhplu", model.value().get(0).comment()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateWithResponseMockTests.java deleted file mode 100644 index 02c680c4c7bd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsSuppressionRulesUpdateWithResponseMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.fluent.models.AlertsSuppressionRuleInner; -import com.azure.resourcemanager.security.models.AlertsSuppressionRule; -import com.azure.resourcemanager.security.models.RuleState; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsSuppressionRulesUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"alertType\":\"kgd\",\"lastModifiedUtc\":\"2021-11-26T23:11:17Z\",\"expirationDateUtc\":\"2021-10-12T17:44:39Z\",\"reason\":\"k\",\"state\":\"Disabled\",\"comment\":\"hgsqtnqsktxq\",\"suppressionAlertsScope\":{\"allOf\":[]}},\"id\":\"jbqggweeiwdhdm\",\"name\":\"cgbfzuscstun\",\"type\":\"lhxd\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AlertsSuppressionRule response = - manager - .alertsSuppressionRules() - .updateWithResponse( - "lfmsibzoyrfg", - new AlertsSuppressionRuleInner() - .withAlertType("ydpmypgfqvmt") - .withExpirationDateUtc(OffsetDateTime.parse("2021-08-23T13:21:07Z")) - .withReason("kxp") - .withState(RuleState.ENABLED) - .withComment("ewp") - .withSuppressionAlertsScope(new SuppressionAlertsScope().withAllOf(Arrays.asList())), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("kgd", response.alertType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-12T17:44:39Z"), response.expirationDateUtc()); - Assertions.assertEquals("k", response.reason()); - Assertions.assertEquals(RuleState.DISABLED, response.state()); - Assertions.assertEquals("hgsqtnqsktxq", response.comment()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateWithResponseMockTests.java deleted file mode 100644 index 56338bb46e38..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToActivateWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateResourceGroupLevelStateToActivateWithResponseMockTests { - @Test - public void testUpdateResourceGroupLevelStateToActivateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateResourceGroupLevelStateToActivateWithResponse( - "x", "mdbgi", "ehfgsm", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissWithResponseMockTests.java deleted file mode 100644 index 74577e554101..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToDismissWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateResourceGroupLevelStateToDismissWithResponseMockTests { - @Test - public void testUpdateResourceGroupLevelStateToDismissWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateResourceGroupLevelStateToDismissWithResponse( - "dfddtullygtav", "zcxdfweapyfmlxrl", "phraspifleim", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressWithResponseMockTests.java deleted file mode 100644 index 37052ed1b3de..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToInProgressWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateResourceGroupLevelStateToInProgressWithResponseMockTests { - @Test - public void testUpdateResourceGroupLevelStateToInProgressWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateResourceGroupLevelStateToInProgressWithResponse( - "rjuqbpxtokl", "mtznpaxwfqtyyqi", "rcltungbsoljckm", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveWithResponseMockTests.java deleted file mode 100644 index f8a4d2f86b45..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateResourceGroupLevelStateToResolveWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateResourceGroupLevelStateToResolveWithResponseMockTests { - @Test - public void testUpdateResourceGroupLevelStateToResolveWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateResourceGroupLevelStateToResolveWithResponse( - "d", "ffhsdpzouhk", "qrxqwqnjx", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateWithResponseMockTests.java deleted file mode 100644 index 0830b07b98ac..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToActivateWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateSubscriptionLevelStateToActivateWithResponseMockTests { - @Test - public void testUpdateSubscriptionLevelStateToActivateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateSubscriptionLevelStateToActivateWithResponse("cn", "rfijhggabq", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissWithResponseMockTests.java deleted file mode 100644 index 972e6b0487e3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToDismissWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateSubscriptionLevelStateToDismissWithResponseMockTests { - @Test - public void testUpdateSubscriptionLevelStateToDismissWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateSubscriptionLevelStateToDismissWithResponse( - "tkwppthuzd", "rmimrljdpoqfxyem", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressWithResponseMockTests.java deleted file mode 100644 index 826f8a062c3d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToInProgressWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateSubscriptionLevelStateToInProgressWithResponseMockTests { - @Test - public void testUpdateSubscriptionLevelStateToInProgressWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateSubscriptionLevelStateToInProgressWithResponse("gamk", "ilir", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveWithResponseMockTests.java deleted file mode 100644 index ae393fa92296..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AlertsUpdateSubscriptionLevelStateToResolveWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AlertsUpdateSubscriptionLevelStateToResolveWithResponseMockTests { - @Test - public void testUpdateSubscriptionLevelStateToResolveWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .alerts() - .updateSubscriptionLevelStateToResolveWithResponse( - "kftbaewhte", "loamfmxtllfltym", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetWithResponseMockTests.java deleted file mode 100644 index 815260eb5f73..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AllowedConnectionsResource; -import com.azure.resourcemanager.security.models.ConnectionType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AllowedConnectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"calculatedDateTime\":\"2021-09-15T08:15:42Z\",\"connectableResources\":[]},\"location\":\"ktyhhmvfxl\",\"id\":\"pjajodmkrrwe\",\"name\":\"gqvqokqluj\",\"type\":\"gira\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AllowedConnectionsResource response = - manager - .allowedConnections() - .getWithResponse( - "rouigdmfivjqte", "dqqigdydkghpc", ConnectionType.EXTERNAL, com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionMockTests.java deleted file mode 100644 index a6389f1b0cd4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListByHomeRegionMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AllowedConnectionsResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AllowedConnectionsListByHomeRegionMockTests { - @Test - public void testListByHomeRegion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"calculatedDateTime\":\"2021-09-16T09:02:02Z\",\"connectableResources\":[]},\"location\":\"xsure\",\"id\":\"qrshzzbgullcxiq\",\"name\":\"zjk\",\"type\":\"xdupnamg\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.allowedConnections().listByHomeRegion("xdede", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListMockTests.java deleted file mode 100644 index cfa7d53f20db..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AllowedConnectionsResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AllowedConnectionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"calculatedDateTime\":\"2021-12-05T18:52:31Z\",\"connectableResources\":[]},\"location\":\"itwhrjsdmmazdnck\",\"id\":\"dbjp\",\"name\":\"lhzqpxzbawkikcdg\",\"type\":\"hbssdpjeyo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.allowedConnections().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListTests.java deleted file mode 100644 index 35d06482012a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AllowedConnectionsList; - -public final class AllowedConnectionsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllowedConnectionsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"calculatedDateTime\":\"2021-08-31T13:06:45Z\",\"connectableResources\":[]},\"location\":\"lgehg\",\"id\":\"pipifh\",\"name\":\"f\",\"type\":\"oajvgcxtxjcs\"},{\"properties\":{\"calculatedDateTime\":\"2021-01-13T18:57:24Z\",\"connectableResources\":[]},\"location\":\"ltugsresmkssjhoi\",\"id\":\"txfkfweg\",\"name\":\"rhptilluc\",\"type\":\"iqtgdqoh\"},{\"properties\":{\"calculatedDateTime\":\"2021-03-25T09:14:26Z\",\"connectableResources\":[]},\"location\":\"riz\",\"id\":\"tpwb\",\"name\":\"a\",\"type\":\"llibphbqzmizak\"},{\"properties\":{\"calculatedDateTime\":\"2021-02-12T00:07:30Z\",\"connectableResources\":[]},\"location\":\"p\",\"id\":\"n\",\"name\":\"zhajoylhjlmuo\",\"type\":\"xprimrsop\"}],\"nextLink\":\"ecj\"}") - .toObject(AllowedConnectionsList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllowedConnectionsList model = new AllowedConnectionsList(); - model = BinaryData.fromObject(model).toObject(AllowedConnectionsList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsResourceInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsResourceInnerTests.java deleted file mode 100644 index ea05528b8a62..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsResourceInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceInner; - -public final class AllowedConnectionsResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllowedConnectionsResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"calculatedDateTime\":\"2021-01-03T12:26:20Z\",\"connectableResources\":[{\"id\":\"vasylwxdzau\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]},{\"id\":\"ohguuf\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]},{\"id\":\"yjathwtzo\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]},{\"id\":\"mwmdxmebwjscjpa\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]}]},\"location\":\"eabfqxnm\",\"id\":\"mqt\",\"name\":\"bxyijddtvq\",\"type\":\"ttadijae\"}") - .toObject(AllowedConnectionsResourceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllowedConnectionsResourceInner model = new AllowedConnectionsResourceInner(); - model = BinaryData.fromObject(model).toObject(AllowedConnectionsResourceInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsResourcePropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsResourcePropertiesTests.java deleted file mode 100644 index a64ed5ef9566..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowedConnectionsResourcePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceProperties; - -public final class AllowedConnectionsResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllowedConnectionsResourceProperties model = - BinaryData - .fromString( - "{\"calculatedDateTime\":\"2021-07-31T17:06:26Z\",\"connectableResources\":[{\"id\":\"eekpndz\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]},{\"id\":\"qmeqwigpibudqwyx\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]},{\"id\":\"mzznrtffyaqitmhh\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]},{\"id\":\"hvseufuqyrx\",\"inboundConnectedResources\":[],\"outboundConnectedResources\":[]}]}") - .toObject(AllowedConnectionsResourceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllowedConnectionsResourceProperties model = new AllowedConnectionsResourceProperties(); - model = BinaryData.fromObject(model).toObject(AllowedConnectionsResourceProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowlistCustomAlertRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowlistCustomAlertRuleTests.java deleted file mode 100644 index e48a91350e3f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AllowlistCustomAlertRuleTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AllowlistCustomAlertRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AllowlistCustomAlertRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AllowlistCustomAlertRule model = - BinaryData - .fromString( - "{\"ruleType\":\"AllowlistCustomAlertRule\",\"allowlistValues\":[\"vkwlzuvccfwnf\",\"bacfionlebxetq\",\"tzxdpnqbqqwx\",\"jfeallnwsub\"],\"valueType\":\"IpCidr\",\"displayName\":\"ampmngnz\",\"description\":\"xaqwoochcbonqv\",\"isEnabled\":false}") - .toObject(AllowlistCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("vkwlzuvccfwnf", model.allowlistValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AllowlistCustomAlertRule model = - new AllowlistCustomAlertRule() - .withIsEnabled(false) - .withAllowlistValues(Arrays.asList("vkwlzuvccfwnf", "bacfionlebxetq", "tzxdpnqbqqwx", "jfeallnwsub")); - model = BinaryData.fromObject(model).toObject(AllowlistCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("vkwlzuvccfwnf", model.allowlistValues().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpC2DMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpC2DMessagesNotInAllowedRangeTests.java deleted file mode 100644 index c139164b01cf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpC2DMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AmqpC2DMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class AmqpC2DMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmqpC2DMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"AmqpC2DMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT71H1M20S\",\"minThreshold\":1281785865,\"maxThreshold\":384532828,\"displayName\":\"adppyibn\",\"description\":\"ladywrxwhyd\",\"isEnabled\":false}") - .toObject(AmqpC2DMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1281785865, model.minThreshold()); - Assertions.assertEquals(384532828, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT71H1M20S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmqpC2DMessagesNotInAllowedRange model = - new AmqpC2DMessagesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(1281785865) - .withMaxThreshold(384532828) - .withTimeWindowSize(Duration.parse("PT71H1M20S")); - model = BinaryData.fromObject(model).toObject(AmqpC2DMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1281785865, model.minThreshold()); - Assertions.assertEquals(384532828, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT71H1M20S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpC2DRejectedMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpC2DRejectedMessagesNotInAllowedRangeTests.java deleted file mode 100644 index ea2027f0ced9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpC2DRejectedMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AmqpC2DRejectedMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class AmqpC2DRejectedMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmqpC2DRejectedMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"AmqpC2DRejectedMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT118H2M58S\",\"minThreshold\":1648107284,\"maxThreshold\":1284555207,\"displayName\":\"rfmvlihcvjdrqcrj\",\"description\":\"h\",\"isEnabled\":false}") - .toObject(AmqpC2DRejectedMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1648107284, model.minThreshold()); - Assertions.assertEquals(1284555207, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT118H2M58S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmqpC2DRejectedMessagesNotInAllowedRange model = - new AmqpC2DRejectedMessagesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(1648107284) - .withMaxThreshold(1284555207) - .withTimeWindowSize(Duration.parse("PT118H2M58S")); - model = BinaryData.fromObject(model).toObject(AmqpC2DRejectedMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1648107284, model.minThreshold()); - Assertions.assertEquals(1284555207, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT118H2M58S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpD2CMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpD2CMessagesNotInAllowedRangeTests.java deleted file mode 100644 index ed3dfea10c4a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AmqpD2CMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AmqpD2CMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class AmqpD2CMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AmqpD2CMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"AmqpD2CMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT179H38M47S\",\"minThreshold\":1851609223,\"maxThreshold\":1126673643,\"displayName\":\"gfxonjtpusllyw\",\"description\":\"tiotzb\",\"isEnabled\":false}") - .toObject(AmqpD2CMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1851609223, model.minThreshold()); - Assertions.assertEquals(1126673643, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT179H38M47S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AmqpD2CMessagesNotInAllowedRange model = - new AmqpD2CMessagesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(1851609223) - .withMaxThreshold(1126673643) - .withTimeWindowSize(Duration.parse("PT179H38M47S")); - model = BinaryData.fromObject(model).toObject(AmqpD2CMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1851609223, model.minThreshold()); - Assertions.assertEquals(1126673643, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT179H38M47S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingsDeleteWithResponseMockTests.java deleted file mode 100644 index 55ec6a654fb6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOffboardingsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApiCollectionOffboardingsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .apiCollectionOffboardings() - .deleteWithResponse("rnrnjrcufmbgacnr", "fdtncmspsanma", "eubkqiqmlf", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingsCreateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingsCreateWithResponseMockTests.java deleted file mode 100644 index 24971fcf7a0a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionOnboardingsCreateWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApiCollectionOnboardingsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"xkwyk\",\"additionalData\":{\"ykhkg\":\"ndx\"}},\"id\":\"apvd\",\"name\":\"t\",\"type\":\"peerscd\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ApiCollectionResponse response = - manager - .apiCollectionOnboardings() - .createWithResponse("tkihonikzs", "zfffjilzfbpnt", "gkensckhbmcarmo", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xkwyk", response.displayName()); - Assertions.assertEquals("ndx", response.additionalData().get("ykhkg")); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionPropertiesTests.java deleted file mode 100644 index fac7b90d0316..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionPropertiesTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ApiCollectionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiCollectionProperties model = - BinaryData - .fromString( - "{\"displayName\":\"y\",\"additionalData\":{\"fkak\":\"mwineof\",\"knyuxgvttxpn\":\"oldtvevboclzhz\",\"ids\":\"upzaamrdixtre\",\"l\":\"yskbruff\"}}") - .toObject(ApiCollectionProperties.class); - Assertions.assertEquals("y", model.displayName()); - Assertions.assertEquals("mwineof", model.additionalData().get("fkak")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiCollectionProperties model = - new ApiCollectionProperties() - .withDisplayName("y") - .withAdditionalData( - mapOf( - "fkak", "mwineof", "knyuxgvttxpn", "oldtvevboclzhz", "ids", "upzaamrdixtre", "l", "yskbruff")); - model = BinaryData.fromObject(model).toObject(ApiCollectionProperties.class); - Assertions.assertEquals("y", model.displayName()); - Assertions.assertEquals("mwineof", model.additionalData().get("fkak")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseInnerTests.java deleted file mode 100644 index 4e134a165c2d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseInnerTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ApiCollectionResponseInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ApiCollectionResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiCollectionResponseInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"zealbmqkyo\",\"additionalData\":{\"mbtsuahxsg\":\"vf\",\"wsdrnpxqwodif\":\"jcmmzrrscub\"}},\"id\":\"jxcjrmmuabwib\",\"name\":\"jogjonmc\",\"type\":\"e\"}") - .toObject(ApiCollectionResponseInner.class); - Assertions.assertEquals("zealbmqkyo", model.displayName()); - Assertions.assertEquals("vf", model.additionalData().get("mbtsuahxsg")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiCollectionResponseInner model = - new ApiCollectionResponseInner() - .withDisplayName("zealbmqkyo") - .withAdditionalData(mapOf("mbtsuahxsg", "vf", "wsdrnpxqwodif", "jcmmzrrscub")); - model = BinaryData.fromObject(model).toObject(ApiCollectionResponseInner.class); - Assertions.assertEquals("zealbmqkyo", model.displayName()); - Assertions.assertEquals("vf", model.additionalData().get("mbtsuahxsg")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseListTests.java deleted file mode 100644 index 781622c42653..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionResponseListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ApiCollectionResponseList; - -public final class ApiCollectionResponseListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApiCollectionResponseList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"yjq\",\"additionalData\":{}},\"id\":\"kfnozoeoqbvj\",\"name\":\"vefgwbmqjchntas\",\"type\":\"ay\"}],\"nextLink\":\"b\"}") - .toObject(ApiCollectionResponseList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApiCollectionResponseList model = new ApiCollectionResponseList(); - model = BinaryData.fromObject(model).toObject(ApiCollectionResponseList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetWithResponseMockTests.java deleted file mode 100644 index 6bc6da68571f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApiCollectionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"oewyhxessmvrkd\",\"additionalData\":{\"mdsesbrujbjpp\":\"eqfbd\"}},\"id\":\"ktlpdibfmthieat\",\"name\":\"ejrnmi\",\"type\":\"zqpl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ApiCollectionResponse response = - manager - .apiCollections() - .getWithResponse("ortbnukkfax", "svbxxyjisskob", "ocl", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("oewyhxessmvrkd", response.displayName()); - Assertions.assertEquals("eqfbd", response.additionalData().get("mdsesbrujbjpp")); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsListMockTests.java deleted file mode 100644 index da73e2c4bedb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApiCollectionsListMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ApiCollectionResponse; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApiCollectionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"zwhpjlwyxedz\",\"additionalData\":{\"ckewvm\":\"rfo\",\"utxfptofhgnuyw\":\"ifopxfjjtpdyz\"}},\"id\":\"zygvadgaaqwvkgjp\",\"name\":\"tpmpvd\",\"type\":\"ogehluf\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.apiCollections().list("gyedzfzqi", "uqhtdereuno", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zwhpjlwyxedz", response.iterator().next().displayName()); - Assertions.assertEquals("rfo", response.iterator().next().additionalData().get("ckewvm")); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationInnerTests.java deleted file mode 100644 index 3fd094f1050a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"cfehuwaoagu\",\"description\":\"cqlliz\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"datacsjvhrwef\"]},\"id\":\"kwqejpmvsseh\",\"name\":\"epwamcxtcz\",\"type\":\"upeuknijduyye\"}") - .toObject(ApplicationInner.class); - Assertions.assertEquals("cfehuwaoagu", model.displayName()); - Assertions.assertEquals("cqlliz", model.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationInner model = - new ApplicationInner() - .withDisplayName("cfehuwaoagu") - .withDescription("cqlliz") - .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) - .withConditionSets(Arrays.asList("datacsjvhrwef")); - model = BinaryData.fromObject(model).toObject(ApplicationInner.class); - Assertions.assertEquals("cfehuwaoagu", model.displayName()); - Assertions.assertEquals("cqlliz", model.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index a741d734b636..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApplicationOperationsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"mgqbgcxhnq\",\"description\":\"zxlermkmer\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"datakirhn\",\"dataupkcbkfukdljqnvt\"]},\"id\":\"dydshk\",\"name\":\"afyalo\",\"type\":\"ww\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Application response = - manager - .applicationOperations() - .define("ntojovfnybydhuih") - .withDisplayName("wud") - .withDescription("aorhjkehwvumo") - .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) - .withConditionSets(Arrays.asList("datarcamqp", "datal", "databrugejcvjkjycz")) - .create(); - - Assertions.assertEquals("mgqbgcxhnq", response.displayName()); - Assertions.assertEquals("zxlermkmer", response.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, response.sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsDeleteWithResponseMockTests.java deleted file mode 100644 index b25e90758dc6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApplicationOperationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.applicationOperations().deleteWithResponse("i", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsGetWithResponseMockTests.java deleted file mode 100644 index 4e24d91a35e0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApplicationOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"nmpaklwzlweepr\",\"description\":\"jzltkaszfjs\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"databduxapgrcq\",\"databmvrdjomlnwsbv\",\"datadls\",\"datalxkqesdfeds\"]},\"id\":\"gzancoinmphy\",\"name\":\"cqidkltvdhqnufbx\",\"type\":\"e\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Application response = - manager.applicationOperations().getWithResponse("wrqkza", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("nmpaklwzlweepr", response.displayName()); - Assertions.assertEquals("jzltkaszfjs", response.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, response.sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationPropertiesTests.java deleted file mode 100644 index c0f1478e494c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ApplicationProperties; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ApplicationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationProperties model = - BinaryData - .fromString( - "{\"displayName\":\"ydjfb\",\"description\":\"yv\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"datalrtywikdmhlakuf\",\"datagbhgau\",\"datacdixmx\"]}") - .toObject(ApplicationProperties.class); - Assertions.assertEquals("ydjfb", model.displayName()); - Assertions.assertEquals("yv", model.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationProperties model = - new ApplicationProperties() - .withDisplayName("ydjfb") - .withDescription("yv") - .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) - .withConditionSets(Arrays.asList("datalrtywikdmhlakuf", "datagbhgau", "datacdixmx")); - model = BinaryData.fromObject(model).toObject(ApplicationProperties.class); - Assertions.assertEquals("ydjfb", model.displayName()); - Assertions.assertEquals("yv", model.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationsListMockTests.java deleted file mode 100644 index de04b9c78cad..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationsListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ApplicationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"zgbjbhrpgi\",\"description\":\"ttcucrcm\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"dataxp\",\"datajiwifhbksldttoh\"]},\"id\":\"clnaihtg\",\"name\":\"iqikvllr\",\"type\":\"tpmglxkoikmtr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.applications().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zgbjbhrpgi", response.iterator().next().displayName()); - Assertions.assertEquals("ttcucrcm", response.iterator().next().description()); - Assertions - .assertEquals(ApplicationSourceResourceType.ASSESSMENTS, response.iterator().next().sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationsListTests.java deleted file mode 100644 index a666e51ec3ce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ApplicationsListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ApplicationsList; - -public final class ApplicationsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ApplicationsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"fbwqrooht\",\"description\":\"vmaonurjt\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[]},\"id\":\"ghihpvecms\",\"name\":\"clbl\",\"type\":\"jxl\"},{\"properties\":{\"displayName\":\"juscvsfx\",\"description\":\"ctmgxuupbezqccy\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[]},\"id\":\"tce\",\"name\":\"kdqkkyihzt\",\"type\":\"eq\"}],\"nextLink\":\"qzgwldoychil\"}") - .toObject(ApplicationsList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ApplicationsList model = new ApplicationsList(); - model = BinaryData.fromObject(model).toObject(ApplicationsList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AscLocationInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AscLocationInnerTests.java deleted file mode 100644 index ca0b19baf373..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AscLocationInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AscLocationInner; - -public final class AscLocationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AscLocationInner model = - BinaryData - .fromString( - "{\"properties\":\"datasdqrhzoymibmrq\",\"id\":\"ibahwflus\",\"name\":\"dtmhrkwofyyvoqa\",\"type\":\"piexpbtgiw\"}") - .toObject(AscLocationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AscLocationInner model = new AscLocationInner().withProperties("datasdqrhzoymibmrq"); - model = BinaryData.fromObject(model).toObject(AscLocationInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AscLocationListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AscLocationListTests.java deleted file mode 100644 index acef2fad6e2a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AscLocationListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AscLocationList; - -public final class AscLocationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AscLocationList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":\"datasmond\",\"id\":\"mquxvypo\",\"name\":\"gkopkwhojvpajqgx\",\"type\":\"smocmbq\"},{\"properties\":\"datavmkcx\",\"id\":\"zapvhelx\",\"name\":\"rgly\",\"type\":\"tddckcb\"}],\"nextLink\":\"ejrjxgciqibrho\"}") - .toObject(AscLocationList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AscLocationList model = new AscLocationList(); - model = BinaryData.fromObject(model).toObject(AscLocationList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentLinksTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentLinksTests.java deleted file mode 100644 index c415b483f63c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentLinksTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AssessmentLinks; - -public final class AssessmentLinksTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AssessmentLinks model = - BinaryData.fromString("{\"azurePortalUri\":\"ycavodggxdbees\"}").toObject(AssessmentLinks.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AssessmentLinks model = new AssessmentLinks(); - model = BinaryData.fromObject(model).toObject(AssessmentLinks.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index b7eb6ccb24a2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AssessmentsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .assessments() - .deleteByResourceGroupWithResponse("dtmvecdhdyswcrp", "veajczxvlgsrg", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentsMetadatasDeleteInSubscriptionWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentsMetadatasDeleteInSubscriptionWithResponseMockTests.java deleted file mode 100644 index a3c54e4ccd1a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AssessmentsMetadatasDeleteInSubscriptionWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AssessmentsMetadatasDeleteInSubscriptionWithResponseMockTests { - @Test - public void testDeleteInSubscriptionWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.assessmentsMetadatas().deleteInSubscriptionWithResponse("buwvorba", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AtaExternalSecuritySolutionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AtaExternalSecuritySolutionTests.java deleted file mode 100644 index ad2a34e9f49a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AtaExternalSecuritySolutionTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AtaExternalSecuritySolution; -import com.azure.resourcemanager.security.models.AtaSolutionProperties; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class AtaExternalSecuritySolutionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AtaExternalSecuritySolution model = - BinaryData - .fromString( - "{\"kind\":\"ATA\",\"properties\":{\"lastEventReceived\":\"gv\",\"deviceVendor\":\"e\",\"deviceType\":\"uoqujlyeg\",\"workspace\":{\"id\":\"nigflqqbtnyj\"},\"\":{\"vabm\":\"dataxdb\",\"wuhvaj\":\"datamsxbaevwjcnkott\",\"wjiqullqxb\":\"dataailfemjjzak\"}},\"location\":\"vr\",\"id\":\"cm\",\"name\":\"erndbrnyeofltfnn\",\"type\":\"rkadjfynnfmuiiir\"}") - .toObject(AtaExternalSecuritySolution.class); - Assertions.assertEquals("e", model.properties().deviceVendor()); - Assertions.assertEquals("uoqujlyeg", model.properties().deviceType()); - Assertions.assertEquals("nigflqqbtnyj", model.properties().workspace().id()); - Assertions.assertEquals("gv", model.properties().lastEventReceived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AtaExternalSecuritySolution model = - new AtaExternalSecuritySolution() - .withProperties( - new AtaSolutionProperties() - .withDeviceVendor("e") - .withDeviceType("uoqujlyeg") - .withWorkspace(new ConnectedWorkspace().withId("nigflqqbtnyj")) - .withLastEventReceived("gv")); - model = BinaryData.fromObject(model).toObject(AtaExternalSecuritySolution.class); - Assertions.assertEquals("e", model.properties().deviceVendor()); - Assertions.assertEquals("uoqujlyeg", model.properties().deviceType()); - Assertions.assertEquals("nigflqqbtnyj", model.properties().workspace().id()); - Assertions.assertEquals("gv", model.properties().lastEventReceived()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AtaSolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AtaSolutionPropertiesTests.java deleted file mode 100644 index a820c548dcf9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AtaSolutionPropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AtaSolutionProperties; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class AtaSolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AtaSolutionProperties model = - BinaryData - .fromString( - "{\"lastEventReceived\":\"fohyk\",\"deviceVendor\":\"xbbcbrw\",\"deviceType\":\"u\",\"workspace\":{\"id\":\"jizbeew\"},\"\":{\"juyrsrziuctixg\":\"datamrvz\",\"uifr\":\"datad\"}}") - .toObject(AtaSolutionProperties.class); - Assertions.assertEquals("xbbcbrw", model.deviceVendor()); - Assertions.assertEquals("u", model.deviceType()); - Assertions.assertEquals("jizbeew", model.workspace().id()); - Assertions.assertEquals("fohyk", model.lastEventReceived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AtaSolutionProperties model = - new AtaSolutionProperties() - .withDeviceVendor("xbbcbrw") - .withDeviceType("u") - .withWorkspace(new ConnectedWorkspace().withId("jizbeew")) - .withLastEventReceived("fohyk"); - model = BinaryData.fromObject(model).toObject(AtaSolutionProperties.class); - Assertions.assertEquals("xbbcbrw", model.deviceVendor()); - Assertions.assertEquals("u", model.deviceType()); - Assertions.assertEquals("jizbeew", model.workspace().id()); - Assertions.assertEquals("fohyk", model.lastEventReceived()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AuthenticationDetailsPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AuthenticationDetailsPropertiesTests.java deleted file mode 100644 index 590dc411410c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AuthenticationDetailsPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties; - -public final class AuthenticationDetailsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AuthenticationDetailsProperties model = - BinaryData - .fromString( - "{\"authenticationType\":\"AuthenticationDetailsProperties\",\"authenticationProvisioningState\":\"Valid\",\"grantedPermissions\":[\"AWS::AWSSecurityHubReadOnlyAccess\",\"AWS::AmazonSSMAutomationRole\",\"AWS::SecurityAudit\"]}") - .toObject(AuthenticationDetailsProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AuthenticationDetailsProperties model = new AuthenticationDetailsProperties(); - model = BinaryData.fromObject(model).toObject(AuthenticationDetailsProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingInnerTests.java deleted file mode 100644 index dd38cf540c13..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import com.azure.resourcemanager.security.models.AutoProvision; -import org.junit.jupiter.api.Assertions; - -public final class AutoProvisioningSettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoProvisioningSettingInner model = - BinaryData - .fromString( - "{\"properties\":{\"autoProvision\":\"On\"},\"id\":\"ikh\",\"name\":\"yf\",\"type\":\"hdgqggeb\"}") - .toObject(AutoProvisioningSettingInner.class); - Assertions.assertEquals(AutoProvision.ON, model.autoProvision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoProvisioningSettingInner model = new AutoProvisioningSettingInner().withAutoProvision(AutoProvision.ON); - model = BinaryData.fromObject(model).toObject(AutoProvisioningSettingInner.class); - Assertions.assertEquals(AutoProvision.ON, model.autoProvision()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingListTests.java deleted file mode 100644 index 00d317e22087..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingListTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingInner; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AutoProvisioningSettingList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AutoProvisioningSettingListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoProvisioningSettingList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"autoProvision\":\"On\"},\"id\":\"irels\",\"name\":\"eae\",\"type\":\"wabfatkl\"},{\"properties\":{\"autoProvision\":\"Off\"},\"id\":\"bjhwuaan\",\"name\":\"zjosp\",\"type\":\"youlp\"},{\"properties\":{\"autoProvision\":\"On\"},\"id\":\"xagl\",\"name\":\"vimjwos\",\"type\":\"tx\"}],\"nextLink\":\"cskfcktqumiekk\"}") - .toObject(AutoProvisioningSettingList.class); - Assertions.assertEquals(AutoProvision.ON, model.value().get(0).autoProvision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoProvisioningSettingList model = - new AutoProvisioningSettingList() - .withValue( - Arrays - .asList( - new AutoProvisioningSettingInner().withAutoProvision(AutoProvision.ON), - new AutoProvisioningSettingInner().withAutoProvision(AutoProvision.OFF), - new AutoProvisioningSettingInner().withAutoProvision(AutoProvision.ON))); - model = BinaryData.fromObject(model).toObject(AutoProvisioningSettingList.class); - Assertions.assertEquals(AutoProvision.ON, model.value().get(0).autoProvision()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingPropertiesTests.java deleted file mode 100644 index 4c07192125e5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingPropertiesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AutoProvisioningSettingProperties; -import com.azure.resourcemanager.security.models.AutoProvision; -import org.junit.jupiter.api.Assertions; - -public final class AutoProvisioningSettingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutoProvisioningSettingProperties model = - BinaryData.fromString("{\"autoProvision\":\"Off\"}").toObject(AutoProvisioningSettingProperties.class); - Assertions.assertEquals(AutoProvision.OFF, model.autoProvision()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutoProvisioningSettingProperties model = - new AutoProvisioningSettingProperties().withAutoProvision(AutoProvision.OFF); - model = BinaryData.fromObject(model).toObject(AutoProvisioningSettingProperties.class); - Assertions.assertEquals(AutoProvision.OFF, model.autoProvision()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateWithResponseMockTests.java deleted file mode 100644 index b02a8a5568b2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsCreateWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AutoProvisioningSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutoProvisioningSettingsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoProvision\":\"On\"},\"id\":\"qady\",\"name\":\"zjahwriuomz\",\"type\":\"zfkiceevsaaxwsp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AutoProvisioningSetting response = - manager.autoProvisioningSettings().define("ybsjrc").withAutoProvision(AutoProvision.OFF).create(); - - Assertions.assertEquals(AutoProvision.ON, response.autoProvision()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetWithResponseMockTests.java deleted file mode 100644 index 418e8ce8f96f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AutoProvisioningSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutoProvisioningSettingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"autoProvision\":\"Off\"},\"id\":\"ckhmocgjshgouarh\",\"name\":\"vi\",\"type\":\"qqgglj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AutoProvisioningSetting response = - manager - .autoProvisioningSettings() - .getWithResponse("ynbpvzlqywauy", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(AutoProvision.OFF, response.autoProvision()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListMockTests.java deleted file mode 100644 index a9bf5542c139..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutoProvisioningSettingsListMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.AutoProvisioningSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutoProvisioningSettingsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"autoProvision\":\"On\"},\"id\":\"dneyttlr\",\"name\":\"xivcbkutpumlt\",\"type\":\"jflu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.autoProvisioningSettings().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoProvision.ON, response.iterator().next().autoProvision()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionEventHubTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionEventHubTests.java deleted file mode 100644 index d9cd34116ccf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionEventHubTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationActionEventHub; -import org.junit.jupiter.api.Assertions; - -public final class AutomationActionEventHubTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationActionEventHub model = - BinaryData - .fromString( - "{\"actionType\":\"EventHub\",\"eventHubResourceId\":\"gvpyigdaqqilzdc\",\"sasPolicyName\":\"wjoe\",\"connectionString\":\"ngucaifpaurww\"}") - .toObject(AutomationActionEventHub.class); - Assertions.assertEquals("gvpyigdaqqilzdc", model.eventHubResourceId()); - Assertions.assertEquals("ngucaifpaurww", model.connectionString()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationActionEventHub model = - new AutomationActionEventHub() - .withEventHubResourceId("gvpyigdaqqilzdc") - .withConnectionString("ngucaifpaurww"); - model = BinaryData.fromObject(model).toObject(AutomationActionEventHub.class); - Assertions.assertEquals("gvpyigdaqqilzdc", model.eventHubResourceId()); - Assertions.assertEquals("ngucaifpaurww", model.connectionString()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionLogicAppTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionLogicAppTests.java deleted file mode 100644 index bbf764644c44..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionLogicAppTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationActionLogicApp; -import org.junit.jupiter.api.Assertions; - -public final class AutomationActionLogicAppTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationActionLogicApp model = - BinaryData - .fromString("{\"actionType\":\"LogicApp\",\"logicAppResourceId\":\"bqc\",\"uri\":\"jfgxxsaetg\"}") - .toObject(AutomationActionLogicApp.class); - Assertions.assertEquals("bqc", model.logicAppResourceId()); - Assertions.assertEquals("jfgxxsaetg", model.uri()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationActionLogicApp model = - new AutomationActionLogicApp().withLogicAppResourceId("bqc").withUri("jfgxxsaetg"); - model = BinaryData.fromObject(model).toObject(AutomationActionLogicApp.class); - Assertions.assertEquals("bqc", model.logicAppResourceId()); - Assertions.assertEquals("jfgxxsaetg", model.uri()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionTests.java deleted file mode 100644 index 8b8800223b67..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationAction; - -public final class AutomationActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationAction model = - BinaryData.fromString("{\"actionType\":\"AutomationAction\"}").toObject(AutomationAction.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationAction model = new AutomationAction(); - model = BinaryData.fromObject(model).toObject(AutomationAction.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionWorkspaceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionWorkspaceTests.java deleted file mode 100644 index 4f0043678db0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationActionWorkspaceTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationActionWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class AutomationActionWorkspaceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationActionWorkspace model = - BinaryData - .fromString("{\"actionType\":\"Workspace\",\"workspaceResourceId\":\"l\"}") - .toObject(AutomationActionWorkspace.class); - Assertions.assertEquals("l", model.workspaceResourceId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationActionWorkspace model = new AutomationActionWorkspace().withWorkspaceResourceId("l"); - model = BinaryData.fromObject(model).toObject(AutomationActionWorkspace.class); - Assertions.assertEquals("l", model.workspaceResourceId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationInnerTests.java deleted file mode 100644 index a3f329e64d64..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationInnerTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.models.AutomationAction; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.azure.resourcemanager.security.models.EventSource; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AutomationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationInner model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"opqgikyzirtxdyux\",\"isEnabled\":true,\"scopes\":[{\"description\":\"sewgioilqukr\",\"scopePath\":\"xtqmieoxor\"},{\"description\":\"ufhyaomtbgh\",\"scopePath\":\"vgrvkffo\"}],\"sources\":[{\"eventSource\":\"Alerts\",\"ruleSets\":[]}],\"actions\":[{\"actionType\":\"AutomationAction\"},{\"actionType\":\"AutomationAction\"},{\"actionType\":\"AutomationAction\"},{\"actionType\":\"AutomationAction\"}]},\"location\":\"bgj\",\"tags\":{\"ovwxnbkfezzxsc\":\"umvfclu\",\"omvzzbtd\":\"hwzdgirujbz\",\"yujviylwdshfssn\":\"qvpn\"},\"id\":\"bgye\",\"name\":\"rymsgaojfmw\",\"type\":\"cotmr\"}") - .toObject(AutomationInner.class); - Assertions.assertEquals("bgj", model.location()); - Assertions.assertEquals("umvfclu", model.tags().get("ovwxnbkfezzxsc")); - Assertions.assertEquals("opqgikyzirtxdyux", model.description()); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("sewgioilqukr", model.scopes().get(0).description()); - Assertions.assertEquals("xtqmieoxor", model.scopes().get(0).scopePath()); - Assertions.assertEquals(EventSource.ALERTS, model.sources().get(0).eventSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationInner model = - new AutomationInner() - .withLocation("bgj") - .withTags(mapOf("ovwxnbkfezzxsc", "umvfclu", "omvzzbtd", "hwzdgirujbz", "yujviylwdshfssn", "qvpn")) - .withDescription("opqgikyzirtxdyux") - .withIsEnabled(true) - .withScopes( - Arrays - .asList( - new AutomationScope().withDescription("sewgioilqukr").withScopePath("xtqmieoxor"), - new AutomationScope().withDescription("ufhyaomtbgh").withScopePath("vgrvkffo"))) - .withSources( - Arrays - .asList( - new AutomationSource().withEventSource(EventSource.ALERTS).withRuleSets(Arrays.asList()))) - .withActions( - Arrays - .asList( - new AutomationAction(), - new AutomationAction(), - new AutomationAction(), - new AutomationAction())); - model = BinaryData.fromObject(model).toObject(AutomationInner.class); - Assertions.assertEquals("bgj", model.location()); - Assertions.assertEquals("umvfclu", model.tags().get("ovwxnbkfezzxsc")); - Assertions.assertEquals("opqgikyzirtxdyux", model.description()); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("sewgioilqukr", model.scopes().get(0).description()); - Assertions.assertEquals("xtqmieoxor", model.scopes().get(0).scopePath()); - Assertions.assertEquals(EventSource.ALERTS, model.sources().get(0).eventSource()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationListTests.java deleted file mode 100644 index 0103de6de228..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationListTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.models.AutomationList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AutomationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"description\":\"jpqqmted\",\"isEnabled\":false,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"hyeozphvwau\",\"tags\":{\"gupkvipmdscwxq\":\"c\"},\"id\":\"pevzhfst\",\"name\":\"txhojujb\",\"type\":\"pelmcuvhixbjxyf\"},{\"properties\":{\"description\":\"lrcoolsttpki\",\"isEnabled\":false,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"jrywvtylbfpnc\",\"tags\":{\"cbihwqk\":\"oiwiithtywub\",\"umwctondz\":\"fdntwjchrdgoih\"},\"id\":\"luudfdlwggytsb\",\"name\":\"tov\",\"type\":\"tgseinqfiufxqkn\"},{\"properties\":{\"description\":\"gnepttwqmsni\",\"isEnabled\":false,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"nrojlpijnkr\",\"tags\":{\"nasx\":\"ddhcratizzr\"},\"id\":\"ft\",\"name\":\"zq\",\"type\":\"zh\"},{\"properties\":{\"description\":\"esgogc\",\"isEnabled\":true,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"krlgnyhm\",\"tags\":{\"thrrgh\":\"xkk\",\"gf\":\"jbdhqxvc\"},\"id\":\"pdso\",\"name\":\"bshrnsvbuswd\",\"type\":\"z\"}],\"nextLink\":\"bycnunvjsrtkf\"}") - .toObject(AutomationList.class); - Assertions.assertEquals("hyeozphvwau", model.value().get(0).location()); - Assertions.assertEquals("c", model.value().get(0).tags().get("gupkvipmdscwxq")); - Assertions.assertEquals("jpqqmted", model.value().get(0).description()); - Assertions.assertEquals(false, model.value().get(0).isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationList model = - new AutomationList() - .withValue( - Arrays - .asList( - new AutomationInner() - .withLocation("hyeozphvwau") - .withTags(mapOf("gupkvipmdscwxq", "c")) - .withDescription("jpqqmted") - .withIsEnabled(false) - .withScopes(Arrays.asList()) - .withSources(Arrays.asList()) - .withActions(Arrays.asList()), - new AutomationInner() - .withLocation("jrywvtylbfpnc") - .withTags(mapOf("cbihwqk", "oiwiithtywub", "umwctondz", "fdntwjchrdgoih")) - .withDescription("lrcoolsttpki") - .withIsEnabled(false) - .withScopes(Arrays.asList()) - .withSources(Arrays.asList()) - .withActions(Arrays.asList()), - new AutomationInner() - .withLocation("nrojlpijnkr") - .withTags(mapOf("nasx", "ddhcratizzr")) - .withDescription("gnepttwqmsni") - .withIsEnabled(false) - .withScopes(Arrays.asList()) - .withSources(Arrays.asList()) - .withActions(Arrays.asList()), - new AutomationInner() - .withLocation("krlgnyhm") - .withTags(mapOf("thrrgh", "xkk", "gf", "jbdhqxvc")) - .withDescription("esgogc") - .withIsEnabled(true) - .withScopes(Arrays.asList()) - .withSources(Arrays.asList()) - .withActions(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(AutomationList.class); - Assertions.assertEquals("hyeozphvwau", model.value().get(0).location()); - Assertions.assertEquals("c", model.value().get(0).tags().get("gupkvipmdscwxq")); - Assertions.assertEquals("jpqqmted", model.value().get(0).description()); - Assertions.assertEquals(false, model.value().get(0).isEnabled()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationPropertiesTests.java deleted file mode 100644 index 8e374d423f4c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationPropertiesTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AutomationProperties; -import com.azure.resourcemanager.security.models.AutomationAction; -import com.azure.resourcemanager.security.models.AutomationScope; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.azure.resourcemanager.security.models.EventSource; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AutomationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationProperties model = - BinaryData - .fromString( - "{\"description\":\"irctymoxoftpipiw\",\"isEnabled\":false,\"scopes\":[{\"description\":\"a\",\"scopePath\":\"qjlihhyuspska\"},{\"description\":\"vlmfwdgzxulucv\",\"scopePath\":\"mrsreuzvxurisjnh\"},{\"description\":\"txifqj\",\"scopePath\":\"xmrhu\"},{\"description\":\"wp\",\"scopePath\":\"sutrgjup\"}],\"sources\":[{\"eventSource\":\"SubAssessmentsSnapshot\",\"ruleSets\":[]},{\"eventSource\":\"RegulatoryComplianceAssessment\",\"ruleSets\":[]},{\"eventSource\":\"Alerts\",\"ruleSets\":[]},{\"eventSource\":\"RegulatoryComplianceAssessmentSnapshot\",\"ruleSets\":[]}],\"actions\":[{\"actionType\":\"AutomationAction\"},{\"actionType\":\"AutomationAction\"},{\"actionType\":\"AutomationAction\"},{\"actionType\":\"AutomationAction\"}]}") - .toObject(AutomationProperties.class); - Assertions.assertEquals("irctymoxoftpipiw", model.description()); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("a", model.scopes().get(0).description()); - Assertions.assertEquals("qjlihhyuspska", model.scopes().get(0).scopePath()); - Assertions.assertEquals(EventSource.SUB_ASSESSMENTS_SNAPSHOT, model.sources().get(0).eventSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationProperties model = - new AutomationProperties() - .withDescription("irctymoxoftpipiw") - .withIsEnabled(false) - .withScopes( - Arrays - .asList( - new AutomationScope().withDescription("a").withScopePath("qjlihhyuspska"), - new AutomationScope().withDescription("vlmfwdgzxulucv").withScopePath("mrsreuzvxurisjnh"), - new AutomationScope().withDescription("txifqj").withScopePath("xmrhu"), - new AutomationScope().withDescription("wp").withScopePath("sutrgjup"))) - .withSources( - Arrays - .asList( - new AutomationSource() - .withEventSource(EventSource.SUB_ASSESSMENTS_SNAPSHOT) - .withRuleSets(Arrays.asList()), - new AutomationSource() - .withEventSource(EventSource.REGULATORY_COMPLIANCE_ASSESSMENT) - .withRuleSets(Arrays.asList()), - new AutomationSource().withEventSource(EventSource.ALERTS).withRuleSets(Arrays.asList()), - new AutomationSource() - .withEventSource(EventSource.REGULATORY_COMPLIANCE_ASSESSMENT_SNAPSHOT) - .withRuleSets(Arrays.asList()))) - .withActions( - Arrays - .asList( - new AutomationAction(), - new AutomationAction(), - new AutomationAction(), - new AutomationAction())); - model = BinaryData.fromObject(model).toObject(AutomationProperties.class); - Assertions.assertEquals("irctymoxoftpipiw", model.description()); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("a", model.scopes().get(0).description()); - Assertions.assertEquals("qjlihhyuspska", model.scopes().get(0).scopePath()); - Assertions.assertEquals(EventSource.SUB_ASSESSMENTS_SNAPSHOT, model.sources().get(0).eventSource()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationRuleSetTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationRuleSetTests.java deleted file mode 100644 index c41517f68b2d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationRuleSetTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationRuleSet; -import com.azure.resourcemanager.security.models.AutomationTriggeringRule; -import com.azure.resourcemanager.security.models.Operator; -import com.azure.resourcemanager.security.models.PropertyType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AutomationRuleSetTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationRuleSet model = - BinaryData - .fromString( - "{\"rules\":[{\"propertyJPath\":\"hvygdyftumr\",\"propertyType\":\"Boolean\",\"expectedValue\":\"wjslbiwkojgcyzt\",\"operator\":\"LesserThan\"}]}") - .toObject(AutomationRuleSet.class); - Assertions.assertEquals("hvygdyftumr", model.rules().get(0).propertyJPath()); - Assertions.assertEquals(PropertyType.BOOLEAN, model.rules().get(0).propertyType()); - Assertions.assertEquals("wjslbiwkojgcyzt", model.rules().get(0).expectedValue()); - Assertions.assertEquals(Operator.LESSER_THAN, model.rules().get(0).operator()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationRuleSet model = - new AutomationRuleSet() - .withRules( - Arrays - .asList( - new AutomationTriggeringRule() - .withPropertyJPath("hvygdyftumr") - .withPropertyType(PropertyType.BOOLEAN) - .withExpectedValue("wjslbiwkojgcyzt") - .withOperator(Operator.LESSER_THAN))); - model = BinaryData.fromObject(model).toObject(AutomationRuleSet.class); - Assertions.assertEquals("hvygdyftumr", model.rules().get(0).propertyJPath()); - Assertions.assertEquals(PropertyType.BOOLEAN, model.rules().get(0).propertyType()); - Assertions.assertEquals("wjslbiwkojgcyzt", model.rules().get(0).expectedValue()); - Assertions.assertEquals(Operator.LESSER_THAN, model.rules().get(0).operator()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationScopeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationScopeTests.java deleted file mode 100644 index 18bc6495f4c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationScopeTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationScope; -import org.junit.jupiter.api.Assertions; - -public final class AutomationScopeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationScope model = - BinaryData - .fromString("{\"description\":\"tcypsxjvfoim\",\"scopePath\":\"slirciz\"}") - .toObject(AutomationScope.class); - Assertions.assertEquals("tcypsxjvfoim", model.description()); - Assertions.assertEquals("slirciz", model.scopePath()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationScope model = new AutomationScope().withDescription("tcypsxjvfoim").withScopePath("slirciz"); - model = BinaryData.fromObject(model).toObject(AutomationScope.class); - Assertions.assertEquals("tcypsxjvfoim", model.description()); - Assertions.assertEquals("slirciz", model.scopePath()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationSourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationSourceTests.java deleted file mode 100644 index 7379f70c7554..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationSourceTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationRuleSet; -import com.azure.resourcemanager.security.models.AutomationSource; -import com.azure.resourcemanager.security.models.EventSource; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AutomationSourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationSource model = - BinaryData - .fromString("{\"eventSource\":\"SubAssessmentsSnapshot\",\"ruleSets\":[{\"rules\":[]},{\"rules\":[]}]}") - .toObject(AutomationSource.class); - Assertions.assertEquals(EventSource.SUB_ASSESSMENTS_SNAPSHOT, model.eventSource()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationSource model = - new AutomationSource() - .withEventSource(EventSource.SUB_ASSESSMENTS_SNAPSHOT) - .withRuleSets( - Arrays - .asList( - new AutomationRuleSet().withRules(Arrays.asList()), - new AutomationRuleSet().withRules(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(AutomationSource.class); - Assertions.assertEquals(EventSource.SUB_ASSESSMENTS_SNAPSHOT, model.eventSource()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationTriggeringRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationTriggeringRuleTests.java deleted file mode 100644 index e0d355d4af39..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationTriggeringRuleTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AutomationTriggeringRule; -import com.azure.resourcemanager.security.models.Operator; -import com.azure.resourcemanager.security.models.PropertyType; -import org.junit.jupiter.api.Assertions; - -public final class AutomationTriggeringRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationTriggeringRule model = - BinaryData - .fromString( - "{\"propertyJPath\":\"nbaeqphchqn\",\"propertyType\":\"Integer\",\"expectedValue\":\"x\",\"operator\":\"LesserThan\"}") - .toObject(AutomationTriggeringRule.class); - Assertions.assertEquals("nbaeqphchqn", model.propertyJPath()); - Assertions.assertEquals(PropertyType.INTEGER, model.propertyType()); - Assertions.assertEquals("x", model.expectedValue()); - Assertions.assertEquals(Operator.LESSER_THAN, model.operator()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationTriggeringRule model = - new AutomationTriggeringRule() - .withPropertyJPath("nbaeqphchqn") - .withPropertyType(PropertyType.INTEGER) - .withExpectedValue("x") - .withOperator(Operator.LESSER_THAN); - model = BinaryData.fromObject(model).toObject(AutomationTriggeringRule.class); - Assertions.assertEquals("nbaeqphchqn", model.propertyJPath()); - Assertions.assertEquals(PropertyType.INTEGER, model.propertyType()); - Assertions.assertEquals("x", model.expectedValue()); - Assertions.assertEquals(Operator.LESSER_THAN, model.operator()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationValidationStatusInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationValidationStatusInnerTests.java deleted file mode 100644 index aad3a0708105..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationValidationStatusInnerTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner; -import org.junit.jupiter.api.Assertions; - -public final class AutomationValidationStatusInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AutomationValidationStatusInner model = - BinaryData - .fromString("{\"isValid\":false,\"message\":\"tczheydbsdshmkx\"}") - .toObject(AutomationValidationStatusInner.class); - Assertions.assertEquals(false, model.isValid()); - Assertions.assertEquals("tczheydbsdshmkx", model.message()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AutomationValidationStatusInner model = - new AutomationValidationStatusInner().withIsValid(false).withMessage("tczheydbsdshmkx"); - model = BinaryData.fromObject(model).toObject(AutomationValidationStatusInner.class); - Assertions.assertEquals(false, model.isValid()); - Assertions.assertEquals("tczheydbsdshmkx", model.message()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 3b9776d9aa5e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Automation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutomationsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"tnp\",\"isEnabled\":true,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"rqxw\",\"tags\":{\"tfdoadtx\":\"tdrh\",\"ctkbbxuha\":\"pgehpadkmdzgsszx\"},\"id\":\"lsi\",\"name\":\"ncclabvoyngsuxxc\",\"type\":\"bmyqjog\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Automation response = - manager - .automations() - .define("e") - .withRegion("xsm") - .withExistingResourceGroup("hquhczygxvhajp") - .withTags(mapOf("ud", "pwirfljfewxqouo", "nqi", "mckaprh", "ihkkyowl", "jgencdgmoque")) - .withDescription("nwh") - .withIsEnabled(true) - .withScopes(Arrays.asList()) - .withSources(Arrays.asList()) - .withActions(Arrays.asList()) - .create(); - - Assertions.assertEquals("rqxw", response.location()); - Assertions.assertEquals("tdrh", response.tags().get("tfdoadtx")); - Assertions.assertEquals("tnp", response.description()); - Assertions.assertEquals(true, response.isEnabled()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 53a75cee395c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutomationsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .automations() - .deleteByResourceGroupWithResponse("yjmqrf", "iocuselqkr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 31ebf320dbe4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Automation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutomationsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"rhhmojusu\",\"isEnabled\":false,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"xoia\",\"tags\":{\"dxku\":\"fxwcco\",\"shavljqkx\":\"mkczynuhhoqe\",\"kgzukwdrnzkjth\":\"rqolnthbb\"},\"id\":\"ceyjnc\",\"name\":\"mlfuyfjbp\",\"type\":\"iddhlrufzc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Automation response = - manager - .automations() - .getByResourceGroupWithResponse("jjsbcmlzaahzbhur", "olk", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xoia", response.location()); - Assertions.assertEquals("fxwcco", response.tags().get("dxku")); - Assertions.assertEquals("rhhmojusu", response.description()); - Assertions.assertEquals(false, response.isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupMockTests.java deleted file mode 100644 index f9cc80cfca11..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsListByResourceGroupMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Automation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutomationsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"zboimyfpqdo\",\"isEnabled\":true,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"fvpctfji\",\"tags\":{\"vuldbkkejjk\":\"ffgkuhznw\"},\"id\":\"igaw\",\"name\":\"azmxjqi\",\"type\":\"h\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.automations().listByResourceGroup("trnzpducdaaktu", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fvpctfji", response.iterator().next().location()); - Assertions.assertEquals("ffgkuhznw", response.iterator().next().tags().get("vuldbkkejjk")); - Assertions.assertEquals("zboimyfpqdo", response.iterator().next().description()); - Assertions.assertEquals(true, response.iterator().next().isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsListMockTests.java deleted file mode 100644 index ac79e0ba8762..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsListMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Automation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutomationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"ssaekewnaze\",\"isEnabled\":true,\"scopes\":[],\"sources\":[],\"actions\":[]},\"location\":\"izyddcvxodk\",\"tags\":{\"desqlvg\":\"sxxb\",\"bygoo\":\"cpwgoljtzxnmxsd\"},\"id\":\"xqapjxvazyjfucsa\",\"name\":\"djnosdkvibf\",\"type\":\"sgm\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.automations().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("izyddcvxodk", response.iterator().next().location()); - Assertions.assertEquals("sxxb", response.iterator().next().tags().get("desqlvg")); - Assertions.assertEquals("ssaekewnaze", response.iterator().next().description()); - Assertions.assertEquals(true, response.iterator().next().isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsValidateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsValidateWithResponseMockTests.java deleted file mode 100644 index 671d430c2377..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AutomationsValidateWithResponseMockTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.fluent.models.AutomationInner; -import com.azure.resourcemanager.security.models.AutomationValidationStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AutomationsValidateWithResponseMockTests { - @Test - public void testValidateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"isValid\":false,\"message\":\"yrnskb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AutomationValidationStatus response = - manager - .automations() - .validateWithResponse( - "azrhxudd", - "mdtff", - new AutomationInner() - .withLocation("kwtjawhva") - .withTags( - mapOf("vmyolcaym", "fqqdl", "z", "chtvsnvlaqd", "othymgobl", "zawatuwqkokbc", "gwi", "msn")) - .withDescription("mrkkhmwd") - .withIsEnabled(true) - .withScopes(Arrays.asList()) - .withSources(Arrays.asList()) - .withActions(Arrays.asList()), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(false, response.isValid()); - Assertions.assertEquals("yrnskb", response.message()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwAssumeRoleAuthenticationDetailsPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwAssumeRoleAuthenticationDetailsPropertiesTests.java deleted file mode 100644 index f2620fc58bfc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwAssumeRoleAuthenticationDetailsPropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AwAssumeRoleAuthenticationDetailsProperties; -import org.junit.jupiter.api.Assertions; - -public final class AwAssumeRoleAuthenticationDetailsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AwAssumeRoleAuthenticationDetailsProperties model = - BinaryData - .fromString( - "{\"authenticationType\":\"awsAssumeRole\",\"accountId\":\"mnhjevdyzn\",\"awsAssumeRoleArn\":\"ajsvk\",\"awsExternalId\":\"kmq\",\"authenticationProvisioningState\":\"IncorrectPolicy\",\"grantedPermissions\":[\"AWS::SecurityAudit\",\"AWS::AmazonSSMAutomationRole\",\"GCP::Security" - + " Center Admin Viewer\",\"AWS::SecurityAudit\"]}") - .toObject(AwAssumeRoleAuthenticationDetailsProperties.class); - Assertions.assertEquals("ajsvk", model.awsAssumeRoleArn()); - Assertions.assertEquals("kmq", model.awsExternalId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AwAssumeRoleAuthenticationDetailsProperties model = - new AwAssumeRoleAuthenticationDetailsProperties().withAwsAssumeRoleArn("ajsvk").withAwsExternalId("kmq"); - model = BinaryData.fromObject(model).toObject(AwAssumeRoleAuthenticationDetailsProperties.class); - Assertions.assertEquals("ajsvk", model.awsAssumeRoleArn()); - Assertions.assertEquals("kmq", model.awsExternalId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsEnvironmentDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsEnvironmentDataTests.java deleted file mode 100644 index 4d072ac75096..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsEnvironmentDataTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AwsEnvironmentData; -import com.azure.resourcemanager.security.models.AwsOrganizationalData; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AwsEnvironmentDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AwsEnvironmentData model = - BinaryData - .fromString( - "{\"environmentType\":\"AwsAccount\",\"organizationalData\":{\"organizationMembershipType\":\"AwsOrganizationalData\"},\"regions\":[\"krrbhmpful\"],\"accountName\":\"efgybpmfbfununmp\"}") - .toObject(AwsEnvironmentData.class); - Assertions.assertEquals("krrbhmpful", model.regions().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AwsEnvironmentData model = - new AwsEnvironmentData() - .withOrganizationalData(new AwsOrganizationalData()) - .withRegions(Arrays.asList("krrbhmpful")); - model = BinaryData.fromObject(model).toObject(AwsEnvironmentData.class); - Assertions.assertEquals("krrbhmpful", model.regions().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataMasterTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataMasterTests.java deleted file mode 100644 index 1fc708fdd542..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataMasterTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AwsOrganizationalDataMaster; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class AwsOrganizationalDataMasterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AwsOrganizationalDataMaster model = - BinaryData - .fromString( - "{\"organizationMembershipType\":\"Organization\",\"stacksetName\":\"rvfyifkdsch\",\"excludedAccountIds\":[\"fict\",\"kjjwgcwn\",\"hbkgfyrt\",\"gm\"]}") - .toObject(AwsOrganizationalDataMaster.class); - Assertions.assertEquals("rvfyifkdsch", model.stacksetName()); - Assertions.assertEquals("fict", model.excludedAccountIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AwsOrganizationalDataMaster model = - new AwsOrganizationalDataMaster() - .withStacksetName("rvfyifkdsch") - .withExcludedAccountIds(Arrays.asList("fict", "kjjwgcwn", "hbkgfyrt", "gm")); - model = BinaryData.fromObject(model).toObject(AwsOrganizationalDataMaster.class); - Assertions.assertEquals("rvfyifkdsch", model.stacksetName()); - Assertions.assertEquals("fict", model.excludedAccountIds().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataMemberTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataMemberTests.java deleted file mode 100644 index 25187ba99e91..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataMemberTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AwsOrganizationalDataMember; -import org.junit.jupiter.api.Assertions; - -public final class AwsOrganizationalDataMemberTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AwsOrganizationalDataMember model = - BinaryData - .fromString("{\"organizationMembershipType\":\"Member\",\"parentHierarchyId\":\"j\"}") - .toObject(AwsOrganizationalDataMember.class); - Assertions.assertEquals("j", model.parentHierarchyId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AwsOrganizationalDataMember model = new AwsOrganizationalDataMember().withParentHierarchyId("j"); - model = BinaryData.fromObject(model).toObject(AwsOrganizationalDataMember.class); - Assertions.assertEquals("j", model.parentHierarchyId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataTests.java deleted file mode 100644 index 2832b96e508c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AwsOrganizationalDataTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AwsOrganizationalData; - -public final class AwsOrganizationalDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AwsOrganizationalData model = - BinaryData - .fromString("{\"organizationMembershipType\":\"AwsOrganizationalData\"}") - .toObject(AwsOrganizationalData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AwsOrganizationalData model = new AwsOrganizationalData(); - model = BinaryData.fromObject(model).toObject(AwsOrganizationalData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsScopeEnvironmentDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsScopeEnvironmentDataTests.java deleted file mode 100644 index b2306356746b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureDevOpsScopeEnvironmentDataTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AzureDevOpsScopeEnvironmentData; - -public final class AzureDevOpsScopeEnvironmentDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureDevOpsScopeEnvironmentData model = - BinaryData - .fromString("{\"environmentType\":\"AzureDevOpsScope\"}") - .toObject(AzureDevOpsScopeEnvironmentData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureDevOpsScopeEnvironmentData model = new AzureDevOpsScopeEnvironmentData(); - model = BinaryData.fromObject(model).toObject(AzureDevOpsScopeEnvironmentData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceDetailsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceDetailsTests.java deleted file mode 100644 index 705d3b3ed5aa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceDetailsTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AzureResourceDetails; - -public final class AzureResourceDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureResourceDetails model = - BinaryData.fromString("{\"source\":\"Azure\",\"id\":\"aohoqkpjtnq\"}").toObject(AzureResourceDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResourceDetails model = new AzureResourceDetails(); - model = BinaryData.fromObject(model).toObject(AzureResourceDetails.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceIdentifierTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceIdentifierTests.java deleted file mode 100644 index 1b0ad3dbb7d0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceIdentifierTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AzureResourceIdentifier; - -public final class AzureResourceIdentifierTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureResourceIdentifier model = - BinaryData - .fromString("{\"type\":\"AzureResource\",\"azureResourceId\":\"hvuqbo\"}") - .toObject(AzureResourceIdentifier.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResourceIdentifier model = new AzureResourceIdentifier(); - model = BinaryData.fromObject(model).toObject(AzureResourceIdentifier.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceLinkTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceLinkTests.java deleted file mode 100644 index 1363a09cc59c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureResourceLinkTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AzureResourceLink; - -public final class AzureResourceLinkTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureResourceLink model = - BinaryData.fromString("{\"id\":\"cbuewmrswnjlxuz\"}").toObject(AzureResourceLink.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResourceLink model = new AzureResourceLink(); - model = BinaryData.fromObject(model).toObject(AzureResourceLink.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureTrackedResourceLocationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureTrackedResourceLocationTests.java deleted file mode 100644 index 485e00c4dd5a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/AzureTrackedResourceLocationTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.AzureTrackedResourceLocation; -import org.junit.jupiter.api.Assertions; - -public final class AzureTrackedResourceLocationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureTrackedResourceLocation model = - BinaryData.fromString("{\"location\":\"ltducea\"}").toObject(AzureTrackedResourceLocation.class); - Assertions.assertEquals("ltducea", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureTrackedResourceLocation model = new AzureTrackedResourceLocation().withLocation("ltducea"); - model = BinaryData.fromObject(model).toObject(AzureTrackedResourceLocation.class); - Assertions.assertEquals("ltducea", model.location()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BaselineAdjustedResultTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BaselineAdjustedResultTests.java deleted file mode 100644 index 507760ad319e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BaselineAdjustedResultTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Baseline; -import com.azure.resourcemanager.security.models.BaselineAdjustedResult; -import com.azure.resourcemanager.security.models.RuleStatus; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BaselineAdjustedResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BaselineAdjustedResult model = - BinaryData - .fromString( - "{\"baseline\":{\"expectedResults\":[[\"mfzsbf\"],[\"rzx\",\"dew\",\"rsxkr\",\"lbjazejww\"]],\"updatedTime\":\"2021-03-06T21:39:52Z\"},\"status\":\"Finding\",\"resultsNotInBaseline\":[[\"hbrnnhjx\",\"qwjhqkbiwetpozyc\",\"qiqyhgfsetzlexbs\"],[\"e\",\"ynojpziuw\",\"bzkkd\"]],\"resultsOnlyInBaseline\":[[\"sycljsel\",\"kpbafvafhl\"],[\"lc\"],[\"evxrhyz\",\"fwrsofpltdbmair\",\"hvhfnracw\"]]}") - .toObject(BaselineAdjustedResult.class); - Assertions.assertEquals("mfzsbf", model.baseline().expectedResults().get(0).get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-06T21:39:52Z"), model.baseline().updatedTime()); - Assertions.assertEquals(RuleStatus.FINDING, model.status()); - Assertions.assertEquals("hbrnnhjx", model.resultsNotInBaseline().get(0).get(0)); - Assertions.assertEquals("sycljsel", model.resultsOnlyInBaseline().get(0).get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BaselineAdjustedResult model = - new BaselineAdjustedResult() - .withBaseline( - new Baseline() - .withExpectedResults( - Arrays.asList(Arrays.asList("mfzsbf"), Arrays.asList("rzx", "dew", "rsxkr", "lbjazejww"))) - .withUpdatedTime(OffsetDateTime.parse("2021-03-06T21:39:52Z"))) - .withStatus(RuleStatus.FINDING) - .withResultsNotInBaseline( - Arrays - .asList( - Arrays.asList("hbrnnhjx", "qwjhqkbiwetpozyc", "qiqyhgfsetzlexbs"), - Arrays.asList("e", "ynojpziuw", "bzkkd"))) - .withResultsOnlyInBaseline( - Arrays - .asList( - Arrays.asList("sycljsel", "kpbafvafhl"), - Arrays.asList("lc"), - Arrays.asList("evxrhyz", "fwrsofpltdbmair", "hvhfnracw"))); - model = BinaryData.fromObject(model).toObject(BaselineAdjustedResult.class); - Assertions.assertEquals("mfzsbf", model.baseline().expectedResults().get(0).get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-06T21:39:52Z"), model.baseline().updatedTime()); - Assertions.assertEquals(RuleStatus.FINDING, model.status()); - Assertions.assertEquals("hbrnnhjx", model.resultsNotInBaseline().get(0).get(0)); - Assertions.assertEquals("sycljsel", model.resultsOnlyInBaseline().get(0).get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BaselineTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BaselineTests.java deleted file mode 100644 index 44a63e1b7e6e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BaselineTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Baseline; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BaselineTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Baseline model = - BinaryData - .fromString( - "{\"expectedResults\":[[\"g\",\"uuj\"],[\"uhd\",\"wsigrbjbxsj\",\"bvitvqkjya\"],[\"umtggmuwdchozfn\"],[\"exlvxnoakiz\"]],\"updatedTime\":\"2021-02-16T18:23:50Z\"}") - .toObject(Baseline.class); - Assertions.assertEquals("g", model.expectedResults().get(0).get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-16T18:23:50Z"), model.updatedTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Baseline model = - new Baseline() - .withExpectedResults( - Arrays - .asList( - Arrays.asList("g", "uuj"), - Arrays.asList("uhd", "wsigrbjbxsj", "bvitvqkjya"), - Arrays.asList("umtggmuwdchozfn"), - Arrays.asList("exlvxnoakiz"))) - .withUpdatedTime(OffsetDateTime.parse("2021-02-16T18:23:50Z")); - model = BinaryData.fromObject(model).toObject(Baseline.class); - Assertions.assertEquals("g", model.expectedResults().get(0).get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-16T18:23:50Z"), model.updatedTime()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BenchmarkReferenceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BenchmarkReferenceTests.java deleted file mode 100644 index 369304ea61ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/BenchmarkReferenceTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.BenchmarkReference; -import org.junit.jupiter.api.Assertions; - -public final class BenchmarkReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - BenchmarkReference model = - BinaryData - .fromString("{\"benchmark\":\"vovjufycsjmlbe\",\"reference\":\"ej\"}") - .toObject(BenchmarkReference.class); - Assertions.assertEquals("vovjufycsjmlbe", model.benchmark()); - Assertions.assertEquals("ej", model.reference()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - BenchmarkReference model = new BenchmarkReference().withBenchmark("vovjufycsjmlbe").withReference("ej"); - model = BinaryData.fromObject(model).toObject(BenchmarkReference.class); - Assertions.assertEquals("vovjufycsjmlbe", model.benchmark()); - Assertions.assertEquals("ej", model.reference()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CefExternalSecuritySolutionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CefExternalSecuritySolutionTests.java deleted file mode 100644 index c79cf40c25e9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CefExternalSecuritySolutionTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CefExternalSecuritySolution; -import com.azure.resourcemanager.security.models.CefSolutionProperties; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class CefExternalSecuritySolutionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CefExternalSecuritySolution model = - BinaryData - .fromString( - "{\"kind\":\"CEF\",\"properties\":{\"hostname\":\"qacdmkxwxdcvjwcy\",\"agent\":\"akeciqchx\",\"lastEventReceived\":\"uicdsiwdfmmpzhzz\",\"deviceVendor\":\"ywrgyngydgr\",\"deviceType\":\"n\",\"workspace\":{\"id\":\"iqao\"},\"\":{\"lvlmfej\":\"datarkclamg\"}},\"location\":\"qey\",\"id\":\"gltygxhqfgq\",\"name\":\"ayejsxtlgflwfgz\",\"type\":\"iucijjcea\"}") - .toObject(CefExternalSecuritySolution.class); - Assertions.assertEquals("ywrgyngydgr", model.properties().deviceVendor()); - Assertions.assertEquals("n", model.properties().deviceType()); - Assertions.assertEquals("iqao", model.properties().workspace().id()); - Assertions.assertEquals("qacdmkxwxdcvjwcy", model.properties().hostname()); - Assertions.assertEquals("akeciqchx", model.properties().agent()); - Assertions.assertEquals("uicdsiwdfmmpzhzz", model.properties().lastEventReceived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CefExternalSecuritySolution model = - new CefExternalSecuritySolution() - .withProperties( - new CefSolutionProperties() - .withDeviceVendor("ywrgyngydgr") - .withDeviceType("n") - .withWorkspace(new ConnectedWorkspace().withId("iqao")) - .withHostname("qacdmkxwxdcvjwcy") - .withAgent("akeciqchx") - .withLastEventReceived("uicdsiwdfmmpzhzz")); - model = BinaryData.fromObject(model).toObject(CefExternalSecuritySolution.class); - Assertions.assertEquals("ywrgyngydgr", model.properties().deviceVendor()); - Assertions.assertEquals("n", model.properties().deviceType()); - Assertions.assertEquals("iqao", model.properties().workspace().id()); - Assertions.assertEquals("qacdmkxwxdcvjwcy", model.properties().hostname()); - Assertions.assertEquals("akeciqchx", model.properties().agent()); - Assertions.assertEquals("uicdsiwdfmmpzhzz", model.properties().lastEventReceived()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CefSolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CefSolutionPropertiesTests.java deleted file mode 100644 index 5689d605f546..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CefSolutionPropertiesTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CefSolutionProperties; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class CefSolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CefSolutionProperties model = - BinaryData - .fromString( - "{\"hostname\":\"ijjj\",\"agent\":\"va\",\"lastEventReceived\":\"a\",\"deviceVendor\":\"knxkvccxetyvkunm\",\"deviceType\":\"nohikkgq\",\"workspace\":{\"id\":\"wpin\"},\"\":{\"hmedeilbjywfcfxz\":\"datavabbx\",\"vjslczwcii\":\"datarzzihvwypus\",\"vxadqacfrgnawbab\":\"datajsllfryvd\",\"yq\":\"datafbktyjmfczlf\"}}") - .toObject(CefSolutionProperties.class); - Assertions.assertEquals("knxkvccxetyvkunm", model.deviceVendor()); - Assertions.assertEquals("nohikkgq", model.deviceType()); - Assertions.assertEquals("wpin", model.workspace().id()); - Assertions.assertEquals("ijjj", model.hostname()); - Assertions.assertEquals("va", model.agent()); - Assertions.assertEquals("a", model.lastEventReceived()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CefSolutionProperties model = - new CefSolutionProperties() - .withDeviceVendor("knxkvccxetyvkunm") - .withDeviceType("nohikkgq") - .withWorkspace(new ConnectedWorkspace().withId("wpin")) - .withHostname("ijjj") - .withAgent("va") - .withLastEventReceived("a"); - model = BinaryData.fromObject(model).toObject(CefSolutionProperties.class); - Assertions.assertEquals("knxkvccxetyvkunm", model.deviceVendor()); - Assertions.assertEquals("nohikkgq", model.deviceType()); - Assertions.assertEquals("wpin", model.workspace().id()); - Assertions.assertEquals("ijjj", model.hostname()); - Assertions.assertEquals("va", model.agent()); - Assertions.assertEquals("a", model.lastEventReceived()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CloudOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CloudOfferingTests.java deleted file mode 100644 index b0a117bca27e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CloudOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CloudOffering; - -public final class CloudOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CloudOffering model = - BinaryData - .fromString("{\"offeringType\":\"CloudOffering\",\"description\":\"ivjreuyk\"}") - .toObject(CloudOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CloudOffering model = new CloudOffering(); - model = BinaryData.fromObject(model).toObject(CloudOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceInnerTests.java deleted file mode 100644 index 0543972aa28a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; - -public final class ComplianceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComplianceInner model = - BinaryData - .fromString( - "{\"properties\":{\"assessmentTimestampUtcDate\":\"2021-08-15T01:34:53Z\",\"resourceCount\":207967373,\"assessmentResult\":[{\"segmentType\":\"dpfrxtrthzvaytdw\",\"percentage\":34.16180582030333},{\"segmentType\":\"ubpaxhe\",\"percentage\":1.5196984611925868}]},\"id\":\"ivpdtiir\",\"name\":\"tdqoaxoruzfgsq\",\"type\":\"yfxrx\"}") - .toObject(ComplianceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComplianceInner model = new ComplianceInner(); - model = BinaryData.fromObject(model).toObject(ComplianceInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceListTests.java deleted file mode 100644 index 0209720593c4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceListTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ComplianceInner; -import com.azure.resourcemanager.security.models.ComplianceList; -import java.util.Arrays; - -public final class ComplianceListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComplianceList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"assessmentTimestampUtcDate\":\"2021-08-25T09:33:34Z\",\"resourceCount\":624778524,\"assessmentResult\":[]},\"id\":\"bqfatpxllrxcyjmo\",\"name\":\"dsuvarmywdmjsjqb\",\"type\":\"hhyxxrw\"},{\"properties\":{\"assessmentTimestampUtcDate\":\"2021-02-04T08:50:40Z\",\"resourceCount\":803302222,\"assessmentResult\":[]},\"id\":\"p\",\"name\":\"xkgymareqnajxqu\",\"type\":\"jhkycub\"},{\"properties\":{\"assessmentTimestampUtcDate\":\"2021-03-22T14:35:21Z\",\"resourceCount\":2056337569,\"assessmentResult\":[]},\"id\":\"fwqmzqalkrmn\",\"name\":\"i\",\"type\":\"pxacqqudfn\"},{\"properties\":{\"assessmentTimestampUtcDate\":\"2021-06-13T18:20:41Z\",\"resourceCount\":1365725065,\"assessmentResult\":[]},\"id\":\"bjyvay\",\"name\":\"fimrzrtuzqogse\",\"type\":\"nevfdnw\"}],\"nextLink\":\"mewzsyyc\"}") - .toObject(ComplianceList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComplianceList model = - new ComplianceList() - .withValue( - Arrays - .asList( - new ComplianceInner(), - new ComplianceInner(), - new ComplianceInner(), - new ComplianceInner())); - model = BinaryData.fromObject(model).toObject(ComplianceList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancePropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancePropertiesTests.java deleted file mode 100644 index 421d502a6a5c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ComplianceProperties; - -public final class CompliancePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComplianceProperties model = - BinaryData - .fromString( - "{\"assessmentTimestampUtcDate\":\"2021-11-22T21:44:45Z\",\"resourceCount\":2043686923,\"assessmentResult\":[{\"segmentType\":\"xje\",\"percentage\":84.10933716066732},{\"segmentType\":\"wxuqlcvydypatdoo\",\"percentage\":48.53263087805991},{\"segmentType\":\"iodkooebwnujhem\",\"percentage\":70.84255746706634}]}") - .toObject(ComplianceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComplianceProperties model = new ComplianceProperties(); - model = BinaryData.fromObject(model).toObject(ComplianceProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultInnerTests.java deleted file mode 100644 index 16b9ae57355e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ComplianceResultInner; - -public final class ComplianceResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComplianceResultInner model = - BinaryData - .fromString( - "{\"properties\":{\"resourceStatus\":\"NotApplicable\"},\"id\":\"jdous\",\"name\":\"cqvkocrcjdkwtn\",\"type\":\"xbnjbiksq\"}") - .toObject(ComplianceResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComplianceResultInner model = new ComplianceResultInner(); - model = BinaryData.fromObject(model).toObject(ComplianceResultInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultListTests.java deleted file mode 100644 index a44d8e55a67e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultListTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ComplianceResultInner; -import com.azure.resourcemanager.security.models.ComplianceResultList; -import java.util.Arrays; - -public final class ComplianceResultListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComplianceResultList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"resourceStatus\":\"Healthy\"},\"id\":\"rnfygxgispem\",\"name\":\"tzfkufubl\",\"type\":\"ofx\"},{\"properties\":{\"resourceStatus\":\"NotApplicable\"},\"id\":\"jaeq\",\"name\":\"hqjbasvmsmj\",\"type\":\"ulngsntn\"}],\"nextLink\":\"bkzgcwrwclx\"}") - .toObject(ComplianceResultList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComplianceResultList model = - new ComplianceResultList() - .withValue(Arrays.asList(new ComplianceResultInner(), new ComplianceResultInner())); - model = BinaryData.fromObject(model).toObject(ComplianceResultList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultPropertiesTests.java deleted file mode 100644 index 2d0a41a99328..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultPropertiesTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ComplianceResultProperties; - -public final class ComplianceResultPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComplianceResultProperties model = - BinaryData.fromString("{\"resourceStatus\":\"NotApplicable\"}").toObject(ComplianceResultProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComplianceResultProperties model = new ComplianceResultProperties(); - model = BinaryData.fromObject(model).toObject(ComplianceResultProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetWithResponseMockTests.java deleted file mode 100644 index f0c78f2efeb6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ComplianceResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComplianceResultsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"resourceStatus\":\"Healthy\"},\"id\":\"admskx\",\"name\":\"npd\",\"type\":\"zigjsugswhgsaodk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ComplianceResult response = - manager.complianceResults().getWithResponse("bv", "ipbwxgooo", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultsListMockTests.java deleted file mode 100644 index 0584266705b7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceResultsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ComplianceResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ComplianceResultsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"resourceStatus\":\"NotHealthy\"},\"id\":\"jh\",\"name\":\"cl\",\"type\":\"iedfsbwcei\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.complianceResults().list("jdiq", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceSegmentTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceSegmentTests.java deleted file mode 100644 index d31b157d0059..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ComplianceSegmentTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ComplianceSegment; - -public final class ComplianceSegmentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ComplianceSegment model = - BinaryData - .fromString("{\"segmentType\":\"kcrodtjinfw\",\"percentage\":48.601111864993506}") - .toObject(ComplianceSegment.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ComplianceSegment model = new ComplianceSegment(); - model = BinaryData.fromObject(model).toObject(ComplianceSegment.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancesGetWithResponseMockTests.java deleted file mode 100644 index 5736ac319472..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancesGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Compliance; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CompliancesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"assessmentTimestampUtcDate\":\"2021-04-20T11:58:39Z\",\"resourceCount\":583631661,\"assessmentResult\":[]},\"id\":\"tesubzpvp\",\"name\":\"dylytcovq\",\"type\":\"eu\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Compliance response = - manager.compliances().getWithResponse("iswxspv", "koj", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancesListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancesListMockTests.java deleted file mode 100644 index da2afc0150a2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CompliancesListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Compliance; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CompliancesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"assessmentTimestampUtcDate\":\"2021-01-17T17:15:03Z\",\"resourceCount\":563449519,\"assessmentResult\":[]},\"id\":\"ygysemtme\",\"name\":\"rf\",\"type\":\"vpinkzpatqt\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.compliances().list("axikhfjqebglcxk", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectableResourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectableResourceTests.java deleted file mode 100644 index 2918460962da..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectableResourceTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConnectableResource; - -public final class ConnectableResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectableResource model = - BinaryData - .fromString( - "{\"id\":\"lsismjqfrd\",\"inboundConnectedResources\":[{\"connectedResourceId\":\"quhiosrsjuivf\",\"tcpPorts\":\"is\",\"udpPorts\":\"rnxzh\"}],\"outboundConnectedResources\":[{\"connectedResourceId\":\"rxzbujr\",\"tcpPorts\":\"hqvwrevkhgnlnzon\",\"udpPorts\":\"rpiqywncv\"},{\"connectedResourceId\":\"szcofizeht\",\"tcpPorts\":\"gbjkvreljeamur\",\"udpPorts\":\"mlovuanashcxl\"},{\"connectedResourceId\":\"jerbdkelvidizozs\",\"tcpPorts\":\"ccxjm\",\"udpPorts\":\"fdgnwncypuuwwlt\"},{\"connectedResourceId\":\"qjctzenkeif\",\"tcpPorts\":\"hmkdasvfl\",\"udpPorts\":\"bxcudchx\"}]}") - .toObject(ConnectableResource.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectableResource model = new ConnectableResource(); - model = BinaryData.fromObject(model).toObject(ConnectableResource.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectedResourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectedResourceTests.java deleted file mode 100644 index 01ee1f296ed7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectedResourceTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConnectedResource; - -public final class ConnectedResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectedResource model = - BinaryData - .fromString("{\"connectedResourceId\":\"rb\",\"tcpPorts\":\"d\",\"udpPorts\":\"robwjlvizbfhf\"}") - .toObject(ConnectedResource.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectedResource model = new ConnectedResource(); - model = BinaryData.fromObject(model).toObject(ConnectedResource.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectedWorkspaceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectedWorkspaceTests.java deleted file mode 100644 index ccdd9758e538..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectedWorkspaceTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import org.junit.jupiter.api.Assertions; - -public final class ConnectedWorkspaceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectedWorkspace model = - BinaryData.fromString("{\"id\":\"jfqipubyznclkfk\"}").toObject(ConnectedWorkspace.class); - Assertions.assertEquals("jfqipubyznclkfk", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectedWorkspace model = new ConnectedWorkspace().withId("jfqipubyznclkfk"); - model = BinaryData.fromObject(model).toObject(ConnectedWorkspace.class); - Assertions.assertEquals("jfqipubyznclkfk", model.id()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionFromIpNotAllowedTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionFromIpNotAllowedTests.java deleted file mode 100644 index 9352ba73c99d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionFromIpNotAllowedTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConnectionFromIpNotAllowed; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ConnectionFromIpNotAllowedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectionFromIpNotAllowed model = - BinaryData - .fromString( - "{\"ruleType\":\"ConnectionFromIpNotAllowed\",\"allowlistValues\":[\"wreswmowegm\",\"uteyxeyguq\"],\"valueType\":\"IpCidr\",\"displayName\":\"ii\",\"description\":\"spxlzde\",\"isEnabled\":false}") - .toObject(ConnectionFromIpNotAllowed.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("wreswmowegm", model.allowlistValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectionFromIpNotAllowed model = - new ConnectionFromIpNotAllowed() - .withIsEnabled(false) - .withAllowlistValues(Arrays.asList("wreswmowegm", "uteyxeyguq")); - model = BinaryData.fromObject(model).toObject(ConnectionFromIpNotAllowed.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("wreswmowegm", model.allowlistValues().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionStringsInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionStringsInnerTests.java deleted file mode 100644 index 3ff0385b3852..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionStringsInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ConnectionStringsInner; -import com.azure.resourcemanager.security.models.IngestionConnectionString; -import java.util.Arrays; - -public final class ConnectionStringsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectionStringsInner model = - BinaryData - .fromString( - "{\"value\":[{\"location\":\"qd\",\"value\":\"jgwdtgukranbl\"},{\"location\":\"hqlkccuzgygqwaho\",\"value\":\"lwgniiprglvawu\"}]}") - .toObject(ConnectionStringsInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectionStringsInner model = - new ConnectionStringsInner() - .withValue(Arrays.asList(new IngestionConnectionString(), new IngestionConnectionString())); - model = BinaryData.fromObject(model).toObject(ConnectionStringsInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionToIpNotAllowedTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionToIpNotAllowedTests.java deleted file mode 100644 index 57660875cbd1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectionToIpNotAllowedTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConnectionToIpNotAllowed; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ConnectionToIpNotAllowedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectionToIpNotAllowed model = - BinaryData - .fromString( - "{\"ruleType\":\"ConnectionToIpNotAllowed\",\"allowlistValues\":[\"qrkuor\",\"tssruqnmdvhazc\",\"jy\"],\"valueType\":\"String\",\"displayName\":\"wbqerzwxiytxtd\",\"description\":\"kvlbpktgdstyoua\",\"isEnabled\":true}") - .toObject(ConnectionToIpNotAllowed.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("qrkuor", model.allowlistValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectionToIpNotAllowed model = - new ConnectionToIpNotAllowed() - .withIsEnabled(true) - .withAllowlistValues(Arrays.asList("qrkuor", "tssruqnmdvhazc", "jy")); - model = BinaryData.fromObject(model).toObject(ConnectionToIpNotAllowed.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("qrkuor", model.allowlistValues().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingInnerTests.java deleted file mode 100644 index fc22fd5efea8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; -import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; -import org.junit.jupiter.api.Assertions; - -public final class ConnectorSettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectorSettingInner model = - BinaryData - .fromString( - "{\"properties\":{\"hybridComputeSettings\":{\"hybridComputeProvisioningState\":\"Invalid\",\"autoProvision\":\"Off\",\"resourceGroupName\":\"enl\",\"region\":\"htkln\"},\"authenticationDetails\":{\"authenticationType\":\"AuthenticationDetailsProperties\",\"authenticationProvisioningState\":\"IncorrectPolicy\",\"grantedPermissions\":[\"AWS::AWSSecurityHubReadOnlyAccess\",\"AWS::AWSSecurityHubReadOnlyAccess\",\"AWS::SecurityAudit\"]}},\"id\":\"ev\",\"name\":\"bo\",\"type\":\"lcqxypokk\"}") - .toObject(ConnectorSettingInner.class); - Assertions.assertEquals(AutoProvision.OFF, model.hybridComputeSettings().autoProvision()); - Assertions.assertEquals("enl", model.hybridComputeSettings().resourceGroupName()); - Assertions.assertEquals("htkln", model.hybridComputeSettings().region()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectorSettingInner model = - new ConnectorSettingInner() - .withHybridComputeSettings( - new HybridComputeSettingsProperties() - .withAutoProvision(AutoProvision.OFF) - .withResourceGroupName("enl") - .withRegion("htkln")) - .withAuthenticationDetails(new AuthenticationDetailsProperties()); - model = BinaryData.fromObject(model).toObject(ConnectorSettingInner.class); - Assertions.assertEquals(AutoProvision.OFF, model.hybridComputeSettings().autoProvision()); - Assertions.assertEquals("enl", model.hybridComputeSettings().resourceGroupName()); - Assertions.assertEquals("htkln", model.hybridComputeSettings().region()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingListTests.java deleted file mode 100644 index 069f35ab6d3d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorSettingListTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ConnectorSettingInner; -import com.azure.resourcemanager.security.models.ConnectorSettingList; -import java.util.Arrays; - -public final class ConnectorSettingListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ConnectorSettingList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{},\"id\":\"kzmkwklsnoxaxmqe\",\"name\":\"alhhjnhgwydyynfs\",\"type\":\"khgb\"},{\"properties\":{},\"id\":\"narfdlpukhpyrn\",\"name\":\"izjcpeog\",\"type\":\"hnmgbroux\"},{\"properties\":{},\"id\":\"fhp\",\"name\":\"paz\",\"type\":\"zoyw\"},{\"properties\":{},\"id\":\"dulontacn\",\"name\":\"qwtehtuevr\",\"type\":\"rljyoogwxhnsdu\"}],\"nextLink\":\"wbsreur\"}") - .toObject(ConnectorSettingList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ConnectorSettingList model = - new ConnectorSettingList() - .withValue( - Arrays - .asList( - new ConnectorSettingInner(), - new ConnectorSettingInner(), - new ConnectorSettingInner(), - new ConnectorSettingInner())); - model = BinaryData.fromObject(model).toObject(ConnectorSettingList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index a0d0fec01fca..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AuthenticationDetailsProperties; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.ConnectorSetting; -import com.azure.resourcemanager.security.models.HybridComputeSettingsProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConnectorsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"hybridComputeSettings\":{\"hybridComputeProvisioningState\":\"Invalid\",\"autoProvision\":\"On\",\"resourceGroupName\":\"rwtrdgscnvqeonsg\",\"region\":\"xlw\"},\"authenticationDetails\":{\"authenticationType\":\"AuthenticationDetailsProperties\",\"authenticationProvisioningState\":\"Expired\",\"grantedPermissions\":[]}},\"id\":\"pthceopvkv\",\"name\":\"wfvesobpbok\",\"type\":\"mmlcdyarng\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConnectorSetting response = - manager - .connectors() - .define("jermhzic") - .withHybridComputeSettings( - new HybridComputeSettingsProperties() - .withAutoProvision(AutoProvision.OFF) - .withResourceGroupName("aaknyukibxig") - .withRegion("phzwxqte")) - .withAuthenticationDetails(new AuthenticationDetailsProperties()) - .create(); - - Assertions.assertEquals(AutoProvision.ON, response.hybridComputeSettings().autoProvision()); - Assertions.assertEquals("rwtrdgscnvqeonsg", response.hybridComputeSettings().resourceGroupName()); - Assertions.assertEquals("xlw", response.hybridComputeSettings().region()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteWithResponseMockTests.java deleted file mode 100644 index 82fc4ab6f635..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConnectorsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.connectors().deleteWithResponse("dueurgmcdcpkshl", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsGetWithResponseMockTests.java deleted file mode 100644 index 8433202342fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.ConnectorSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConnectorsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"hybridComputeSettings\":{\"hybridComputeProvisioningState\":\"Invalid\",\"autoProvision\":\"On\",\"resourceGroupName\":\"dh\",\"region\":\"ojvlirknucosaw\"},\"authenticationDetails\":{\"authenticationType\":\"AuthenticationDetailsProperties\",\"authenticationProvisioningState\":\"Expired\",\"grantedPermissions\":[]}},\"id\":\"lgpyaixihz\",\"name\":\"jjtsm\",\"type\":\"ydqfttkacy\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConnectorSetting response = - manager.connectors().getWithResponse("d", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(AutoProvision.ON, response.hybridComputeSettings().autoProvision()); - Assertions.assertEquals("dh", response.hybridComputeSettings().resourceGroupName()); - Assertions.assertEquals("ojvlirknucosaw", response.hybridComputeSettings().region()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsListMockTests.java deleted file mode 100644 index f2e3152f106a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ConnectorsListMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AutoProvision; -import com.azure.resourcemanager.security.models.ConnectorSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ConnectorsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"hybridComputeSettings\":{\"hybridComputeProvisioningState\":\"Invalid\",\"autoProvision\":\"Off\",\"resourceGroupName\":\"hwynct\",\"region\":\"zcnjfmbbfnvjxit\"},\"authenticationDetails\":{\"authenticationType\":\"AuthenticationDetailsProperties\",\"authenticationProvisioningState\":\"IncorrectPolicy\",\"grantedPermissions\":[]}},\"id\":\"iklsmni\",\"name\":\"qlcoqksyiibhyx\",\"type\":\"bgbudav\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.connectors().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals(AutoProvision.OFF, response.iterator().next().hybridComputeSettings().autoProvision()); - Assertions.assertEquals("hwynct", response.iterator().next().hybridComputeSettings().resourceGroupName()); - Assertions.assertEquals("zcnjfmbbfnvjxit", response.iterator().next().hybridComputeSettings().region()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ContainerRegistryVulnerabilityPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ContainerRegistryVulnerabilityPropertiesTests.java deleted file mode 100644 index f5cfff70aac5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ContainerRegistryVulnerabilityPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ContainerRegistryVulnerabilityProperties; - -public final class ContainerRegistryVulnerabilityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ContainerRegistryVulnerabilityProperties model = - BinaryData - .fromString( - "{\"assessedResourceType\":\"ContainerRegistryVulnerability\",\"type\":\"x\",\"cvss\":{\"pcpahprzrvxhmtf\":{\"base\":17.635876},\"nxzcm\":{\"base\":39.96614},\"gxnoqrxtdis\":{\"base\":25.372917}},\"patchable\":true,\"cve\":[{\"title\":\"lmydidwhep\",\"link\":\"wtj\"},{\"title\":\"o\",\"link\":\"xxhmwcdbc\"},{\"title\":\"oikxkxhnegk\",\"link\":\"z\"}],\"publishedTime\":\"2021-11-05T00:07:59Z\",\"vendorReferences\":[{\"title\":\"plvukaobrlbpg\",\"link\":\"bagn\"}],\"repositoryName\":\"jhgem\",\"imageDigest\":\"wakywalhjymxcgq\"}") - .toObject(ContainerRegistryVulnerabilityProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ContainerRegistryVulnerabilityProperties model = new ContainerRegistryVulnerabilityProperties(); - model = BinaryData.fromObject(model).toObject(ContainerRegistryVulnerabilityProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAwsOfferingNativeCloudConnectionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAwsOfferingNativeCloudConnectionTests.java deleted file mode 100644 index c514e225301b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAwsOfferingNativeCloudConnectionTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CspmMonitorAwsOfferingNativeCloudConnection; -import org.junit.jupiter.api.Assertions; - -public final class CspmMonitorAwsOfferingNativeCloudConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CspmMonitorAwsOfferingNativeCloudConnection model = - BinaryData - .fromString("{\"cloudRoleArn\":\"jhqxc\"}") - .toObject(CspmMonitorAwsOfferingNativeCloudConnection.class); - Assertions.assertEquals("jhqxc", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CspmMonitorAwsOfferingNativeCloudConnection model = - new CspmMonitorAwsOfferingNativeCloudConnection().withCloudRoleArn("jhqxc"); - model = BinaryData.fromObject(model).toObject(CspmMonitorAwsOfferingNativeCloudConnection.class); - Assertions.assertEquals("jhqxc", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAwsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAwsOfferingTests.java deleted file mode 100644 index 3c899ba293db..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAwsOfferingTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CspmMonitorAwsOffering; -import com.azure.resourcemanager.security.models.CspmMonitorAwsOfferingNativeCloudConnection; -import org.junit.jupiter.api.Assertions; - -public final class CspmMonitorAwsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CspmMonitorAwsOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"CspmMonitorAws\",\"nativeCloudConnection\":{\"cloudRoleArn\":\"krmukmyjmkxett\"},\"description\":\"lojfkqidnqto\"}") - .toObject(CspmMonitorAwsOffering.class); - Assertions.assertEquals("krmukmyjmkxett", model.nativeCloudConnection().cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CspmMonitorAwsOffering model = - new CspmMonitorAwsOffering() - .withNativeCloudConnection( - new CspmMonitorAwsOfferingNativeCloudConnection().withCloudRoleArn("krmukmyjmkxett")); - model = BinaryData.fromObject(model).toObject(CspmMonitorAwsOffering.class); - Assertions.assertEquals("krmukmyjmkxett", model.nativeCloudConnection().cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAzureDevOpsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAzureDevOpsOfferingTests.java deleted file mode 100644 index b42823f93d69..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorAzureDevOpsOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CspmMonitorAzureDevOpsOffering; - -public final class CspmMonitorAzureDevOpsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CspmMonitorAzureDevOpsOffering model = - BinaryData - .fromString("{\"offeringType\":\"CspmMonitorAzureDevOps\",\"description\":\"ytjlkesmmpath\"}") - .toObject(CspmMonitorAzureDevOpsOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CspmMonitorAzureDevOpsOffering model = new CspmMonitorAzureDevOpsOffering(); - model = BinaryData.fromObject(model).toObject(CspmMonitorAzureDevOpsOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGcpOfferingNativeCloudConnectionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGcpOfferingNativeCloudConnectionTests.java deleted file mode 100644 index 77bb8cf1ca39..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGcpOfferingNativeCloudConnectionTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CspmMonitorGcpOfferingNativeCloudConnection; -import org.junit.jupiter.api.Assertions; - -public final class CspmMonitorGcpOfferingNativeCloudConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CspmMonitorGcpOfferingNativeCloudConnection model = - BinaryData - .fromString("{\"workloadIdentityProviderId\":\"wjrkb\",\"serviceAccountEmailAddress\":\"jhbtqq\"}") - .toObject(CspmMonitorGcpOfferingNativeCloudConnection.class); - Assertions.assertEquals("wjrkb", model.workloadIdentityProviderId()); - Assertions.assertEquals("jhbtqq", model.serviceAccountEmailAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CspmMonitorGcpOfferingNativeCloudConnection model = - new CspmMonitorGcpOfferingNativeCloudConnection() - .withWorkloadIdentityProviderId("wjrkb") - .withServiceAccountEmailAddress("jhbtqq"); - model = BinaryData.fromObject(model).toObject(CspmMonitorGcpOfferingNativeCloudConnection.class); - Assertions.assertEquals("wjrkb", model.workloadIdentityProviderId()); - Assertions.assertEquals("jhbtqq", model.serviceAccountEmailAddress()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGcpOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGcpOfferingTests.java deleted file mode 100644 index f6fad2a36ce2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGcpOfferingTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CspmMonitorGcpOffering; -import com.azure.resourcemanager.security.models.CspmMonitorGcpOfferingNativeCloudConnection; -import org.junit.jupiter.api.Assertions; - -public final class CspmMonitorGcpOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CspmMonitorGcpOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"CspmMonitorGcp\",\"nativeCloudConnection\":{\"workloadIdentityProviderId\":\"nqimwbzxpdcldp\",\"serviceAccountEmailAddress\":\"wnsnlaimouxwks\"},\"description\":\"udmfcoibiczius\"}") - .toObject(CspmMonitorGcpOffering.class); - Assertions.assertEquals("nqimwbzxpdcldp", model.nativeCloudConnection().workloadIdentityProviderId()); - Assertions.assertEquals("wnsnlaimouxwks", model.nativeCloudConnection().serviceAccountEmailAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CspmMonitorGcpOffering model = - new CspmMonitorGcpOffering() - .withNativeCloudConnection( - new CspmMonitorGcpOfferingNativeCloudConnection() - .withWorkloadIdentityProviderId("nqimwbzxpdcldp") - .withServiceAccountEmailAddress("wnsnlaimouxwks")); - model = BinaryData.fromObject(model).toObject(CspmMonitorGcpOffering.class); - Assertions.assertEquals("nqimwbzxpdcldp", model.nativeCloudConnection().workloadIdentityProviderId()); - Assertions.assertEquals("wnsnlaimouxwks", model.nativeCloudConnection().serviceAccountEmailAddress()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGitLabOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGitLabOfferingTests.java deleted file mode 100644 index 823a7e3cd728..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGitLabOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CspmMonitorGitLabOffering; - -public final class CspmMonitorGitLabOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CspmMonitorGitLabOffering model = - BinaryData - .fromString("{\"offeringType\":\"CspmMonitorGitLab\",\"description\":\"vnmdyfoeboj\"}") - .toObject(CspmMonitorGitLabOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CspmMonitorGitLabOffering model = new CspmMonitorGitLabOffering(); - model = BinaryData.fromObject(model).toObject(CspmMonitorGitLabOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGithubOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGithubOfferingTests.java deleted file mode 100644 index 9f2583b961f0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CspmMonitorGithubOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CspmMonitorGithubOffering; - -public final class CspmMonitorGithubOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CspmMonitorGithubOffering model = - BinaryData - .fromString("{\"offeringType\":\"CspmMonitorGithub\",\"description\":\"bdbfgrlp\"}") - .toObject(CspmMonitorGithubOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CspmMonitorGithubOffering model = new CspmMonitorGithubOffering(); - model = BinaryData.fromObject(model).toObject(CspmMonitorGithubOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAlertRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAlertRuleTests.java deleted file mode 100644 index 77399c4efa87..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAlertRuleTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CustomAlertRule; -import org.junit.jupiter.api.Assertions; - -public final class CustomAlertRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomAlertRule model = - BinaryData - .fromString( - "{\"ruleType\":\"CustomAlertRule\",\"displayName\":\"gqywgndrv\",\"description\":\"hzgpphrcgyncocpe\",\"isEnabled\":false}") - .toObject(CustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomAlertRule model = new CustomAlertRule().withIsEnabled(false); - model = BinaryData.fromObject(model).toObject(CustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationRequestPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationRequestPropertiesTests.java deleted file mode 100644 index aa455a49be3f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationRequestPropertiesTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.CustomAssessmentAutomationRequestProperties; -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; -import org.junit.jupiter.api.Assertions; - -public final class CustomAssessmentAutomationRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomAssessmentAutomationRequestProperties model = - BinaryData - .fromString( - "{\"compressedQuery\":\"cbjy\",\"supportedCloud\":\"AWS\",\"severity\":\"Low\",\"displayName\":\"xqhabi\",\"description\":\"ikxwc\",\"remediationDescription\":\"yscnpqxu\"}") - .toObject(CustomAssessmentAutomationRequestProperties.class); - Assertions.assertEquals("cbjy", model.compressedQuery()); - Assertions.assertEquals(SupportedCloudEnum.AWS, model.supportedCloud()); - Assertions.assertEquals(SeverityEnum.LOW, model.severity()); - Assertions.assertEquals("xqhabi", model.displayName()); - Assertions.assertEquals("ikxwc", model.description()); - Assertions.assertEquals("yscnpqxu", model.remediationDescription()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomAssessmentAutomationRequestProperties model = - new CustomAssessmentAutomationRequestProperties() - .withCompressedQuery("cbjy") - .withSupportedCloud(SupportedCloudEnum.AWS) - .withSeverity(SeverityEnum.LOW) - .withDisplayName("xqhabi") - .withDescription("ikxwc") - .withRemediationDescription("yscnpqxu"); - model = BinaryData.fromObject(model).toObject(CustomAssessmentAutomationRequestProperties.class); - Assertions.assertEquals("cbjy", model.compressedQuery()); - Assertions.assertEquals(SupportedCloudEnum.AWS, model.supportedCloud()); - Assertions.assertEquals(SeverityEnum.LOW, model.severity()); - Assertions.assertEquals("xqhabi", model.displayName()); - Assertions.assertEquals("ikxwc", model.description()); - Assertions.assertEquals("yscnpqxu", model.remediationDescription()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationRequestTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationRequestTests.java deleted file mode 100644 index 1ba48761ba0d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationRequestTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CustomAssessmentAutomationRequest; -import com.azure.resourcemanager.security.models.SeverityEnum; -import com.azure.resourcemanager.security.models.SupportedCloudEnum; -import org.junit.jupiter.api.Assertions; - -public final class CustomAssessmentAutomationRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomAssessmentAutomationRequest model = - BinaryData - .fromString( - "{\"properties\":{\"compressedQuery\":\"xhekuksjtxukcdm\",\"supportedCloud\":\"GCP\",\"severity\":\"Low\",\"displayName\":\"uanzwuxzdx\",\"description\":\"yrlhmwhfpmrqobm\",\"remediationDescription\":\"kknryrtihf\"},\"id\":\"tijbpzvgnwzsymgl\",\"name\":\"uf\",\"type\":\"yzkohdbihanuf\"}") - .toObject(CustomAssessmentAutomationRequest.class); - Assertions.assertEquals("xhekuksjtxukcdm", model.compressedQuery()); - Assertions.assertEquals(SupportedCloudEnum.GCP, model.supportedCloud()); - Assertions.assertEquals(SeverityEnum.LOW, model.severity()); - Assertions.assertEquals("uanzwuxzdx", model.displayName()); - Assertions.assertEquals("yrlhmwhfpmrqobm", model.description()); - Assertions.assertEquals("kknryrtihf", model.remediationDescription()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomAssessmentAutomationRequest model = - new CustomAssessmentAutomationRequest() - .withCompressedQuery("xhekuksjtxukcdm") - .withSupportedCloud(SupportedCloudEnum.GCP) - .withSeverity(SeverityEnum.LOW) - .withDisplayName("uanzwuxzdx") - .withDescription("yrlhmwhfpmrqobm") - .withRemediationDescription("kknryrtihf"); - model = BinaryData.fromObject(model).toObject(CustomAssessmentAutomationRequest.class); - Assertions.assertEquals("xhekuksjtxukcdm", model.compressedQuery()); - Assertions.assertEquals(SupportedCloudEnum.GCP, model.supportedCloud()); - Assertions.assertEquals(SeverityEnum.LOW, model.severity()); - Assertions.assertEquals("uanzwuxzdx", model.displayName()); - Assertions.assertEquals("yrlhmwhfpmrqobm", model.description()); - Assertions.assertEquals("kknryrtihf", model.remediationDescription()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index e78ef4dc3729..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomAssessmentAutomationsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomAssessmentAutomationsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .customAssessmentAutomations() - .deleteByResourceGroupWithResponse("u", "lzladltxkpbqh", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentInnerTests.java deleted file mode 100644 index 7760b93bbfb5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentInnerTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentInner; -import org.junit.jupiter.api.Assertions; - -public final class CustomEntityStoreAssignmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomEntityStoreAssignmentInner model = - BinaryData - .fromString( - "{\"properties\":{\"principal\":\"ipjoxzjnchgejs\",\"entityStoreDatabaseLink\":\"dmailzydehojw\"},\"id\":\"ahuxinpm\",\"name\":\"njaqwixjspro\",\"type\":\"vcputegj\"}") - .toObject(CustomEntityStoreAssignmentInner.class); - Assertions.assertEquals("ipjoxzjnchgejs", model.principal()); - Assertions.assertEquals("dmailzydehojw", model.entityStoreDatabaseLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomEntityStoreAssignmentInner model = - new CustomEntityStoreAssignmentInner() - .withPrincipal("ipjoxzjnchgejs") - .withEntityStoreDatabaseLink("dmailzydehojw"); - model = BinaryData.fromObject(model).toObject(CustomEntityStoreAssignmentInner.class); - Assertions.assertEquals("ipjoxzjnchgejs", model.principal()); - Assertions.assertEquals("dmailzydehojw", model.entityStoreDatabaseLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentPropertiesTests.java deleted file mode 100644 index 6109b55d00ce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentPropertiesTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentProperties; -import org.junit.jupiter.api.Assertions; - -public final class CustomEntityStoreAssignmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomEntityStoreAssignmentProperties model = - BinaryData - .fromString("{\"principal\":\"mfdatscmdvpj\",\"entityStoreDatabaseLink\":\"lsuuvmkjozkrwfnd\"}") - .toObject(CustomEntityStoreAssignmentProperties.class); - Assertions.assertEquals("mfdatscmdvpj", model.principal()); - Assertions.assertEquals("lsuuvmkjozkrwfnd", model.entityStoreDatabaseLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomEntityStoreAssignmentProperties model = - new CustomEntityStoreAssignmentProperties() - .withPrincipal("mfdatscmdvpj") - .withEntityStoreDatabaseLink("lsuuvmkjozkrwfnd"); - model = BinaryData.fromObject(model).toObject(CustomEntityStoreAssignmentProperties.class); - Assertions.assertEquals("mfdatscmdvpj", model.principal()); - Assertions.assertEquals("lsuuvmkjozkrwfnd", model.entityStoreDatabaseLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentRequestPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentRequestPropertiesTests.java deleted file mode 100644 index 70cd0dc9b2ad..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentRequestPropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.CustomEntityStoreAssignmentRequestProperties; -import org.junit.jupiter.api.Assertions; - -public final class CustomEntityStoreAssignmentRequestPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomEntityStoreAssignmentRequestProperties model = - BinaryData - .fromString("{\"principal\":\"wryoqpsoacc\"}") - .toObject(CustomEntityStoreAssignmentRequestProperties.class); - Assertions.assertEquals("wryoqpsoacc", model.principal()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomEntityStoreAssignmentRequestProperties model = - new CustomEntityStoreAssignmentRequestProperties().withPrincipal("wryoqpsoacc"); - model = BinaryData.fromObject(model).toObject(CustomEntityStoreAssignmentRequestProperties.class); - Assertions.assertEquals("wryoqpsoacc", model.principal()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentRequestTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentRequestTests.java deleted file mode 100644 index 56bb9c135e80..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentRequestTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentRequest; -import org.junit.jupiter.api.Assertions; - -public final class CustomEntityStoreAssignmentRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomEntityStoreAssignmentRequest model = - BinaryData - .fromString("{\"properties\":{\"principal\":\"jpslwejd\"}}") - .toObject(CustomEntityStoreAssignmentRequest.class); - Assertions.assertEquals("jpslwejd", model.principal()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomEntityStoreAssignmentRequest model = new CustomEntityStoreAssignmentRequest().withPrincipal("jpslwejd"); - model = BinaryData.fromObject(model).toObject(CustomEntityStoreAssignmentRequest.class); - Assertions.assertEquals("jpslwejd", model.principal()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsCreateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsCreateWithResponseMockTests.java deleted file mode 100644 index 291bf119276b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsCreateWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomEntityStoreAssignmentsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"principal\":\"wzm\",\"entityStoreDatabaseLink\":\"lrixysfnimsq\"},\"id\":\"wwwmhkruwaedrym\",\"name\":\"mlqoinhzduew\",\"type\":\"hapfjiik\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CustomEntityStoreAssignment response = - manager - .customEntityStoreAssignments() - .define("qgsdr") - .withExistingResourceGroup("bh") - .withPrincipal("tjxophgerhsmv") - .create(); - - Assertions.assertEquals("wzm", response.principal()); - Assertions.assertEquals("lrixysfnimsq", response.entityStoreDatabaseLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 3dd6a74d56be..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomEntityStoreAssignmentsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .customEntityStoreAssignments() - .deleteByResourceGroupWithResponse("jfowxwy", "vcxjsgbipcukdvek", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 989cf9a63b52..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomEntityStoreAssignmentsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"principal\":\"sztekxby\",\"entityStoreDatabaseLink\":\"msfe\"},\"id\":\"x\",\"name\":\"ihpq\",\"type\":\"dagrhrdicxdw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CustomEntityStoreAssignment response = - manager - .customEntityStoreAssignments() - .getByResourceGroupWithResponse("kxpkzwaq", "ofqovchiqbplv", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("sztekxby", response.principal()); - Assertions.assertEquals("msfe", response.entityStoreDatabaseLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupMockTests.java deleted file mode 100644 index d66bf1861c56..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListByResourceGroupMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomEntityStoreAssignmentsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"principal\":\"d\",\"entityStoreDatabaseLink\":\"bfdyjduss\"},\"id\":\"yszekbhwlka\",\"name\":\"ggkrehbf\",\"type\":\"n\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.customEntityStoreAssignments().listByResourceGroup("buhoduchv", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("d", response.iterator().next().principal()); - Assertions.assertEquals("bfdyjduss", response.iterator().next().entityStoreDatabaseLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListMockTests.java deleted file mode 100644 index 755f2ef03197..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CustomEntityStoreAssignmentsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"principal\":\"fljfiimreoagsqt\",\"entityStoreDatabaseLink\":\"dusr\"},\"id\":\"xxfavsqwudohzilf\",\"name\":\"nl\",\"type\":\"kpsimsfeypofqp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.customEntityStoreAssignments().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fljfiimreoagsqt", response.iterator().next().principal()); - Assertions.assertEquals("dusr", response.iterator().next().entityStoreDatabaseLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListResultTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListResultTests.java deleted file mode 100644 index 8b522177114b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CustomEntityStoreAssignmentsListResultTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.CustomEntityStoreAssignmentsListResult; -import org.junit.jupiter.api.Assertions; - -public final class CustomEntityStoreAssignmentsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CustomEntityStoreAssignmentsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"principal\":\"j\",\"entityStoreDatabaseLink\":\"hbcryffdfdosyge\"},\"id\":\"paojakhmsbzjh\",\"name\":\"rzevdphlxaol\",\"type\":\"hqtrgqjbpf\"},{\"properties\":{\"principal\":\"n\",\"entityStoreDatabaseLink\":\"v\"},\"id\":\"cjrwzoxxjtfellu\",\"name\":\"fziton\",\"type\":\"eqfpj\"},{\"properties\":{\"principal\":\"ofpdvh\",\"entityStoreDatabaseLink\":\"xxypininmay\"},\"id\":\"uybbkpodep\",\"name\":\"oginuvamiheognar\",\"type\":\"zxtheotusivyevcc\"}],\"nextLink\":\"ihnhun\"}") - .toObject(CustomEntityStoreAssignmentsListResult.class); - Assertions.assertEquals("ihnhun", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CustomEntityStoreAssignmentsListResult model = - new CustomEntityStoreAssignmentsListResult().withNextLink("ihnhun"); - model = BinaryData.fromObject(model).toObject(CustomEntityStoreAssignmentsListResult.class); - Assertions.assertEquals("ihnhun", model.nextLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CveTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CveTests.java deleted file mode 100644 index b0dfc5e6e389..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CveTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Cve; - -public final class CveTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Cve model = BinaryData.fromString("{\"title\":\"rclsso\",\"link\":\"omevtfycn\"}").toObject(Cve.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Cve model = new Cve(); - model = BinaryData.fromObject(model).toObject(Cve.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CvssTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CvssTests.java deleted file mode 100644 index ac89cf48db95..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/CvssTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Cvss; - -public final class CvssTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Cvss model = BinaryData.fromString("{\"base\":57.412754}").toObject(Cvss.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Cvss model = new Cvss(); - model = BinaryData.fromObject(model).toObject(Cvss.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DataExportSettingPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DataExportSettingPropertiesTests.java deleted file mode 100644 index 1ef43dbd37e6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DataExportSettingPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.DataExportSettingProperties; -import org.junit.jupiter.api.Assertions; - -public final class DataExportSettingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataExportSettingProperties model = - BinaryData.fromString("{\"enabled\":true}").toObject(DataExportSettingProperties.class); - Assertions.assertEquals(true, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataExportSettingProperties model = new DataExportSettingProperties().withEnabled(true); - model = BinaryData.fromObject(model).toObject(DataExportSettingProperties.class); - Assertions.assertEquals(true, model.enabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DataExportSettingsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DataExportSettingsTests.java deleted file mode 100644 index cfaa562cfc7c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DataExportSettingsTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DataExportSettings; -import org.junit.jupiter.api.Assertions; - -public final class DataExportSettingsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DataExportSettings model = - BinaryData - .fromString( - "{\"kind\":\"DataExportSettings\",\"properties\":{\"enabled\":true},\"id\":\"mptyrilkfbnrqqxv\",\"name\":\"tpbnfnqtxjtoma\",\"type\":\"swbnfddepldwqjns\"}") - .toObject(DataExportSettings.class); - Assertions.assertEquals(true, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DataExportSettings model = new DataExportSettings().withEnabled(true); - model = BinaryData.fromObject(model).toObject(DataExportSettings.class); - Assertions.assertEquals(true, model.enabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingDataSensitivityDiscoveryTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingDataSensitivityDiscoveryTests.java deleted file mode 100644 index 2307bf7a6b36..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingDataSensitivityDiscoveryTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingDataSensitivityDiscovery; -import org.junit.jupiter.api.Assertions; - -public final class DefenderCspmAwsOfferingDataSensitivityDiscoveryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderCspmAwsOfferingDataSensitivityDiscovery model = - BinaryData - .fromString("{\"enabled\":true,\"cloudRoleArn\":\"ythqkkwhbgxvel\"}") - .toObject(DefenderCspmAwsOfferingDataSensitivityDiscovery.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("ythqkkwhbgxvel", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderCspmAwsOfferingDataSensitivityDiscovery model = - new DefenderCspmAwsOfferingDataSensitivityDiscovery().withEnabled(true).withCloudRoleArn("ythqkkwhbgxvel"); - model = BinaryData.fromObject(model).toObject(DefenderCspmAwsOfferingDataSensitivityDiscovery.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("ythqkkwhbgxvel", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingDatabasesDspmTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingDatabasesDspmTests.java deleted file mode 100644 index c5377f6faf43..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingDatabasesDspmTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingDatabasesDspm; -import org.junit.jupiter.api.Assertions; - -public final class DefenderCspmAwsOfferingDatabasesDspmTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderCspmAwsOfferingDatabasesDspm model = - BinaryData - .fromString("{\"enabled\":true,\"cloudRoleArn\":\"nxdmnitmujdtv\"}") - .toObject(DefenderCspmAwsOfferingDatabasesDspm.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("nxdmnitmujdtv", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderCspmAwsOfferingDatabasesDspm model = - new DefenderCspmAwsOfferingDatabasesDspm().withEnabled(true).withCloudRoleArn("nxdmnitmujdtv"); - model = BinaryData.fromObject(model).toObject(DefenderCspmAwsOfferingDatabasesDspm.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("nxdmnitmujdtv", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingTests.java deleted file mode 100644 index 5f48fb7b2733..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOffering; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingDataSensitivityDiscovery; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingDatabasesDspm; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingVmScanners; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderCspmAwsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderCspmAwsOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"DefenderCspmAws\",\"vmScanners\":{\"enabled\":false,\"configuration\":{\"cloudRoleArn\":\"e\",\"scanningMode\":\"Default\",\"exclusionTags\":{\"ktjtgra\":\"llbvgwzsfftedous\",\"fkbebauzl\":\"aqo\"}}},\"dataSensitivityDiscovery\":{\"enabled\":false,\"cloudRoleArn\":\"wpfhnjzudrtpzkgm\"},\"databasesDspm\":{\"enabled\":false,\"cloudRoleArn\":\"hczzqrhm\"},\"description\":\"qbedygisrzwn\"}") - .toObject(DefenderCspmAwsOffering.class); - Assertions.assertEquals(false, model.vmScanners().enabled()); - Assertions.assertEquals("e", model.vmScanners().configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.vmScanners().configuration().scanningMode()); - Assertions.assertEquals("llbvgwzsfftedous", model.vmScanners().configuration().exclusionTags().get("ktjtgra")); - Assertions.assertEquals(false, model.dataSensitivityDiscovery().enabled()); - Assertions.assertEquals("wpfhnjzudrtpzkgm", model.dataSensitivityDiscovery().cloudRoleArn()); - Assertions.assertEquals(false, model.databasesDspm().enabled()); - Assertions.assertEquals("hczzqrhm", model.databasesDspm().cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderCspmAwsOffering model = - new DefenderCspmAwsOffering() - .withVmScanners( - new DefenderCspmAwsOfferingVmScanners() - .withEnabled(false) - .withConfiguration( - new DefenderCspmAwsOfferingVmScannersConfiguration() - .withCloudRoleArn("e") - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags(mapOf("ktjtgra", "llbvgwzsfftedous", "fkbebauzl", "aqo")))) - .withDataSensitivityDiscovery( - new DefenderCspmAwsOfferingDataSensitivityDiscovery() - .withEnabled(false) - .withCloudRoleArn("wpfhnjzudrtpzkgm")) - .withDatabasesDspm( - new DefenderCspmAwsOfferingDatabasesDspm().withEnabled(false).withCloudRoleArn("hczzqrhm")); - model = BinaryData.fromObject(model).toObject(DefenderCspmAwsOffering.class); - Assertions.assertEquals(false, model.vmScanners().enabled()); - Assertions.assertEquals("e", model.vmScanners().configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.vmScanners().configuration().scanningMode()); - Assertions.assertEquals("llbvgwzsfftedous", model.vmScanners().configuration().exclusionTags().get("ktjtgra")); - Assertions.assertEquals(false, model.dataSensitivityDiscovery().enabled()); - Assertions.assertEquals("wpfhnjzudrtpzkgm", model.dataSensitivityDiscovery().cloudRoleArn()); - Assertions.assertEquals(false, model.databasesDspm().enabled()); - Assertions.assertEquals("hczzqrhm", model.databasesDspm().cloudRoleArn()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingVmScannersConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingVmScannersConfigurationTests.java deleted file mode 100644 index b0f6261d8640..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingVmScannersConfigurationTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderCspmAwsOfferingVmScannersConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderCspmAwsOfferingVmScannersConfiguration model = - BinaryData - .fromString( - "{\"cloudRoleArn\":\"sqrggvrbnyruko\",\"scanningMode\":\"Default\",\"exclusionTags\":{\"p\":\"duwjleipjlhwy\"}}") - .toObject(DefenderCspmAwsOfferingVmScannersConfiguration.class); - Assertions.assertEquals("sqrggvrbnyruko", model.cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.scanningMode()); - Assertions.assertEquals("duwjleipjlhwy", model.exclusionTags().get("p")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderCspmAwsOfferingVmScannersConfiguration model = - new DefenderCspmAwsOfferingVmScannersConfiguration() - .withCloudRoleArn("sqrggvrbnyruko") - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags(mapOf("p", "duwjleipjlhwy")); - model = BinaryData.fromObject(model).toObject(DefenderCspmAwsOfferingVmScannersConfiguration.class); - Assertions.assertEquals("sqrggvrbnyruko", model.cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.scanningMode()); - Assertions.assertEquals("duwjleipjlhwy", model.exclusionTags().get("p")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingVmScannersTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingVmScannersTests.java deleted file mode 100644 index a99b23fb56e1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmAwsOfferingVmScannersTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingVmScanners; -import com.azure.resourcemanager.security.models.DefenderCspmAwsOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderCspmAwsOfferingVmScannersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderCspmAwsOfferingVmScanners model = - BinaryData - .fromString( - "{\"enabled\":false,\"configuration\":{\"cloudRoleArn\":\"jch\",\"scanningMode\":\"Default\",\"exclusionTags\":{\"rfgdrwj\":\"ctofldseacdhztxk\",\"xet\":\"yewhfjsrwq\",\"thvmaxgnuyeamcmh\":\"gcwvrrmdqntycna\",\"wcpqtwl\":\"dfjeceho\"}}}") - .toObject(DefenderCspmAwsOfferingVmScanners.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("jch", model.configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.configuration().scanningMode()); - Assertions.assertEquals("ctofldseacdhztxk", model.configuration().exclusionTags().get("rfgdrwj")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderCspmAwsOfferingVmScanners model = - new DefenderCspmAwsOfferingVmScanners() - .withEnabled(false) - .withConfiguration( - new DefenderCspmAwsOfferingVmScannersConfiguration() - .withCloudRoleArn("jch") - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags( - mapOf( - "rfgdrwj", - "ctofldseacdhztxk", - "xet", - "yewhfjsrwq", - "thvmaxgnuyeamcmh", - "gcwvrrmdqntycna", - "wcpqtwl", - "dfjeceho"))); - model = BinaryData.fromObject(model).toObject(DefenderCspmAwsOfferingVmScanners.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("jch", model.configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.configuration().scanningMode()); - Assertions.assertEquals("ctofldseacdhztxk", model.configuration().exclusionTags().get("rfgdrwj")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmGcpOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmGcpOfferingTests.java deleted file mode 100644 index e92e258df870..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderCspmGcpOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderCspmGcpOffering; - -public final class DefenderCspmGcpOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderCspmGcpOffering model = - BinaryData - .fromString("{\"offeringType\":\"DefenderCspmGcp\",\"description\":\"lyymffhmjpddny\"}") - .toObject(DefenderCspmGcpOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderCspmGcpOffering model = new DefenderCspmGcpOffering(); - model = BinaryData.fromObject(model).toObject(DefenderCspmGcpOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfigurationTests.java deleted file mode 100644 index 62f7fbd72b7a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfigurationTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration model = - BinaryData - .fromString("{\"proxy\":\"qbmfuvqarwz\",\"privateLinkScope\":\"qreblui\"}") - .toObject(DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("qbmfuvqarwz", model.proxy()); - Assertions.assertEquals("qreblui", model.privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration model = - new DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration() - .withProxy("qbmfuvqarwz") - .withPrivateLinkScope("qreblui"); - model = - BinaryData.fromObject(model).toObject(DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("qbmfuvqarwz", model.proxy()); - Assertions.assertEquals("qreblui", model.privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingArcAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingArcAutoProvisioningTests.java deleted file mode 100644 index 038e6c234ae7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingArcAutoProvisioningTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderFoDatabasesAwsOfferingArcAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderFoDatabasesAwsOfferingArcAutoProvisioning model = - BinaryData - .fromString( - "{\"enabled\":true,\"cloudRoleArn\":\"kt\",\"configuration\":{\"proxy\":\"jwzzoslpk\",\"privateLinkScope\":\"tglwkzpgajsqjc\"}}") - .toObject(DefenderFoDatabasesAwsOfferingArcAutoProvisioning.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("kt", model.cloudRoleArn()); - Assertions.assertEquals("jwzzoslpk", model.configuration().proxy()); - Assertions.assertEquals("tglwkzpgajsqjc", model.configuration().privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderFoDatabasesAwsOfferingArcAutoProvisioning model = - new DefenderFoDatabasesAwsOfferingArcAutoProvisioning() - .withEnabled(true) - .withCloudRoleArn("kt") - .withConfiguration( - new DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration() - .withProxy("jwzzoslpk") - .withPrivateLinkScope("tglwkzpgajsqjc")); - model = BinaryData.fromObject(model).toObject(DefenderFoDatabasesAwsOfferingArcAutoProvisioning.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("kt", model.cloudRoleArn()); - Assertions.assertEquals("jwzzoslpk", model.configuration().proxy()); - Assertions.assertEquals("tglwkzpgajsqjc", model.configuration().privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingDatabasesDspmTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingDatabasesDspmTests.java deleted file mode 100644 index 73dd794694c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingDatabasesDspmTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingDatabasesDspm; -import org.junit.jupiter.api.Assertions; - -public final class DefenderFoDatabasesAwsOfferingDatabasesDspmTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderFoDatabasesAwsOfferingDatabasesDspm model = - BinaryData - .fromString("{\"enabled\":false,\"cloudRoleArn\":\"kbudbtwaokb\"}") - .toObject(DefenderFoDatabasesAwsOfferingDatabasesDspm.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("kbudbtwaokb", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderFoDatabasesAwsOfferingDatabasesDspm model = - new DefenderFoDatabasesAwsOfferingDatabasesDspm().withEnabled(false).withCloudRoleArn("kbudbtwaokb"); - model = BinaryData.fromObject(model).toObject(DefenderFoDatabasesAwsOfferingDatabasesDspm.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("kbudbtwaokb", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingRdsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingRdsTests.java deleted file mode 100644 index 7b4235a71a2b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingRdsTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingRds; -import org.junit.jupiter.api.Assertions; - -public final class DefenderFoDatabasesAwsOfferingRdsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderFoDatabasesAwsOfferingRds model = - BinaryData - .fromString("{\"enabled\":true,\"cloudRoleArn\":\"xsfgtdmbvxekr\"}") - .toObject(DefenderFoDatabasesAwsOfferingRds.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("xsfgtdmbvxekr", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderFoDatabasesAwsOfferingRds model = - new DefenderFoDatabasesAwsOfferingRds().withEnabled(true).withCloudRoleArn("xsfgtdmbvxekr"); - model = BinaryData.fromObject(model).toObject(DefenderFoDatabasesAwsOfferingRds.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("xsfgtdmbvxekr", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingTests.java deleted file mode 100644 index aacdd14349c8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderFoDatabasesAwsOfferingTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOffering; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingDatabasesDspm; -import com.azure.resourcemanager.security.models.DefenderFoDatabasesAwsOfferingRds; -import org.junit.jupiter.api.Assertions; - -public final class DefenderFoDatabasesAwsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderFoDatabasesAwsOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"DefenderForDatabasesAws\",\"arcAutoProvisioning\":{\"enabled\":true,\"cloudRoleArn\":\"mbqdabzfivfo\",\"configuration\":{\"proxy\":\"sthhzagjfwy\",\"privateLinkScope\":\"lhgenuzejgvkv\"}},\"rds\":{\"enabled\":false,\"cloudRoleArn\":\"zllrz\"},\"databasesDspm\":{\"enabled\":true,\"cloudRoleArn\":\"qgmihzpimcqrhnxt\"},\"description\":\"nklogxsvtzarhzv\"}") - .toObject(DefenderFoDatabasesAwsOffering.class); - Assertions.assertEquals(true, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("mbqdabzfivfo", model.arcAutoProvisioning().cloudRoleArn()); - Assertions.assertEquals("sthhzagjfwy", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("lhgenuzejgvkv", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions.assertEquals(false, model.rds().enabled()); - Assertions.assertEquals("zllrz", model.rds().cloudRoleArn()); - Assertions.assertEquals(true, model.databasesDspm().enabled()); - Assertions.assertEquals("qgmihzpimcqrhnxt", model.databasesDspm().cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderFoDatabasesAwsOffering model = - new DefenderFoDatabasesAwsOffering() - .withArcAutoProvisioning( - new DefenderFoDatabasesAwsOfferingArcAutoProvisioning() - .withEnabled(true) - .withCloudRoleArn("mbqdabzfivfo") - .withConfiguration( - new DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration() - .withProxy("sthhzagjfwy") - .withPrivateLinkScope("lhgenuzejgvkv"))) - .withRds(new DefenderFoDatabasesAwsOfferingRds().withEnabled(false).withCloudRoleArn("zllrz")) - .withDatabasesDspm( - new DefenderFoDatabasesAwsOfferingDatabasesDspm() - .withEnabled(true) - .withCloudRoleArn("qgmihzpimcqrhnxt")); - model = BinaryData.fromObject(model).toObject(DefenderFoDatabasesAwsOffering.class); - Assertions.assertEquals(true, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("mbqdabzfivfo", model.arcAutoProvisioning().cloudRoleArn()); - Assertions.assertEquals("sthhzagjfwy", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("lhgenuzejgvkv", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions.assertEquals(false, model.rds().enabled()); - Assertions.assertEquals("zllrz", model.rds().cloudRoleArn()); - Assertions.assertEquals(true, model.databasesDspm().enabled()); - Assertions.assertEquals("qgmihzpimcqrhnxt", model.databasesDspm().cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingCloudWatchToKinesisTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingCloudWatchToKinesisTests.java deleted file mode 100644 index d876386ab209..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingCloudWatchToKinesisTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingCloudWatchToKinesis; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersAwsOfferingCloudWatchToKinesisTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersAwsOfferingCloudWatchToKinesis model = - BinaryData - .fromString("{\"cloudRoleArn\":\"zuodacpun\"}") - .toObject(DefenderForContainersAwsOfferingCloudWatchToKinesis.class); - Assertions.assertEquals("zuodacpun", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersAwsOfferingCloudWatchToKinesis model = - new DefenderForContainersAwsOfferingCloudWatchToKinesis().withCloudRoleArn("zuodacpun"); - model = BinaryData.fromObject(model).toObject(DefenderForContainersAwsOfferingCloudWatchToKinesis.class); - Assertions.assertEquals("zuodacpun", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTaskTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTaskTests.java deleted file mode 100644 index cc6b0ec2a746..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTaskTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTaskTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask model = - BinaryData - .fromString("{\"cloudRoleArn\":\"lpckaewsedves\"}") - .toObject(DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.class); - Assertions.assertEquals("lpckaewsedves", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask model = - new DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask() - .withCloudRoleArn("lpckaewsedves"); - model = - BinaryData - .fromObject(model) - .toObject(DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.class); - Assertions.assertEquals("lpckaewsedves", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTests.java deleted file mode 100644 index 1b83dea1aa12..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingContainerVulnerabilityAssessment; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersAwsOfferingContainerVulnerabilityAssessment model = - BinaryData - .fromString("{\"cloudRoleArn\":\"ynu\"}") - .toObject(DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.class); - Assertions.assertEquals("ynu", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersAwsOfferingContainerVulnerabilityAssessment model = - new DefenderForContainersAwsOfferingContainerVulnerabilityAssessment().withCloudRoleArn("ynu"); - model = - BinaryData - .fromObject(model) - .toObject(DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.class); - Assertions.assertEquals("ynu", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKinesisToS3Tests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKinesisToS3Tests.java deleted file mode 100644 index 87796576427d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKinesisToS3Tests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKinesisToS3; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersAwsOfferingKinesisToS3Tests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersAwsOfferingKinesisToS3 model = - BinaryData - .fromString("{\"cloudRoleArn\":\"tepdjxqes\"}") - .toObject(DefenderForContainersAwsOfferingKinesisToS3.class); - Assertions.assertEquals("tepdjxqes", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersAwsOfferingKinesisToS3 model = - new DefenderForContainersAwsOfferingKinesisToS3().withCloudRoleArn("tepdjxqes"); - model = BinaryData.fromObject(model).toObject(DefenderForContainersAwsOfferingKinesisToS3.class); - Assertions.assertEquals("tepdjxqes", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKubernetesScubaReaderTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKubernetesScubaReaderTests.java deleted file mode 100644 index 167d0150f9a5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKubernetesScubaReaderTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKubernetesScubaReader; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersAwsOfferingKubernetesScubaReaderTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersAwsOfferingKubernetesScubaReader model = - BinaryData - .fromString("{\"cloudRoleArn\":\"gxvrpjl\"}") - .toObject(DefenderForContainersAwsOfferingKubernetesScubaReader.class); - Assertions.assertEquals("gxvrpjl", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersAwsOfferingKubernetesScubaReader model = - new DefenderForContainersAwsOfferingKubernetesScubaReader().withCloudRoleArn("gxvrpjl"); - model = BinaryData.fromObject(model).toObject(DefenderForContainersAwsOfferingKubernetesScubaReader.class); - Assertions.assertEquals("gxvrpjl", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKubernetesServiceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKubernetesServiceTests.java deleted file mode 100644 index b499ff38d9a0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingKubernetesServiceTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKubernetesService; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersAwsOfferingKubernetesServiceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersAwsOfferingKubernetesService model = - BinaryData - .fromString("{\"cloudRoleArn\":\"cly\"}") - .toObject(DefenderForContainersAwsOfferingKubernetesService.class); - Assertions.assertEquals("cly", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersAwsOfferingKubernetesService model = - new DefenderForContainersAwsOfferingKubernetesService().withCloudRoleArn("cly"); - model = BinaryData.fromObject(model).toObject(DefenderForContainersAwsOfferingKubernetesService.class); - Assertions.assertEquals("cly", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingTests.java deleted file mode 100644 index abf62d2ec1d7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersAwsOfferingTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOffering; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingCloudWatchToKinesis; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingContainerVulnerabilityAssessment; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKinesisToS3; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKubernetesScubaReader; -import com.azure.resourcemanager.security.models.DefenderForContainersAwsOfferingKubernetesService; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersAwsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersAwsOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"DefenderForContainersAws\",\"kubernetesService\":{\"cloudRoleArn\":\"tkbtnqlrngl\"},\"kubernetesScubaReader\":{\"cloudRoleArn\":\"iipsnawwlqkz\"},\"cloudWatchToKinesis\":{\"cloudRoleArn\":\"hllxricctkw\"},\"kinesisToS3\":{\"cloudRoleArn\":\"qoajxeiyglesrwva\"},\"containerVulnerabilityAssessment\":{\"cloudRoleArn\":\"dctrceqnkbrupobe\"},\"containerVulnerabilityAssessmentTask\":{\"cloudRoleArn\":\"lj\"},\"enableContainerVulnerabilityAssessment\":true,\"autoProvisioning\":true,\"kubeAuditRetentionTime\":2313519110456203073,\"scubaExternalId\":\"pbibn\",\"description\":\"phepifexleqirc\"}") - .toObject(DefenderForContainersAwsOffering.class); - Assertions.assertEquals("tkbtnqlrngl", model.kubernetesService().cloudRoleArn()); - Assertions.assertEquals("iipsnawwlqkz", model.kubernetesScubaReader().cloudRoleArn()); - Assertions.assertEquals("hllxricctkw", model.cloudWatchToKinesis().cloudRoleArn()); - Assertions.assertEquals("qoajxeiyglesrwva", model.kinesisToS3().cloudRoleArn()); - Assertions.assertEquals("dctrceqnkbrupobe", model.containerVulnerabilityAssessment().cloudRoleArn()); - Assertions.assertEquals("lj", model.containerVulnerabilityAssessmentTask().cloudRoleArn()); - Assertions.assertEquals(true, model.enableContainerVulnerabilityAssessment()); - Assertions.assertEquals(true, model.autoProvisioning()); - Assertions.assertEquals(2313519110456203073L, model.kubeAuditRetentionTime()); - Assertions.assertEquals("pbibn", model.scubaExternalId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersAwsOffering model = - new DefenderForContainersAwsOffering() - .withKubernetesService( - new DefenderForContainersAwsOfferingKubernetesService().withCloudRoleArn("tkbtnqlrngl")) - .withKubernetesScubaReader( - new DefenderForContainersAwsOfferingKubernetesScubaReader().withCloudRoleArn("iipsnawwlqkz")) - .withCloudWatchToKinesis( - new DefenderForContainersAwsOfferingCloudWatchToKinesis().withCloudRoleArn("hllxricctkw")) - .withKinesisToS3(new DefenderForContainersAwsOfferingKinesisToS3().withCloudRoleArn("qoajxeiyglesrwva")) - .withContainerVulnerabilityAssessment( - new DefenderForContainersAwsOfferingContainerVulnerabilityAssessment() - .withCloudRoleArn("dctrceqnkbrupobe")) - .withContainerVulnerabilityAssessmentTask( - new DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask().withCloudRoleArn("lj")) - .withEnableContainerVulnerabilityAssessment(true) - .withAutoProvisioning(true) - .withKubeAuditRetentionTime(2313519110456203073L) - .withScubaExternalId("pbibn"); - model = BinaryData.fromObject(model).toObject(DefenderForContainersAwsOffering.class); - Assertions.assertEquals("tkbtnqlrngl", model.kubernetesService().cloudRoleArn()); - Assertions.assertEquals("iipsnawwlqkz", model.kubernetesScubaReader().cloudRoleArn()); - Assertions.assertEquals("hllxricctkw", model.cloudWatchToKinesis().cloudRoleArn()); - Assertions.assertEquals("qoajxeiyglesrwva", model.kinesisToS3().cloudRoleArn()); - Assertions.assertEquals("dctrceqnkbrupobe", model.containerVulnerabilityAssessment().cloudRoleArn()); - Assertions.assertEquals("lj", model.containerVulnerabilityAssessmentTask().cloudRoleArn()); - Assertions.assertEquals(true, model.enableContainerVulnerabilityAssessment()); - Assertions.assertEquals(true, model.autoProvisioning()); - Assertions.assertEquals(2313519110456203073L, model.kubeAuditRetentionTime()); - Assertions.assertEquals("pbibn", model.scubaExternalId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnectionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnectionTests.java deleted file mode 100644 index 73efe1466c4e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnectionTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersGcpOfferingDataPipelineNativeCloudConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection model = - BinaryData - .fromString( - "{\"serviceAccountEmailAddress\":\"iklhsyekrdrenx\",\"workloadIdentityProviderId\":\"riyehqbeivdlhy\"}") - .toObject(DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.class); - Assertions.assertEquals("iklhsyekrdrenx", model.serviceAccountEmailAddress()); - Assertions.assertEquals("riyehqbeivdlhy", model.workloadIdentityProviderId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection model = - new DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection() - .withServiceAccountEmailAddress("iklhsyekrdrenx") - .withWorkloadIdentityProviderId("riyehqbeivdlhy"); - model = - BinaryData - .fromObject(model) - .toObject(DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.class); - Assertions.assertEquals("iklhsyekrdrenx", model.serviceAccountEmailAddress()); - Assertions.assertEquals("riyehqbeivdlhy", model.workloadIdentityProviderId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingNativeCloudConnectionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingNativeCloudConnectionTests.java deleted file mode 100644 index 5e5cd5096c94..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingNativeCloudConnectionTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersGcpOfferingNativeCloudConnection; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersGcpOfferingNativeCloudConnectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersGcpOfferingNativeCloudConnection model = - BinaryData - .fromString( - "{\"serviceAccountEmailAddress\":\"jgazl\",\"workloadIdentityProviderId\":\"bzfcpuoeedwj\"}") - .toObject(DefenderForContainersGcpOfferingNativeCloudConnection.class); - Assertions.assertEquals("jgazl", model.serviceAccountEmailAddress()); - Assertions.assertEquals("bzfcpuoeedwj", model.workloadIdentityProviderId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersGcpOfferingNativeCloudConnection model = - new DefenderForContainersGcpOfferingNativeCloudConnection() - .withServiceAccountEmailAddress("jgazl") - .withWorkloadIdentityProviderId("bzfcpuoeedwj"); - model = BinaryData.fromObject(model).toObject(DefenderForContainersGcpOfferingNativeCloudConnection.class); - Assertions.assertEquals("jgazl", model.serviceAccountEmailAddress()); - Assertions.assertEquals("bzfcpuoeedwj", model.workloadIdentityProviderId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingTests.java deleted file mode 100644 index 10c38f178313..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForContainersGcpOfferingTests.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForContainersGcpOffering; -import com.azure.resourcemanager.security.models.DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection; -import com.azure.resourcemanager.security.models.DefenderForContainersGcpOfferingNativeCloudConnection; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForContainersGcpOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForContainersGcpOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"DefenderForContainersGcp\",\"nativeCloudConnection\":{\"serviceAccountEmailAddress\":\"anfbc\",\"workloadIdentityProviderId\":\"qagywvtxig\"},\"dataPipelineNativeCloudConnection\":{\"serviceAccountEmailAddress\":\"ktpgaeukyawohp\",\"workloadIdentityProviderId\":\"hqnucs\"},\"auditLogsAutoProvisioningFlag\":true,\"defenderAgentAutoProvisioningFlag\":false,\"policyAgentAutoProvisioningFlag\":false,\"description\":\"tdlpbn\"}") - .toObject(DefenderForContainersGcpOffering.class); - Assertions.assertEquals("anfbc", model.nativeCloudConnection().serviceAccountEmailAddress()); - Assertions.assertEquals("qagywvtxig", model.nativeCloudConnection().workloadIdentityProviderId()); - Assertions - .assertEquals("ktpgaeukyawohp", model.dataPipelineNativeCloudConnection().serviceAccountEmailAddress()); - Assertions.assertEquals("hqnucs", model.dataPipelineNativeCloudConnection().workloadIdentityProviderId()); - Assertions.assertEquals(true, model.auditLogsAutoProvisioningFlag()); - Assertions.assertEquals(false, model.defenderAgentAutoProvisioningFlag()); - Assertions.assertEquals(false, model.policyAgentAutoProvisioningFlag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForContainersGcpOffering model = - new DefenderForContainersGcpOffering() - .withNativeCloudConnection( - new DefenderForContainersGcpOfferingNativeCloudConnection() - .withServiceAccountEmailAddress("anfbc") - .withWorkloadIdentityProviderId("qagywvtxig")) - .withDataPipelineNativeCloudConnection( - new DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection() - .withServiceAccountEmailAddress("ktpgaeukyawohp") - .withWorkloadIdentityProviderId("hqnucs")) - .withAuditLogsAutoProvisioningFlag(true) - .withDefenderAgentAutoProvisioningFlag(false) - .withPolicyAgentAutoProvisioningFlag(false); - model = BinaryData.fromObject(model).toObject(DefenderForContainersGcpOffering.class); - Assertions.assertEquals("anfbc", model.nativeCloudConnection().serviceAccountEmailAddress()); - Assertions.assertEquals("qagywvtxig", model.nativeCloudConnection().workloadIdentityProviderId()); - Assertions - .assertEquals("ktpgaeukyawohp", model.dataPipelineNativeCloudConnection().serviceAccountEmailAddress()); - Assertions.assertEquals("hqnucs", model.dataPipelineNativeCloudConnection().workloadIdentityProviderId()); - Assertions.assertEquals(true, model.auditLogsAutoProvisioningFlag()); - Assertions.assertEquals(false, model.defenderAgentAutoProvisioningFlag()); - Assertions.assertEquals(false, model.policyAgentAutoProvisioningFlag()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingArcAutoProvisioningConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingArcAutoProvisioningConfigurationTests.java deleted file mode 100644 index 517b09fad11b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingArcAutoProvisioningConfigurationTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForDatabasesGcpOfferingArcAutoProvisioningConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration model = - BinaryData - .fromString("{\"proxy\":\"ecleqioulndhzyo\",\"privateLinkScope\":\"jhtollh\"}") - .toObject(DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("ecleqioulndhzyo", model.proxy()); - Assertions.assertEquals("jhtollh", model.privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration model = - new DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration() - .withProxy("ecleqioulndhzyo") - .withPrivateLinkScope("jhtollh"); - model = - BinaryData - .fromObject(model) - .toObject(DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("ecleqioulndhzyo", model.proxy()); - Assertions.assertEquals("jhtollh", model.privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingArcAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingArcAutoProvisioningTests.java deleted file mode 100644 index 2d4fc50f362b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingArcAutoProvisioningTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForDatabasesGcpOfferingArcAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForDatabasesGcpOfferingArcAutoProvisioning model = - BinaryData - .fromString( - "{\"enabled\":false,\"configuration\":{\"proxy\":\"ztv\",\"privateLinkScope\":\"mwwmjswenaww\"}}") - .toObject(DefenderForDatabasesGcpOfferingArcAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("ztv", model.configuration().proxy()); - Assertions.assertEquals("mwwmjswenaww", model.configuration().privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForDatabasesGcpOfferingArcAutoProvisioning model = - new DefenderForDatabasesGcpOfferingArcAutoProvisioning() - .withEnabled(false) - .withConfiguration( - new DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration() - .withProxy("ztv") - .withPrivateLinkScope("mwwmjswenaww")); - model = BinaryData.fromObject(model).toObject(DefenderForDatabasesGcpOfferingArcAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("ztv", model.configuration().proxy()); - Assertions.assertEquals("mwwmjswenaww", model.configuration().privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioningTests.java deleted file mode 100644 index a6153764e374..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioningTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning model = - BinaryData - .fromString("{\"serviceAccountEmailAddress\":\"idmytzln\",\"workloadIdentityProviderId\":\"xpno\"}") - .toObject(DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.class); - Assertions.assertEquals("idmytzln", model.serviceAccountEmailAddress()); - Assertions.assertEquals("xpno", model.workloadIdentityProviderId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning model = - new DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning() - .withServiceAccountEmailAddress("idmytzln") - .withWorkloadIdentityProviderId("xpno"); - model = - BinaryData - .fromObject(model) - .toObject(DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning.class); - Assertions.assertEquals("idmytzln", model.serviceAccountEmailAddress()); - Assertions.assertEquals("xpno", model.workloadIdentityProviderId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingTests.java deleted file mode 100644 index 5f7b8fcfbce6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDatabasesGcpOfferingTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOffering; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForDatabasesGcpOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForDatabasesGcpOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"DefenderForDatabasesGcp\",\"arcAutoProvisioning\":{\"enabled\":true,\"configuration\":{\"proxy\":\"fv\",\"privateLinkScope\":\"vqkxiuxqggvq\"}},\"defenderForDatabasesArcAutoProvisioning\":{\"serviceAccountEmailAddress\":\"yhlwcjsqg\",\"workloadIdentityProviderId\":\"hffbxrq\"},\"description\":\"ijpeuql\"}") - .toObject(DefenderForDatabasesGcpOffering.class); - Assertions.assertEquals(true, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("fv", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("vqkxiuxqggvq", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions - .assertEquals("yhlwcjsqg", model.defenderForDatabasesArcAutoProvisioning().serviceAccountEmailAddress()); - Assertions - .assertEquals("hffbxrq", model.defenderForDatabasesArcAutoProvisioning().workloadIdentityProviderId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForDatabasesGcpOffering model = - new DefenderForDatabasesGcpOffering() - .withArcAutoProvisioning( - new DefenderForDatabasesGcpOfferingArcAutoProvisioning() - .withEnabled(true) - .withConfiguration( - new DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration() - .withProxy("fv") - .withPrivateLinkScope("vqkxiuxqggvq"))) - .withDefenderForDatabasesArcAutoProvisioning( - new DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning() - .withServiceAccountEmailAddress("yhlwcjsqg") - .withWorkloadIdentityProviderId("hffbxrq")); - model = BinaryData.fromObject(model).toObject(DefenderForDatabasesGcpOffering.class); - Assertions.assertEquals(true, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("fv", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("vqkxiuxqggvq", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions - .assertEquals("yhlwcjsqg", model.defenderForDatabasesArcAutoProvisioning().serviceAccountEmailAddress()); - Assertions - .assertEquals("hffbxrq", model.defenderForDatabasesArcAutoProvisioning().workloadIdentityProviderId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsAzureDevOpsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsAzureDevOpsOfferingTests.java deleted file mode 100644 index c41f2a47b23b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsAzureDevOpsOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForDevOpsAzureDevOpsOffering; - -public final class DefenderForDevOpsAzureDevOpsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForDevOpsAzureDevOpsOffering model = - BinaryData - .fromString("{\"offeringType\":\"DefenderForDevOpsAzureDevOps\",\"description\":\"rb\"}") - .toObject(DefenderForDevOpsAzureDevOpsOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForDevOpsAzureDevOpsOffering model = new DefenderForDevOpsAzureDevOpsOffering(); - model = BinaryData.fromObject(model).toObject(DefenderForDevOpsAzureDevOpsOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsGitLabOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsGitLabOfferingTests.java deleted file mode 100644 index 8452e440f36e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsGitLabOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForDevOpsGitLabOffering; - -public final class DefenderForDevOpsGitLabOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForDevOpsGitLabOffering model = - BinaryData - .fromString("{\"offeringType\":\"DefenderForDevOpsGitLab\",\"description\":\"pp\"}") - .toObject(DefenderForDevOpsGitLabOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForDevOpsGitLabOffering model = new DefenderForDevOpsGitLabOffering(); - model = BinaryData.fromObject(model).toObject(DefenderForDevOpsGitLabOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsGithubOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsGithubOfferingTests.java deleted file mode 100644 index 3ff70d8d6e6b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForDevOpsGithubOfferingTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForDevOpsGithubOffering; - -public final class DefenderForDevOpsGithubOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForDevOpsGithubOffering model = - BinaryData - .fromString("{\"offeringType\":\"DefenderForDevOpsGithub\",\"description\":\"zuvrzmzqmz\"}") - .toObject(DefenderForDevOpsGithubOffering.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForDevOpsGithubOffering model = new DefenderForDevOpsGithubOffering(); - model = BinaryData.fromObject(model).toObject(DefenderForDevOpsGithubOffering.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingArcAutoProvisioningConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingArcAutoProvisioningConfigurationTests.java deleted file mode 100644 index d934b0e7aff0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingArcAutoProvisioningConfigurationTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingArcAutoProvisioningConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingArcAutoProvisioningConfiguration model = - BinaryData - .fromString("{\"proxy\":\"loozrvt\",\"privateLinkScope\":\"cmufunlcpxxv\"}") - .toObject(DefenderForServersAwsOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("loozrvt", model.proxy()); - Assertions.assertEquals("cmufunlcpxxv", model.privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingArcAutoProvisioningConfiguration model = - new DefenderForServersAwsOfferingArcAutoProvisioningConfiguration() - .withProxy("loozrvt") - .withPrivateLinkScope("cmufunlcpxxv"); - model = - BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("loozrvt", model.proxy()); - Assertions.assertEquals("cmufunlcpxxv", model.privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingArcAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingArcAutoProvisioningTests.java deleted file mode 100644 index 47bc889f42d5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingArcAutoProvisioningTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingArcAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingArcAutoProvisioning model = - BinaryData - .fromString( - "{\"enabled\":true,\"cloudRoleArn\":\"cmkrftsjcwjj\",\"configuration\":{\"proxy\":\"mb\",\"privateLinkScope\":\"vifdxkecifhocjx\"}}") - .toObject(DefenderForServersAwsOfferingArcAutoProvisioning.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("cmkrftsjcwjj", model.cloudRoleArn()); - Assertions.assertEquals("mb", model.configuration().proxy()); - Assertions.assertEquals("vifdxkecifhocjx", model.configuration().privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingArcAutoProvisioning model = - new DefenderForServersAwsOfferingArcAutoProvisioning() - .withEnabled(true) - .withCloudRoleArn("cmkrftsjcwjj") - .withConfiguration( - new DefenderForServersAwsOfferingArcAutoProvisioningConfiguration() - .withProxy("mb") - .withPrivateLinkScope("vifdxkecifhocjx")); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingArcAutoProvisioning.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("cmkrftsjcwjj", model.cloudRoleArn()); - Assertions.assertEquals("mb", model.configuration().proxy()); - Assertions.assertEquals("vifdxkecifhocjx", model.configuration().privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingDefenderForServersTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingDefenderForServersTests.java deleted file mode 100644 index a2c683a44bf4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingDefenderForServersTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingDefenderForServers; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingDefenderForServersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingDefenderForServers model = - BinaryData - .fromString("{\"cloudRoleArn\":\"bcyksivmfogd\"}") - .toObject(DefenderForServersAwsOfferingDefenderForServers.class); - Assertions.assertEquals("bcyksivmfogd", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingDefenderForServers model = - new DefenderForServersAwsOfferingDefenderForServers().withCloudRoleArn("bcyksivmfogd"); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingDefenderForServers.class); - Assertions.assertEquals("bcyksivmfogd", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingMdeAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingMdeAutoProvisioningTests.java deleted file mode 100644 index fdb7380ae412..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingMdeAutoProvisioningTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingMdeAutoProvisioning; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingMdeAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingMdeAutoProvisioning model = - BinaryData - .fromString("{\"enabled\":false,\"configuration\":\"dataquv\"}") - .toObject(DefenderForServersAwsOfferingMdeAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingMdeAutoProvisioning model = - new DefenderForServersAwsOfferingMdeAutoProvisioning().withEnabled(false).withConfiguration("dataquv"); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingMdeAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingSubPlanTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingSubPlanTests.java deleted file mode 100644 index 5e77a7807241..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingSubPlanTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingSubPlan; -import com.azure.resourcemanager.security.models.SubPlan; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingSubPlanTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingSubPlan model = - BinaryData.fromString("{\"type\":\"P2\"}").toObject(DefenderForServersAwsOfferingSubPlan.class); - Assertions.assertEquals(SubPlan.P2, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingSubPlan model = new DefenderForServersAwsOfferingSubPlan().withType(SubPlan.P2); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingSubPlan.class); - Assertions.assertEquals(SubPlan.P2, model.type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingTests.java deleted file mode 100644 index 462e3ef6422d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingTests.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOffering; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingArcAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingDefenderForServers; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingMdeAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingSubPlan; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVaAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVaAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVmScanners; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import com.azure.resourcemanager.security.models.SubPlan; -import com.azure.resourcemanager.security.models.Type; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"DefenderForServersAws\",\"defenderForServers\":{\"cloudRoleArn\":\"egqphrgfnzhctm\"},\"arcAutoProvisioning\":{\"enabled\":true,\"cloudRoleArn\":\"pbcbcpzar\",\"configuration\":{\"proxy\":\"qacdldtzm\",\"privateLinkScope\":\"pefcpcz\"}},\"vaAutoProvisioning\":{\"enabled\":true,\"configuration\":{\"type\":\"Qualys\"}},\"mdeAutoProvisioning\":{\"enabled\":true,\"configuration\":\"datapfkhuytuszxhmt\"},\"subPlan\":{\"type\":\"P1\"},\"vmScanners\":{\"enabled\":true,\"configuration\":{\"cloudRoleArn\":\"kvzwydw\",\"scanningMode\":\"Default\",\"exclusionTags\":{\"fukpeexpgeu\":\"kgkskjivbsshaj\",\"hwu\":\"i\",\"dbzsx\":\"trdexyionofnin\"}}},\"description\":\"qqrsmpcbbprtugav\"}") - .toObject(DefenderForServersAwsOffering.class); - Assertions.assertEquals("egqphrgfnzhctm", model.defenderForServers().cloudRoleArn()); - Assertions.assertEquals(true, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("pbcbcpzar", model.arcAutoProvisioning().cloudRoleArn()); - Assertions.assertEquals("qacdldtzm", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("pefcpcz", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions.assertEquals(true, model.vaAutoProvisioning().enabled()); - Assertions.assertEquals(Type.QUALYS, model.vaAutoProvisioning().configuration().type()); - Assertions.assertEquals(true, model.mdeAutoProvisioning().enabled()); - Assertions.assertEquals(SubPlan.P1, model.subPlan().type()); - Assertions.assertEquals(true, model.vmScanners().enabled()); - Assertions.assertEquals("kvzwydw", model.vmScanners().configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.vmScanners().configuration().scanningMode()); - Assertions - .assertEquals("kgkskjivbsshaj", model.vmScanners().configuration().exclusionTags().get("fukpeexpgeu")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOffering model = - new DefenderForServersAwsOffering() - .withDefenderForServers( - new DefenderForServersAwsOfferingDefenderForServers().withCloudRoleArn("egqphrgfnzhctm")) - .withArcAutoProvisioning( - new DefenderForServersAwsOfferingArcAutoProvisioning() - .withEnabled(true) - .withCloudRoleArn("pbcbcpzar") - .withConfiguration( - new DefenderForServersAwsOfferingArcAutoProvisioningConfiguration() - .withProxy("qacdldtzm") - .withPrivateLinkScope("pefcpcz"))) - .withVaAutoProvisioning( - new DefenderForServersAwsOfferingVaAutoProvisioning() - .withEnabled(true) - .withConfiguration( - new DefenderForServersAwsOfferingVaAutoProvisioningConfiguration().withType(Type.QUALYS))) - .withMdeAutoProvisioning( - new DefenderForServersAwsOfferingMdeAutoProvisioning() - .withEnabled(true) - .withConfiguration("datapfkhuytuszxhmt")) - .withSubPlan(new DefenderForServersAwsOfferingSubPlan().withType(SubPlan.P1)) - .withVmScanners( - new DefenderForServersAwsOfferingVmScanners() - .withEnabled(true) - .withConfiguration( - new DefenderForServersAwsOfferingVmScannersConfiguration() - .withCloudRoleArn("kvzwydw") - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags( - mapOf("fukpeexpgeu", "kgkskjivbsshaj", "hwu", "i", "dbzsx", "trdexyionofnin")))); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOffering.class); - Assertions.assertEquals("egqphrgfnzhctm", model.defenderForServers().cloudRoleArn()); - Assertions.assertEquals(true, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("pbcbcpzar", model.arcAutoProvisioning().cloudRoleArn()); - Assertions.assertEquals("qacdldtzm", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("pefcpcz", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions.assertEquals(true, model.vaAutoProvisioning().enabled()); - Assertions.assertEquals(Type.QUALYS, model.vaAutoProvisioning().configuration().type()); - Assertions.assertEquals(true, model.mdeAutoProvisioning().enabled()); - Assertions.assertEquals(SubPlan.P1, model.subPlan().type()); - Assertions.assertEquals(true, model.vmScanners().enabled()); - Assertions.assertEquals("kvzwydw", model.vmScanners().configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.vmScanners().configuration().scanningMode()); - Assertions - .assertEquals("kgkskjivbsshaj", model.vmScanners().configuration().exclusionTags().get("fukpeexpgeu")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVaAutoProvisioningConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVaAutoProvisioningConfigurationTests.java deleted file mode 100644 index bf806864b8be..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVaAutoProvisioningConfigurationTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVaAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.Type; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingVaAutoProvisioningConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingVaAutoProvisioningConfiguration model = - BinaryData - .fromString("{\"type\":\"TVM\"}") - .toObject(DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.class); - Assertions.assertEquals(Type.TVM, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingVaAutoProvisioningConfiguration model = - new DefenderForServersAwsOfferingVaAutoProvisioningConfiguration().withType(Type.TVM); - model = - BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingVaAutoProvisioningConfiguration.class); - Assertions.assertEquals(Type.TVM, model.type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVaAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVaAutoProvisioningTests.java deleted file mode 100644 index 25e6d925c65e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVaAutoProvisioningTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVaAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVaAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.Type; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingVaAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingVaAutoProvisioning model = - BinaryData - .fromString("{\"enabled\":false,\"configuration\":{\"type\":\"TVM\"}}") - .toObject(DefenderForServersAwsOfferingVaAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals(Type.TVM, model.configuration().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingVaAutoProvisioning model = - new DefenderForServersAwsOfferingVaAutoProvisioning() - .withEnabled(false) - .withConfiguration( - new DefenderForServersAwsOfferingVaAutoProvisioningConfiguration().withType(Type.TVM)); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingVaAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals(Type.TVM, model.configuration().type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVmScannersConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVmScannersConfigurationTests.java deleted file mode 100644 index faa1d1f67067..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVmScannersConfigurationTests.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingVmScannersConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingVmScannersConfiguration model = - BinaryData - .fromString( - "{\"cloudRoleArn\":\"vjcteoedlrslsk\",\"scanningMode\":\"Default\",\"exclusionTags\":{\"xzfsnggytexvzilm\":\"jnzdpvocojhpcna\",\"kwwwnckn\":\"iv\",\"weucyrth\":\"zdajlskzptjxu\",\"hokamvfej\":\"qlehmcgcjeinu\"}}") - .toObject(DefenderForServersAwsOfferingVmScannersConfiguration.class); - Assertions.assertEquals("vjcteoedlrslsk", model.cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.scanningMode()); - Assertions.assertEquals("jnzdpvocojhpcna", model.exclusionTags().get("xzfsnggytexvzilm")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingVmScannersConfiguration model = - new DefenderForServersAwsOfferingVmScannersConfiguration() - .withCloudRoleArn("vjcteoedlrslsk") - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags( - mapOf( - "xzfsnggytexvzilm", - "jnzdpvocojhpcna", - "kwwwnckn", - "iv", - "weucyrth", - "zdajlskzptjxu", - "hokamvfej", - "qlehmcgcjeinu")); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingVmScannersConfiguration.class); - Assertions.assertEquals("vjcteoedlrslsk", model.cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.scanningMode()); - Assertions.assertEquals("jnzdpvocojhpcna", model.exclusionTags().get("xzfsnggytexvzilm")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVmScannersTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVmScannersTests.java deleted file mode 100644 index 08809353e841..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersAwsOfferingVmScannersTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVmScanners; -import com.azure.resourcemanager.security.models.DefenderForServersAwsOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersAwsOfferingVmScannersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersAwsOfferingVmScanners model = - BinaryData - .fromString( - "{\"enabled\":false,\"configuration\":{\"cloudRoleArn\":\"crdcueljti\",\"scanningMode\":\"Default\",\"exclusionTags\":{\"yarvsxzqbglcjk\":\"q\",\"btl\":\"yspthzod\",\"kfmkmfdjxyxgbk\":\"jtgblios\"}}}") - .toObject(DefenderForServersAwsOfferingVmScanners.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("crdcueljti", model.configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.configuration().scanningMode()); - Assertions.assertEquals("q", model.configuration().exclusionTags().get("yarvsxzqbglcjk")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersAwsOfferingVmScanners model = - new DefenderForServersAwsOfferingVmScanners() - .withEnabled(false) - .withConfiguration( - new DefenderForServersAwsOfferingVmScannersConfiguration() - .withCloudRoleArn("crdcueljti") - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags( - mapOf("yarvsxzqbglcjk", "q", "btl", "yspthzod", "kfmkmfdjxyxgbk", "jtgblios"))); - model = BinaryData.fromObject(model).toObject(DefenderForServersAwsOfferingVmScanners.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("crdcueljti", model.configuration().cloudRoleArn()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.configuration().scanningMode()); - Assertions.assertEquals("q", model.configuration().exclusionTags().get("yarvsxzqbglcjk")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingArcAutoProvisioningConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingArcAutoProvisioningConfigurationTests.java deleted file mode 100644 index a207a915aac6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingArcAutoProvisioningConfigurationTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingArcAutoProvisioningConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingArcAutoProvisioningConfiguration model = - BinaryData - .fromString("{\"proxy\":\"n\",\"privateLinkScope\":\"ali\"}") - .toObject(DefenderForServersGcpOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("n", model.proxy()); - Assertions.assertEquals("ali", model.privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingArcAutoProvisioningConfiguration model = - new DefenderForServersGcpOfferingArcAutoProvisioningConfiguration() - .withProxy("n") - .withPrivateLinkScope("ali"); - model = - BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingArcAutoProvisioningConfiguration.class); - Assertions.assertEquals("n", model.proxy()); - Assertions.assertEquals("ali", model.privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingArcAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingArcAutoProvisioningTests.java deleted file mode 100644 index a1274e27291b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingArcAutoProvisioningTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingArcAutoProvisioningConfiguration; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingArcAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingArcAutoProvisioning model = - BinaryData - .fromString( - "{\"enabled\":false,\"configuration\":{\"proxy\":\"gfb\",\"privateLinkScope\":\"tlpqagynoi\"}}") - .toObject(DefenderForServersGcpOfferingArcAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("gfb", model.configuration().proxy()); - Assertions.assertEquals("tlpqagynoi", model.configuration().privateLinkScope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingArcAutoProvisioning model = - new DefenderForServersGcpOfferingArcAutoProvisioning() - .withEnabled(false) - .withConfiguration( - new DefenderForServersGcpOfferingArcAutoProvisioningConfiguration() - .withProxy("gfb") - .withPrivateLinkScope("tlpqagynoi")); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingArcAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals("gfb", model.configuration().proxy()); - Assertions.assertEquals("tlpqagynoi", model.configuration().privateLinkScope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingDefenderForServersTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingDefenderForServersTests.java deleted file mode 100644 index 6731bb112f43..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingDefenderForServersTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingDefenderForServers; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingDefenderForServersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingDefenderForServers model = - BinaryData - .fromString("{\"workloadIdentityProviderId\":\"jajqmatxjt\",\"serviceAccountEmailAddress\":\"ln\"}") - .toObject(DefenderForServersGcpOfferingDefenderForServers.class); - Assertions.assertEquals("jajqmatxjt", model.workloadIdentityProviderId()); - Assertions.assertEquals("ln", model.serviceAccountEmailAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingDefenderForServers model = - new DefenderForServersGcpOfferingDefenderForServers() - .withWorkloadIdentityProviderId("jajqmatxjt") - .withServiceAccountEmailAddress("ln"); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingDefenderForServers.class); - Assertions.assertEquals("jajqmatxjt", model.workloadIdentityProviderId()); - Assertions.assertEquals("ln", model.serviceAccountEmailAddress()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingMdeAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingMdeAutoProvisioningTests.java deleted file mode 100644 index d37fda7f56da..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingMdeAutoProvisioningTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingMdeAutoProvisioning; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingMdeAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingMdeAutoProvisioning model = - BinaryData - .fromString("{\"enabled\":false,\"configuration\":\"dataibmq\"}") - .toObject(DefenderForServersGcpOfferingMdeAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingMdeAutoProvisioning model = - new DefenderForServersGcpOfferingMdeAutoProvisioning().withEnabled(false).withConfiguration("dataibmq"); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingMdeAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingSubPlanTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingSubPlanTests.java deleted file mode 100644 index f70acd19405e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingSubPlanTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingSubPlan; -import com.azure.resourcemanager.security.models.SubPlan; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingSubPlanTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingSubPlan model = - BinaryData.fromString("{\"type\":\"P1\"}").toObject(DefenderForServersGcpOfferingSubPlan.class); - Assertions.assertEquals(SubPlan.P1, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingSubPlan model = new DefenderForServersGcpOfferingSubPlan().withType(SubPlan.P1); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingSubPlan.class); - Assertions.assertEquals(SubPlan.P1, model.type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingTests.java deleted file mode 100644 index 4b05b375060c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingTests.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOffering; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingArcAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingArcAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingDefenderForServers; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingMdeAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingSubPlan; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVaAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVaAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVmScanners; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import com.azure.resourcemanager.security.models.SubPlan; -import com.azure.resourcemanager.security.models.Type; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"DefenderForServersGcp\",\"defenderForServers\":{\"workloadIdentityProviderId\":\"scyrfwbivqv\",\"serviceAccountEmailAddress\":\"fuy\"},\"arcAutoProvisioning\":{\"enabled\":false,\"configuration\":{\"proxy\":\"imbyqe\",\"privateLinkScope\":\"ood\"}},\"vaAutoProvisioning\":{\"enabled\":true,\"configuration\":{\"type\":\"Qualys\"}},\"mdeAutoProvisioning\":{\"enabled\":false,\"configuration\":\"dataxxobsmfkwiy\"},\"subPlan\":{\"type\":\"P1\"},\"vmScanners\":{\"enabled\":true,\"configuration\":{\"scanningMode\":\"Default\",\"exclusionTags\":{\"abjqqaxuyvymcnud\":\"vzmlnkoywsxv\",\"wxqweuipmpvksmi\":\"doabhj\",\"krdpqgfhyrfr\":\"nsqxtltc\"}}},\"description\":\"kldgrcwfcmfc\"}") - .toObject(DefenderForServersGcpOffering.class); - Assertions.assertEquals("scyrfwbivqv", model.defenderForServers().workloadIdentityProviderId()); - Assertions.assertEquals("fuy", model.defenderForServers().serviceAccountEmailAddress()); - Assertions.assertEquals(false, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("imbyqe", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("ood", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions.assertEquals(true, model.vaAutoProvisioning().enabled()); - Assertions.assertEquals(Type.QUALYS, model.vaAutoProvisioning().configuration().type()); - Assertions.assertEquals(false, model.mdeAutoProvisioning().enabled()); - Assertions.assertEquals(SubPlan.P1, model.subPlan().type()); - Assertions.assertEquals(true, model.vmScanners().enabled()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.vmScanners().configuration().scanningMode()); - Assertions - .assertEquals("vzmlnkoywsxv", model.vmScanners().configuration().exclusionTags().get("abjqqaxuyvymcnud")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOffering model = - new DefenderForServersGcpOffering() - .withDefenderForServers( - new DefenderForServersGcpOfferingDefenderForServers() - .withWorkloadIdentityProviderId("scyrfwbivqv") - .withServiceAccountEmailAddress("fuy")) - .withArcAutoProvisioning( - new DefenderForServersGcpOfferingArcAutoProvisioning() - .withEnabled(false) - .withConfiguration( - new DefenderForServersGcpOfferingArcAutoProvisioningConfiguration() - .withProxy("imbyqe") - .withPrivateLinkScope("ood"))) - .withVaAutoProvisioning( - new DefenderForServersGcpOfferingVaAutoProvisioning() - .withEnabled(true) - .withConfiguration( - new DefenderForServersGcpOfferingVaAutoProvisioningConfiguration().withType(Type.QUALYS))) - .withMdeAutoProvisioning( - new DefenderForServersGcpOfferingMdeAutoProvisioning() - .withEnabled(false) - .withConfiguration("dataxxobsmfkwiy")) - .withSubPlan(new DefenderForServersGcpOfferingSubPlan().withType(SubPlan.P1)) - .withVmScanners( - new DefenderForServersGcpOfferingVmScanners() - .withEnabled(true) - .withConfiguration( - new DefenderForServersGcpOfferingVmScannersConfiguration() - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags( - mapOf( - "abjqqaxuyvymcnud", - "vzmlnkoywsxv", - "wxqweuipmpvksmi", - "doabhj", - "krdpqgfhyrfr", - "nsqxtltc")))); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOffering.class); - Assertions.assertEquals("scyrfwbivqv", model.defenderForServers().workloadIdentityProviderId()); - Assertions.assertEquals("fuy", model.defenderForServers().serviceAccountEmailAddress()); - Assertions.assertEquals(false, model.arcAutoProvisioning().enabled()); - Assertions.assertEquals("imbyqe", model.arcAutoProvisioning().configuration().proxy()); - Assertions.assertEquals("ood", model.arcAutoProvisioning().configuration().privateLinkScope()); - Assertions.assertEquals(true, model.vaAutoProvisioning().enabled()); - Assertions.assertEquals(Type.QUALYS, model.vaAutoProvisioning().configuration().type()); - Assertions.assertEquals(false, model.mdeAutoProvisioning().enabled()); - Assertions.assertEquals(SubPlan.P1, model.subPlan().type()); - Assertions.assertEquals(true, model.vmScanners().enabled()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.vmScanners().configuration().scanningMode()); - Assertions - .assertEquals("vzmlnkoywsxv", model.vmScanners().configuration().exclusionTags().get("abjqqaxuyvymcnud")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVaAutoProvisioningConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVaAutoProvisioningConfigurationTests.java deleted file mode 100644 index 54168f20ecfd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVaAutoProvisioningConfigurationTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVaAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.Type; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingVaAutoProvisioningConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingVaAutoProvisioningConfiguration model = - BinaryData - .fromString("{\"type\":\"Qualys\"}") - .toObject(DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.class); - Assertions.assertEquals(Type.QUALYS, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingVaAutoProvisioningConfiguration model = - new DefenderForServersGcpOfferingVaAutoProvisioningConfiguration().withType(Type.QUALYS); - model = - BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingVaAutoProvisioningConfiguration.class); - Assertions.assertEquals(Type.QUALYS, model.type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVaAutoProvisioningTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVaAutoProvisioningTests.java deleted file mode 100644 index 367ac0c2b753..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVaAutoProvisioningTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVaAutoProvisioning; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVaAutoProvisioningConfiguration; -import com.azure.resourcemanager.security.models.Type; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingVaAutoProvisioningTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingVaAutoProvisioning model = - BinaryData - .fromString("{\"enabled\":false,\"configuration\":{\"type\":\"TVM\"}}") - .toObject(DefenderForServersGcpOfferingVaAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals(Type.TVM, model.configuration().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingVaAutoProvisioning model = - new DefenderForServersGcpOfferingVaAutoProvisioning() - .withEnabled(false) - .withConfiguration( - new DefenderForServersGcpOfferingVaAutoProvisioningConfiguration().withType(Type.TVM)); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingVaAutoProvisioning.class); - Assertions.assertEquals(false, model.enabled()); - Assertions.assertEquals(Type.TVM, model.configuration().type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVmScannersConfigurationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVmScannersConfigurationTests.java deleted file mode 100644 index 84ad466eb654..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVmScannersConfigurationTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingVmScannersConfigurationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingVmScannersConfiguration model = - BinaryData - .fromString( - "{\"scanningMode\":\"Default\",\"exclusionTags\":{\"io\":\"puohdkcprgukxrz\",\"f\":\"hlutixmqrudjizc\",\"fbcpaqktkrumzu\":\"mcrunfhiucn\"}}") - .toObject(DefenderForServersGcpOfferingVmScannersConfiguration.class); - Assertions.assertEquals(ScanningMode.DEFAULT, model.scanningMode()); - Assertions.assertEquals("puohdkcprgukxrz", model.exclusionTags().get("io")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingVmScannersConfiguration model = - new DefenderForServersGcpOfferingVmScannersConfiguration() - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags( - mapOf("io", "puohdkcprgukxrz", "f", "hlutixmqrudjizc", "fbcpaqktkrumzu", "mcrunfhiucn")); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingVmScannersConfiguration.class); - Assertions.assertEquals(ScanningMode.DEFAULT, model.scanningMode()); - Assertions.assertEquals("puohdkcprgukxrz", model.exclusionTags().get("io")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVmScannersTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVmScannersTests.java deleted file mode 100644 index 9e611d93fc4a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DefenderForServersGcpOfferingVmScannersTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVmScanners; -import com.azure.resourcemanager.security.models.DefenderForServersGcpOfferingVmScannersConfiguration; -import com.azure.resourcemanager.security.models.ScanningMode; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class DefenderForServersGcpOfferingVmScannersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DefenderForServersGcpOfferingVmScanners model = - BinaryData - .fromString( - "{\"enabled\":true,\"configuration\":{\"scanningMode\":\"Default\",\"exclusionTags\":{\"fupetasvv\":\"u\",\"flanfkgxsyao\":\"qsbp\"}}}") - .toObject(DefenderForServersGcpOfferingVmScanners.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.configuration().scanningMode()); - Assertions.assertEquals("u", model.configuration().exclusionTags().get("fupetasvv")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DefenderForServersGcpOfferingVmScanners model = - new DefenderForServersGcpOfferingVmScanners() - .withEnabled(true) - .withConfiguration( - new DefenderForServersGcpOfferingVmScannersConfiguration() - .withScanningMode(ScanningMode.DEFAULT) - .withExclusionTags(mapOf("fupetasvv", "u", "flanfkgxsyao", "qsbp"))); - model = BinaryData.fromObject(model).toObject(DefenderForServersGcpOfferingVmScanners.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals(ScanningMode.DEFAULT, model.configuration().scanningMode()); - Assertions.assertEquals("u", model.configuration().exclusionTags().get("fupetasvv")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DenylistCustomAlertRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DenylistCustomAlertRuleTests.java deleted file mode 100644 index 05ff07e7bd38..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DenylistCustomAlertRuleTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DenylistCustomAlertRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DenylistCustomAlertRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DenylistCustomAlertRule model = - BinaryData - .fromString( - "{\"ruleType\":\"DenylistCustomAlertRule\",\"denylistValues\":[\"okeyyienj\",\"dlwtgrhpdj\"],\"valueType\":\"String\",\"displayName\":\"asxazjpqyegualhb\",\"description\":\"hejjz\",\"isEnabled\":false}") - .toObject(DenylistCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("okeyyienj", model.denylistValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DenylistCustomAlertRule model = - new DenylistCustomAlertRule() - .withIsEnabled(false) - .withDenylistValues(Arrays.asList("okeyyienj", "dlwtgrhpdj")); - model = BinaryData.fromObject(model).toObject(DenylistCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals("okeyyienj", model.denylistValues().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupInnerTests.java deleted file mode 100644 index a5985d229eb6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupInnerTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; -import com.azure.resourcemanager.security.models.AllowlistCustomAlertRule; -import com.azure.resourcemanager.security.models.DenylistCustomAlertRule; -import com.azure.resourcemanager.security.models.ThresholdCustomAlertRule; -import com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeviceSecurityGroupInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceSecurityGroupInner model = - BinaryData - .fromString( - "{\"properties\":{\"thresholdRules\":[{\"ruleType\":\"ThresholdCustomAlertRule\",\"minThreshold\":1273702243,\"maxThreshold\":541162578,\"displayName\":\"rsoodqxhcrmnoh\",\"description\":\"ckwhds\",\"isEnabled\":true},{\"ruleType\":\"ThresholdCustomAlertRule\",\"minThreshold\":1580515344,\"maxThreshold\":491677014,\"displayName\":\"i\",\"description\":\"xsqwpgrjbznorc\",\"isEnabled\":false},{\"ruleType\":\"ThresholdCustomAlertRule\",\"minThreshold\":1016211190,\"maxThreshold\":745592995,\"displayName\":\"byxqabn\",\"description\":\"cpc\",\"isEnabled\":true}],\"timeWindowRules\":[{\"ruleType\":\"TimeWindowCustomAlertRule\",\"timeWindowSize\":\"PT138H20M56S\",\"minThreshold\":818060655,\"maxThreshold\":2023442123,\"displayName\":\"bl\",\"description\":\"gpbtoqcjmklj\",\"isEnabled\":false},{\"ruleType\":\"TimeWindowCustomAlertRule\",\"timeWindowSize\":\"PT31H50M7S\",\"minThreshold\":300306842,\"maxThreshold\":62975440,\"displayName\":\"tqajzyulpkudjkrl\",\"description\":\"bzhfepgzgqexz\",\"isEnabled\":true}],\"allowlistRules\":[{\"ruleType\":\"AllowlistCustomAlertRule\",\"allowlistValues\":[],\"valueType\":\"IpCidr\",\"displayName\":\"aierhhb\",\"description\":\"glu\",\"isEnabled\":false},{\"ruleType\":\"AllowlistCustomAlertRule\",\"allowlistValues\":[],\"valueType\":\"String\",\"displayName\":\"j\",\"description\":\"dxob\",\"isEnabled\":true},{\"ruleType\":\"AllowlistCustomAlertRule\",\"allowlistValues\":[],\"valueType\":\"IpCidr\",\"displayName\":\"qp\",\"description\":\"kajionpim\",\"isEnabled\":false}],\"denylistRules\":[{\"ruleType\":\"DenylistCustomAlertRule\",\"denylistValues\":[],\"valueType\":\"IpCidr\",\"displayName\":\"cp\",\"description\":\"gmaajrm\",\"isEnabled\":false},{\"ruleType\":\"DenylistCustomAlertRule\",\"denylistValues\":[],\"valueType\":\"String\",\"displayName\":\"rlovmclwhijcoej\",\"description\":\"bzaqsqsycbkbfk\",\"isEnabled\":true}]},\"id\":\"kdkexxp\",\"name\":\"ofmx\",\"type\":\"x\"}") - .toObject(DeviceSecurityGroupInner.class); - Assertions.assertEquals(true, model.thresholdRules().get(0).isEnabled()); - Assertions.assertEquals(1273702243, model.thresholdRules().get(0).minThreshold()); - Assertions.assertEquals(541162578, model.thresholdRules().get(0).maxThreshold()); - Assertions.assertEquals(false, model.timeWindowRules().get(0).isEnabled()); - Assertions.assertEquals(818060655, model.timeWindowRules().get(0).minThreshold()); - Assertions.assertEquals(2023442123, model.timeWindowRules().get(0).maxThreshold()); - Assertions.assertEquals(Duration.parse("PT138H20M56S"), model.timeWindowRules().get(0).timeWindowSize()); - Assertions.assertEquals(false, model.allowlistRules().get(0).isEnabled()); - Assertions.assertEquals(false, model.denylistRules().get(0).isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceSecurityGroupInner model = - new DeviceSecurityGroupInner() - .withThresholdRules( - Arrays - .asList( - new ThresholdCustomAlertRule() - .withIsEnabled(true) - .withMinThreshold(1273702243) - .withMaxThreshold(541162578), - new ThresholdCustomAlertRule() - .withIsEnabled(false) - .withMinThreshold(1580515344) - .withMaxThreshold(491677014), - new ThresholdCustomAlertRule() - .withIsEnabled(true) - .withMinThreshold(1016211190) - .withMaxThreshold(745592995))) - .withTimeWindowRules( - Arrays - .asList( - new TimeWindowCustomAlertRule() - .withIsEnabled(false) - .withMinThreshold(818060655) - .withMaxThreshold(2023442123) - .withTimeWindowSize(Duration.parse("PT138H20M56S")), - new TimeWindowCustomAlertRule() - .withIsEnabled(true) - .withMinThreshold(300306842) - .withMaxThreshold(62975440) - .withTimeWindowSize(Duration.parse("PT31H50M7S")))) - .withAllowlistRules( - Arrays - .asList( - new AllowlistCustomAlertRule().withIsEnabled(false).withAllowlistValues(Arrays.asList()), - new AllowlistCustomAlertRule().withIsEnabled(true).withAllowlistValues(Arrays.asList()), - new AllowlistCustomAlertRule().withIsEnabled(false).withAllowlistValues(Arrays.asList()))) - .withDenylistRules( - Arrays - .asList( - new DenylistCustomAlertRule().withIsEnabled(false).withDenylistValues(Arrays.asList()), - new DenylistCustomAlertRule().withIsEnabled(true).withDenylistValues(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(DeviceSecurityGroupInner.class); - Assertions.assertEquals(true, model.thresholdRules().get(0).isEnabled()); - Assertions.assertEquals(1273702243, model.thresholdRules().get(0).minThreshold()); - Assertions.assertEquals(541162578, model.thresholdRules().get(0).maxThreshold()); - Assertions.assertEquals(false, model.timeWindowRules().get(0).isEnabled()); - Assertions.assertEquals(818060655, model.timeWindowRules().get(0).minThreshold()); - Assertions.assertEquals(2023442123, model.timeWindowRules().get(0).maxThreshold()); - Assertions.assertEquals(Duration.parse("PT138H20M56S"), model.timeWindowRules().get(0).timeWindowSize()); - Assertions.assertEquals(false, model.allowlistRules().get(0).isEnabled()); - Assertions.assertEquals(false, model.denylistRules().get(0).isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupListTests.java deleted file mode 100644 index b2a23f808484..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupListTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupInner; -import com.azure.resourcemanager.security.models.DeviceSecurityGroupList; -import java.util.Arrays; - -public final class DeviceSecurityGroupListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceSecurityGroupList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"thresholdRules\":[],\"timeWindowRules\":[],\"allowlistRules\":[],\"denylistRules\":[]},\"id\":\"dwzjeiach\",\"name\":\"oosflnr\",\"type\":\"sfqpteehz\"}],\"nextLink\":\"ypyqrimzinp\"}") - .toObject(DeviceSecurityGroupList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceSecurityGroupList model = - new DeviceSecurityGroupList() - .withValue( - Arrays - .asList( - new DeviceSecurityGroupInner() - .withThresholdRules(Arrays.asList()) - .withTimeWindowRules(Arrays.asList()) - .withAllowlistRules(Arrays.asList()) - .withDenylistRules(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(DeviceSecurityGroupList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupPropertiesTests.java deleted file mode 100644 index 47dc2d1aac55..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupPropertiesTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.DeviceSecurityGroupProperties; -import com.azure.resourcemanager.security.models.AllowlistCustomAlertRule; -import com.azure.resourcemanager.security.models.DenylistCustomAlertRule; -import com.azure.resourcemanager.security.models.ThresholdCustomAlertRule; -import com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule; -import java.time.Duration; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DeviceSecurityGroupPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DeviceSecurityGroupProperties model = - BinaryData - .fromString( - "{\"thresholdRules\":[{\"ruleType\":\"ThresholdCustomAlertRule\",\"minThreshold\":396023335,\"maxThreshold\":1635783635,\"displayName\":\"dtocj\",\"description\":\"hvpmoue\",\"isEnabled\":false}],\"timeWindowRules\":[{\"ruleType\":\"TimeWindowCustomAlertRule\",\"timeWindowSize\":\"PT62H8M23S\",\"minThreshold\":229644058,\"maxThreshold\":738311617,\"displayName\":\"eojnxqbzvddn\",\"description\":\"ndei\",\"isEnabled\":true},{\"ruleType\":\"TimeWindowCustomAlertRule\",\"timeWindowSize\":\"PT35H10M37S\",\"minThreshold\":206399167,\"maxThreshold\":1604770276,\"displayName\":\"zao\",\"description\":\"uhrhcffcyddgl\",\"isEnabled\":true}],\"allowlistRules\":[{\"ruleType\":\"AllowlistCustomAlertRule\",\"allowlistValues\":[\"qkwpyeicxmqc\",\"wqvhkhixuigdt\",\"pbobjo\"],\"valueType\":\"IpCidr\",\"displayName\":\"w\",\"description\":\"m\",\"isEnabled\":true}],\"denylistRules\":[{\"ruleType\":\"DenylistCustomAlertRule\",\"denylistValues\":[\"ayvvtpgvdf\"],\"valueType\":\"String\",\"displayName\":\"kftutqxlngxlefg\",\"description\":\"nxkrx\",\"isEnabled\":false},{\"ruleType\":\"DenylistCustomAlertRule\",\"denylistValues\":[\"i\"],\"valueType\":\"IpCidr\",\"displayName\":\"zrvqdr\",\"description\":\"hjybigehoqfbo\",\"isEnabled\":false}]}") - .toObject(DeviceSecurityGroupProperties.class); - Assertions.assertEquals(false, model.thresholdRules().get(0).isEnabled()); - Assertions.assertEquals(396023335, model.thresholdRules().get(0).minThreshold()); - Assertions.assertEquals(1635783635, model.thresholdRules().get(0).maxThreshold()); - Assertions.assertEquals(true, model.timeWindowRules().get(0).isEnabled()); - Assertions.assertEquals(229644058, model.timeWindowRules().get(0).minThreshold()); - Assertions.assertEquals(738311617, model.timeWindowRules().get(0).maxThreshold()); - Assertions.assertEquals(Duration.parse("PT62H8M23S"), model.timeWindowRules().get(0).timeWindowSize()); - Assertions.assertEquals(true, model.allowlistRules().get(0).isEnabled()); - Assertions.assertEquals("qkwpyeicxmqc", model.allowlistRules().get(0).allowlistValues().get(0)); - Assertions.assertEquals(false, model.denylistRules().get(0).isEnabled()); - Assertions.assertEquals("ayvvtpgvdf", model.denylistRules().get(0).denylistValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DeviceSecurityGroupProperties model = - new DeviceSecurityGroupProperties() - .withThresholdRules( - Arrays - .asList( - new ThresholdCustomAlertRule() - .withIsEnabled(false) - .withMinThreshold(396023335) - .withMaxThreshold(1635783635))) - .withTimeWindowRules( - Arrays - .asList( - new TimeWindowCustomAlertRule() - .withIsEnabled(true) - .withMinThreshold(229644058) - .withMaxThreshold(738311617) - .withTimeWindowSize(Duration.parse("PT62H8M23S")), - new TimeWindowCustomAlertRule() - .withIsEnabled(true) - .withMinThreshold(206399167) - .withMaxThreshold(1604770276) - .withTimeWindowSize(Duration.parse("PT35H10M37S")))) - .withAllowlistRules( - Arrays - .asList( - new AllowlistCustomAlertRule() - .withIsEnabled(true) - .withAllowlistValues(Arrays.asList("qkwpyeicxmqc", "wqvhkhixuigdt", "pbobjo")))) - .withDenylistRules( - Arrays - .asList( - new DenylistCustomAlertRule() - .withIsEnabled(false) - .withDenylistValues(Arrays.asList("ayvvtpgvdf")), - new DenylistCustomAlertRule().withIsEnabled(false).withDenylistValues(Arrays.asList("i")))); - model = BinaryData.fromObject(model).toObject(DeviceSecurityGroupProperties.class); - Assertions.assertEquals(false, model.thresholdRules().get(0).isEnabled()); - Assertions.assertEquals(396023335, model.thresholdRules().get(0).minThreshold()); - Assertions.assertEquals(1635783635, model.thresholdRules().get(0).maxThreshold()); - Assertions.assertEquals(true, model.timeWindowRules().get(0).isEnabled()); - Assertions.assertEquals(229644058, model.timeWindowRules().get(0).minThreshold()); - Assertions.assertEquals(738311617, model.timeWindowRules().get(0).maxThreshold()); - Assertions.assertEquals(Duration.parse("PT62H8M23S"), model.timeWindowRules().get(0).timeWindowSize()); - Assertions.assertEquals(true, model.allowlistRules().get(0).isEnabled()); - Assertions.assertEquals("qkwpyeicxmqc", model.allowlistRules().get(0).allowlistValues().get(0)); - Assertions.assertEquals(false, model.denylistRules().get(0).isEnabled()); - Assertions.assertEquals("ayvvtpgvdf", model.denylistRules().get(0).denylistValues().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index c7fd3563d617..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DeviceSecurityGroup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DeviceSecurityGroupsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"thresholdRules\":[],\"timeWindowRules\":[],\"allowlistRules\":[],\"denylistRules\":[]},\"id\":\"stewfop\",\"name\":\"z\",\"type\":\"azgbsqgpe\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DeviceSecurityGroup response = - manager - .deviceSecurityGroups() - .define("ylt") - .withExistingResourceId("nquktrfnslnlrxs") - .withThresholdRules(Arrays.asList()) - .withTimeWindowRules(Arrays.asList()) - .withAllowlistRules(Arrays.asList()) - .withDenylistRules(Arrays.asList()) - .create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 73bd48834292..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DeviceSecurityGroupsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .deviceSecurityGroups() - .deleteByResourceGroupWithResponse("suenyg", "xcgjtf", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetWithResponseMockTests.java deleted file mode 100644 index 8c94dddd61d8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DeviceSecurityGroup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DeviceSecurityGroupsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"thresholdRules\":[],\"timeWindowRules\":[],\"allowlistRules\":[],\"denylistRules\":[]},\"id\":\"hsoymhpvtyqf\",\"name\":\"tehdpboujs\",\"type\":\"kfvvdshxcde\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DeviceSecurityGroup response = - manager - .deviceSecurityGroups() - .getWithResponse("aiossscyvaifp", "uacvfy", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListMockTests.java deleted file mode 100644 index 83dbf8c17a89..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DeviceSecurityGroupsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DeviceSecurityGroup; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DeviceSecurityGroupsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"thresholdRules\":[],\"timeWindowRules\":[],\"allowlistRules\":[],\"denylistRules\":[]},\"id\":\"xqceazfpxgn\",\"name\":\"qvzvlu\",\"type\":\"q\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.deviceSecurityGroups().list("gfii", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DirectMethodInvokesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DirectMethodInvokesNotInAllowedRangeTests.java deleted file mode 100644 index 2b4f41c6f6c5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DirectMethodInvokesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.DirectMethodInvokesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class DirectMethodInvokesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DirectMethodInvokesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"DirectMethodInvokesNotInAllowedRange\",\"timeWindowSize\":\"PT14H59M6S\",\"minThreshold\":2142539902,\"maxThreshold\":629230880,\"displayName\":\"isczskoswo\",\"description\":\"qazu\",\"isEnabled\":false}") - .toObject(DirectMethodInvokesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(2142539902, model.minThreshold()); - Assertions.assertEquals(629230880, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT14H59M6S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DirectMethodInvokesNotInAllowedRange model = - new DirectMethodInvokesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(2142539902) - .withMaxThreshold(629230880) - .withTimeWindowSize(Duration.parse("PT14H59M6S")); - model = BinaryData.fromObject(model).toObject(DirectMethodInvokesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(2142539902, model.minThreshold()); - Assertions.assertEquals(629230880, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT14H59M6S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionInnerTests.java deleted file mode 100644 index cb5568d6247e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; -import com.azure.resourcemanager.security.models.SecurityFamily; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveredSecuritySolutionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveredSecuritySolutionInner model = - BinaryData - .fromString( - "{\"properties\":{\"securityFamily\":\"Waf\",\"offer\":\"pbswvefloccsrm\",\"publisher\":\"zihmipgawtxxpky\",\"sku\":\"cxcjxgry\"},\"location\":\"mpcycilrmcaykgg\",\"id\":\"oxuztrksx\",\"name\":\"pndfcpfnznt\",\"type\":\"jtwkjaos\"}") - .toObject(DiscoveredSecuritySolutionInner.class); - Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily()); - Assertions.assertEquals("pbswvefloccsrm", model.offer()); - Assertions.assertEquals("zihmipgawtxxpky", model.publisher()); - Assertions.assertEquals("cxcjxgry", model.sku()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiscoveredSecuritySolutionInner model = - new DiscoveredSecuritySolutionInner() - .withSecurityFamily(SecurityFamily.WAF) - .withOffer("pbswvefloccsrm") - .withPublisher("zihmipgawtxxpky") - .withSku("cxcjxgry"); - model = BinaryData.fromObject(model).toObject(DiscoveredSecuritySolutionInner.class); - Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily()); - Assertions.assertEquals("pbswvefloccsrm", model.offer()); - Assertions.assertEquals("zihmipgawtxxpky", model.publisher()); - Assertions.assertEquals("cxcjxgry", model.sku()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionListTests.java deleted file mode 100644 index 6014a76ff0f3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionListTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionInner; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolutionList; -import com.azure.resourcemanager.security.models.SecurityFamily; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveredSecuritySolutionListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveredSecuritySolutionList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"securityFamily\":\"Ngfw\",\"offer\":\"ptfujgicgaaoept\",\"publisher\":\"aqutdewemxswvruu\",\"sku\":\"zzjgehkfki\"},\"location\":\"tixo\",\"id\":\"ffqyinlj\",\"name\":\"epqw\",\"type\":\"ixmonstshiyxg\"},{\"properties\":{\"securityFamily\":\"SaasWaf\",\"offer\":\"lfcldu\",\"publisher\":\"cb\",\"sku\":\"rds\"},\"location\":\"wcobie\",\"id\":\"stmninwjizcilng\",\"name\":\"gshejjtbxqmulux\",\"type\":\"xqzv\"},{\"properties\":{\"securityFamily\":\"Waf\",\"offer\":\"rsbycucrwn\",\"publisher\":\"mikzeb\",\"sku\":\"qbsms\"},\"location\":\"iqg\",\"id\":\"uhok\",\"name\":\"ruswhv\",\"type\":\"czznvfbycjsxj\"},{\"properties\":{\"securityFamily\":\"Waf\",\"offer\":\"i\",\"publisher\":\"z\",\"sku\":\"umwmxqhnd\"},\"location\":\"oamld\",\"id\":\"ehaohdjhh\",\"name\":\"lzok\",\"type\":\"coxpelnjeta\"}],\"nextLink\":\"tsxoatftgz\"}") - .toObject(DiscoveredSecuritySolutionList.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.value().get(0).securityFamily()); - Assertions.assertEquals("ptfujgicgaaoept", model.value().get(0).offer()); - Assertions.assertEquals("aqutdewemxswvruu", model.value().get(0).publisher()); - Assertions.assertEquals("zzjgehkfki", model.value().get(0).sku()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiscoveredSecuritySolutionList model = - new DiscoveredSecuritySolutionList() - .withValue( - Arrays - .asList( - new DiscoveredSecuritySolutionInner() - .withSecurityFamily(SecurityFamily.NGFW) - .withOffer("ptfujgicgaaoept") - .withPublisher("aqutdewemxswvruu") - .withSku("zzjgehkfki"), - new DiscoveredSecuritySolutionInner() - .withSecurityFamily(SecurityFamily.SAAS_WAF) - .withOffer("lfcldu") - .withPublisher("cb") - .withSku("rds"), - new DiscoveredSecuritySolutionInner() - .withSecurityFamily(SecurityFamily.WAF) - .withOffer("rsbycucrwn") - .withPublisher("mikzeb") - .withSku("qbsms"), - new DiscoveredSecuritySolutionInner() - .withSecurityFamily(SecurityFamily.WAF) - .withOffer("i") - .withPublisher("z") - .withSku("umwmxqhnd"))); - model = BinaryData.fromObject(model).toObject(DiscoveredSecuritySolutionList.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.value().get(0).securityFamily()); - Assertions.assertEquals("ptfujgicgaaoept", model.value().get(0).offer()); - Assertions.assertEquals("aqutdewemxswvruu", model.value().get(0).publisher()); - Assertions.assertEquals("zzjgehkfki", model.value().get(0).sku()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionPropertiesTests.java deleted file mode 100644 index 0c9f26a3f1b1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionPropertiesTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.DiscoveredSecuritySolutionProperties; -import com.azure.resourcemanager.security.models.SecurityFamily; -import org.junit.jupiter.api.Assertions; - -public final class DiscoveredSecuritySolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DiscoveredSecuritySolutionProperties model = - BinaryData - .fromString( - "{\"securityFamily\":\"SaasWaf\",\"offer\":\"uzvoamktcqiosm\",\"publisher\":\"bzahgxqd\",\"sku\":\"yrtltlaprltzkat\"}") - .toObject(DiscoveredSecuritySolutionProperties.class); - Assertions.assertEquals(SecurityFamily.SAAS_WAF, model.securityFamily()); - Assertions.assertEquals("uzvoamktcqiosm", model.offer()); - Assertions.assertEquals("bzahgxqd", model.publisher()); - Assertions.assertEquals("yrtltlaprltzkat", model.sku()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DiscoveredSecuritySolutionProperties model = - new DiscoveredSecuritySolutionProperties() - .withSecurityFamily(SecurityFamily.SAAS_WAF) - .withOffer("uzvoamktcqiosm") - .withPublisher("bzahgxqd") - .withSku("yrtltlaprltzkat"); - model = BinaryData.fromObject(model).toObject(DiscoveredSecuritySolutionProperties.class); - Assertions.assertEquals(SecurityFamily.SAAS_WAF, model.securityFamily()); - Assertions.assertEquals("uzvoamktcqiosm", model.offer()); - Assertions.assertEquals("bzahgxqd", model.publisher()); - Assertions.assertEquals("yrtltlaprltzkat", model.sku()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetWithResponseMockTests.java deleted file mode 100644 index bba3ec5377fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsGetWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolution; -import com.azure.resourcemanager.security.models.SecurityFamily; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DiscoveredSecuritySolutionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"securityFamily\":\"Va\",\"offer\":\"wushlcxpbl\",\"publisher\":\"lhh\",\"sku\":\"zpfkis\"},\"location\":\"idqzsaaoqdsgpto\",\"id\":\"xjqfiafcnlrtbfi\",\"name\":\"zzcaoijolbuauk\",\"type\":\"wieopexelxqdw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - DiscoveredSecuritySolution response = - manager - .discoveredSecuritySolutions() - .getWithResponse("biwksde", "yxsbfpz", "oikvntwcz", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(SecurityFamily.VA, response.securityFamily()); - Assertions.assertEquals("wushlcxpbl", response.offer()); - Assertions.assertEquals("lhh", response.publisher()); - Assertions.assertEquals("zpfkis", response.sku()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionMockTests.java deleted file mode 100644 index 81c3536a9870..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListByHomeRegionMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolution; -import com.azure.resourcemanager.security.models.SecurityFamily; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DiscoveredSecuritySolutionsListByHomeRegionMockTests { - @Test - public void testListByHomeRegion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"securityFamily\":\"Va\",\"offer\":\"kll\",\"publisher\":\"ynqanhkigglc\",\"sku\":\"walhvubh\"},\"location\":\"phetxdqc\",\"id\":\"yctajqz\",\"name\":\"vale\",\"type\":\"xb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.discoveredSecuritySolutions().listByHomeRegion("tpzcr", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(SecurityFamily.VA, response.iterator().next().securityFamily()); - Assertions.assertEquals("kll", response.iterator().next().offer()); - Assertions.assertEquals("ynqanhkigglc", response.iterator().next().publisher()); - Assertions.assertEquals("walhvubh", response.iterator().next().sku()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListMockTests.java deleted file mode 100644 index 56bea0638685..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/DiscoveredSecuritySolutionsListMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DiscoveredSecuritySolution; -import com.azure.resourcemanager.security.models.SecurityFamily; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class DiscoveredSecuritySolutionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"securityFamily\":\"Waf\",\"offer\":\"qpzfzxsoxin\",\"publisher\":\"nj\",\"sku\":\"zkdrocqsxy\"},\"location\":\"qtcmiwdwisv\",\"id\":\"mey\",\"name\":\"ajamc\",\"type\":\"jyh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.discoveredSecuritySolutions().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals(SecurityFamily.WAF, response.iterator().next().securityFamily()); - Assertions.assertEquals("qpzfzxsoxin", response.iterator().next().offer()); - Assertions.assertEquals("nj", response.iterator().next().publisher()); - Assertions.assertEquals("zkdrocqsxy", response.iterator().next().sku()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EffectiveNetworkSecurityGroupsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EffectiveNetworkSecurityGroupsTests.java deleted file mode 100644 index 27e2fa27461e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EffectiveNetworkSecurityGroupsTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.EffectiveNetworkSecurityGroups; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class EffectiveNetworkSecurityGroupsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EffectiveNetworkSecurityGroups model = - BinaryData - .fromString( - "{\"networkInterface\":\"aeranokqgukkjqnv\",\"networkSecurityGroups\":[\"ylaxxulcdi\",\"dosfjbjsvgjrw\"]}") - .toObject(EffectiveNetworkSecurityGroups.class); - Assertions.assertEquals("aeranokqgukkjqnv", model.networkInterface()); - Assertions.assertEquals("ylaxxulcdi", model.networkSecurityGroups().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EffectiveNetworkSecurityGroups model = - new EffectiveNetworkSecurityGroups() - .withNetworkInterface("aeranokqgukkjqnv") - .withNetworkSecurityGroups(Arrays.asList("ylaxxulcdi", "dosfjbjsvgjrw")); - model = BinaryData.fromObject(model).toObject(EffectiveNetworkSecurityGroups.class); - Assertions.assertEquals("aeranokqgukkjqnv", model.networkInterface()); - Assertions.assertEquals("ylaxxulcdi", model.networkSecurityGroups().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EnvironmentDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EnvironmentDataTests.java deleted file mode 100644 index b86d82d1f6e7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EnvironmentDataTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.EnvironmentData; - -public final class EnvironmentDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentData model = - BinaryData.fromString("{\"environmentType\":\"EnvironmentData\"}").toObject(EnvironmentData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentData model = new EnvironmentData(); - model = BinaryData.fromObject(model).toObject(EnvironmentData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EnvironmentDetailsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EnvironmentDetailsTests.java deleted file mode 100644 index c3dc5e78c780..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EnvironmentDetailsTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.EnvironmentDetails; -import org.junit.jupiter.api.Assertions; - -public final class EnvironmentDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - EnvironmentDetails model = - BinaryData - .fromString( - "{\"nativeResourceId\":\"lohap\",\"environmentHierarchyId\":\"nfszpyglqdhmrjz\",\"organizationalHierarchyId\":\"l\",\"subscriptionId\":\"pjby\",\"tenantId\":\"sjoqcjenkyhfqzvs\"}") - .toObject(EnvironmentDetails.class); - Assertions.assertEquals("lohap", model.nativeResourceId()); - Assertions.assertEquals("nfszpyglqdhmrjz", model.environmentHierarchyId()); - Assertions.assertEquals("l", model.organizationalHierarchyId()); - Assertions.assertEquals("pjby", model.subscriptionId()); - Assertions.assertEquals("sjoqcjenkyhfqzvs", model.tenantId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - EnvironmentDetails model = - new EnvironmentDetails() - .withNativeResourceId("lohap") - .withEnvironmentHierarchyId("nfszpyglqdhmrjz") - .withOrganizationalHierarchyId("l") - .withSubscriptionId("pjby") - .withTenantId("sjoqcjenkyhfqzvs"); - model = BinaryData.fromObject(model).toObject(EnvironmentDetails.class); - Assertions.assertEquals("lohap", model.nativeResourceId()); - Assertions.assertEquals("nfszpyglqdhmrjz", model.environmentHierarchyId()); - Assertions.assertEquals("l", model.organizationalHierarchyId()); - Assertions.assertEquals("pjby", model.subscriptionId()); - Assertions.assertEquals("sjoqcjenkyhfqzvs", model.tenantId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EtagTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EtagTests.java deleted file mode 100644 index f338b94dfa01..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/EtagTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Etag; -import org.junit.jupiter.api.Assertions; - -public final class EtagTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Etag model = BinaryData.fromString("{\"etag\":\"jw\"}").toObject(Etag.class); - Assertions.assertEquals("jw", model.etag()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Etag model = new Etag().withEtag("jw"); - model = BinaryData.fromObject(model).toObject(Etag.class); - Assertions.assertEquals("jw", model.etag()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExecuteGovernanceRuleParamsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExecuteGovernanceRuleParamsTests.java deleted file mode 100644 index 629bc806b651..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExecuteGovernanceRuleParamsTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ExecuteGovernanceRuleParams; -import org.junit.jupiter.api.Assertions; - -public final class ExecuteGovernanceRuleParamsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExecuteGovernanceRuleParams model = - BinaryData.fromString("{\"override\":true}").toObject(ExecuteGovernanceRuleParams.class); - Assertions.assertEquals(true, model.override()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExecuteGovernanceRuleParams model = new ExecuteGovernanceRuleParams().withOverride(true); - model = BinaryData.fromObject(model).toObject(ExecuteGovernanceRuleParams.class); - Assertions.assertEquals(true, model.override()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionInnerTests.java deleted file mode 100644 index c7243563ce05..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; - -public final class ExternalSecuritySolutionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalSecuritySolutionInner model = - BinaryData - .fromString( - "{\"kind\":\"ExternalSecuritySolution\",\"location\":\"ddoui\",\"id\":\"amowaziynknlqwzd\",\"name\":\"piwhxqs\",\"type\":\"dtmaa\"}") - .toObject(ExternalSecuritySolutionInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalSecuritySolutionInner model = new ExternalSecuritySolutionInner(); - model = BinaryData.fromObject(model).toObject(ExternalSecuritySolutionInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionListTests.java deleted file mode 100644 index 2df85c8b0656..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionListTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ExternalSecuritySolutionInner; -import com.azure.resourcemanager.security.models.ExternalSecuritySolutionList; -import java.util.Arrays; - -public final class ExternalSecuritySolutionListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalSecuritySolutionList model = - BinaryData - .fromString( - "{\"value\":[{\"kind\":\"ExternalSecuritySolution\",\"location\":\"ozxwopd\",\"id\":\"yd\",\"name\":\"izqaclnapxbiyg\",\"type\":\"ugjknf\"},{\"kind\":\"ExternalSecuritySolution\",\"location\":\"fcttuxuuyilfl\",\"id\":\"oiquvrehmrnjhvs\",\"name\":\"jztczytqj\",\"type\":\"w\"}],\"nextLink\":\"uunfprnjletlxsm\"}") - .toObject(ExternalSecuritySolutionList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalSecuritySolutionList model = - new ExternalSecuritySolutionList() - .withValue(Arrays.asList(new ExternalSecuritySolutionInner(), new ExternalSecuritySolutionInner())); - model = BinaryData.fromObject(model).toObject(ExternalSecuritySolutionList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionPropertiesTests.java deleted file mode 100644 index f6debc2322d6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionPropertiesTests.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConnectedWorkspace; -import com.azure.resourcemanager.security.models.ExternalSecuritySolutionProperties; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ExternalSecuritySolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExternalSecuritySolutionProperties model = - BinaryData - .fromString( - "{\"deviceVendor\":\"rbzg\",\"deviceType\":\"oxqmjeajc\",\"workspace\":{\"id\":\"qg\"},\"\":{\"simjceagbjqvlsu\":\"datausrvx\",\"gon\":\"dataywzash\"}}") - .toObject(ExternalSecuritySolutionProperties.class); - Assertions.assertEquals("rbzg", model.deviceVendor()); - Assertions.assertEquals("oxqmjeajc", model.deviceType()); - Assertions.assertEquals("qg", model.workspace().id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExternalSecuritySolutionProperties model = - new ExternalSecuritySolutionProperties() - .withDeviceVendor("rbzg") - .withDeviceType("oxqmjeajc") - .withWorkspace(new ConnectedWorkspace().withId("qg")) - .withAdditionalProperties(mapOf()); - model = BinaryData.fromObject(model).toObject(ExternalSecuritySolutionProperties.class); - Assertions.assertEquals("rbzg", model.deviceVendor()); - Assertions.assertEquals("oxqmjeajc", model.deviceType()); - Assertions.assertEquals("qg", model.workspace().id()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetWithResponseMockTests.java deleted file mode 100644 index 4ef34cd40f2a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ExternalSecuritySolution; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExternalSecuritySolutionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"kind\":\"ExternalSecuritySolution\",\"location\":\"jfccylhtrht\",\"id\":\"vazjpwexcd\",\"name\":\"zp\",\"type\":\"o\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ExternalSecuritySolution response = - manager - .externalSecuritySolutions() - .getWithResponse("atpf", "saebwfwhxorpwal", "zwuge", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionMockTests.java deleted file mode 100644 index 5d91ab8dbdc5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListByHomeRegionMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ExternalSecuritySolution; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExternalSecuritySolutionsListByHomeRegionMockTests { - @Test - public void testListByHomeRegion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"kind\":\"ExternalSecuritySolution\",\"location\":\"i\",\"id\":\"moxrezsvavlrxi\",\"name\":\"jmoywlunpipcwybs\",\"type\":\"fncn\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.externalSecuritySolutions().listByHomeRegion("ujx", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListMockTests.java deleted file mode 100644 index 8072f7d85223..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ExternalSecuritySolutionsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ExternalSecuritySolution; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExternalSecuritySolutionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"kind\":\"ExternalSecuritySolution\",\"location\":\"we\",\"id\":\"yjshcyb\",\"name\":\"fuppoxprc\",\"type\":\"vo\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.externalSecuritySolutions().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/FailedLocalLoginsNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/FailedLocalLoginsNotInAllowedRangeTests.java deleted file mode 100644 index 877d8b1952ce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/FailedLocalLoginsNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.FailedLocalLoginsNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class FailedLocalLoginsNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FailedLocalLoginsNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"FailedLocalLoginsNotInAllowedRange\",\"timeWindowSize\":\"PT78H46M30S\",\"minThreshold\":1982738288,\"maxThreshold\":589538374,\"displayName\":\"rrcoi\",\"description\":\"bamnppcc\",\"isEnabled\":true}") - .toObject(FailedLocalLoginsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1982738288, model.minThreshold()); - Assertions.assertEquals(589538374, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT78H46M30S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FailedLocalLoginsNotInAllowedRange model = - new FailedLocalLoginsNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(1982738288) - .withMaxThreshold(589538374) - .withTimeWindowSize(Duration.parse("PT78H46M30S")); - model = BinaryData.fromObject(model).toObject(FailedLocalLoginsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1982738288, model.minThreshold()); - Assertions.assertEquals(589538374, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT78H46M30S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/FileUploadsNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/FileUploadsNotInAllowedRangeTests.java deleted file mode 100644 index 3acdccdb7ac3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/FileUploadsNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.FileUploadsNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class FileUploadsNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FileUploadsNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"FileUploadsNotInAllowedRange\",\"timeWindowSize\":\"PT179H50M54S\",\"minThreshold\":2061950840,\"maxThreshold\":2123887167,\"displayName\":\"sbezaxyfukzxuizh\",\"description\":\"nepk\",\"isEnabled\":true}") - .toObject(FileUploadsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(2061950840, model.minThreshold()); - Assertions.assertEquals(2123887167, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT179H50M54S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FileUploadsNotInAllowedRange model = - new FileUploadsNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(2061950840) - .withMaxThreshold(2123887167) - .withTimeWindowSize(Duration.parse("PT179H50M54S")); - model = BinaryData.fromObject(model).toObject(FileUploadsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(2061950840, model.minThreshold()); - Assertions.assertEquals(2123887167, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT179H50M54S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataMemberTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataMemberTests.java deleted file mode 100644 index c31950361d1f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataMemberTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GcpOrganizationalDataMember; -import org.junit.jupiter.api.Assertions; - -public final class GcpOrganizationalDataMemberTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GcpOrganizationalDataMember model = - BinaryData - .fromString( - "{\"organizationMembershipType\":\"Member\",\"parentHierarchyId\":\"atxtjrrlkmdskjhh\",\"managementProjectNumber\":\"lajfoxcxscvslxlh\"}") - .toObject(GcpOrganizationalDataMember.class); - Assertions.assertEquals("atxtjrrlkmdskjhh", model.parentHierarchyId()); - Assertions.assertEquals("lajfoxcxscvslxlh", model.managementProjectNumber()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GcpOrganizationalDataMember model = - new GcpOrganizationalDataMember() - .withParentHierarchyId("atxtjrrlkmdskjhh") - .withManagementProjectNumber("lajfoxcxscvslxlh"); - model = BinaryData.fromObject(model).toObject(GcpOrganizationalDataMember.class); - Assertions.assertEquals("atxtjrrlkmdskjhh", model.parentHierarchyId()); - Assertions.assertEquals("lajfoxcxscvslxlh", model.managementProjectNumber()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataOrganizationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataOrganizationTests.java deleted file mode 100644 index da7ac224d1dc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataOrganizationTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GcpOrganizationalDataOrganization; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GcpOrganizationalDataOrganizationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GcpOrganizationalDataOrganization model = - BinaryData - .fromString( - "{\"organizationMembershipType\":\"Organization\",\"excludedProjectNumbers\":[\"rlefgnaavu\",\"gnteta\",\"utnpdctuhspfefyi\",\"duyeuyl\"],\"serviceAccountEmailAddress\":\"hmtybkcgsuthhll\",\"workloadIdentityProviderId\":\"wynefx\",\"organizationName\":\"lf\"}") - .toObject(GcpOrganizationalDataOrganization.class); - Assertions.assertEquals("rlefgnaavu", model.excludedProjectNumbers().get(0)); - Assertions.assertEquals("hmtybkcgsuthhll", model.serviceAccountEmailAddress()); - Assertions.assertEquals("wynefx", model.workloadIdentityProviderId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GcpOrganizationalDataOrganization model = - new GcpOrganizationalDataOrganization() - .withExcludedProjectNumbers(Arrays.asList("rlefgnaavu", "gnteta", "utnpdctuhspfefyi", "duyeuyl")) - .withServiceAccountEmailAddress("hmtybkcgsuthhll") - .withWorkloadIdentityProviderId("wynefx"); - model = BinaryData.fromObject(model).toObject(GcpOrganizationalDataOrganization.class); - Assertions.assertEquals("rlefgnaavu", model.excludedProjectNumbers().get(0)); - Assertions.assertEquals("hmtybkcgsuthhll", model.serviceAccountEmailAddress()); - Assertions.assertEquals("wynefx", model.workloadIdentityProviderId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataTests.java deleted file mode 100644 index 0249f77d9859..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpOrganizationalDataTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GcpOrganizationalData; - -public final class GcpOrganizationalDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GcpOrganizationalData model = - BinaryData - .fromString("{\"organizationMembershipType\":\"GcpOrganizationalData\"}") - .toObject(GcpOrganizationalData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GcpOrganizationalData model = new GcpOrganizationalData(); - model = BinaryData.fromObject(model).toObject(GcpOrganizationalData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpProjectDetailsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpProjectDetailsTests.java deleted file mode 100644 index 5aafb2dce0c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpProjectDetailsTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GcpProjectDetails; -import org.junit.jupiter.api.Assertions; - -public final class GcpProjectDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GcpProjectDetails model = - BinaryData - .fromString( - "{\"projectNumber\":\"rsidqpxlbtpakf\",\"projectId\":\"gatwmykyu\",\"workloadIdentityPoolId\":\"ym\",\"projectName\":\"mfjhpycvjqdvdwkq\"}") - .toObject(GcpProjectDetails.class); - Assertions.assertEquals("rsidqpxlbtpakf", model.projectNumber()); - Assertions.assertEquals("gatwmykyu", model.projectId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GcpProjectDetails model = - new GcpProjectDetails().withProjectNumber("rsidqpxlbtpakf").withProjectId("gatwmykyu"); - model = BinaryData.fromObject(model).toObject(GcpProjectDetails.class); - Assertions.assertEquals("rsidqpxlbtpakf", model.projectNumber()); - Assertions.assertEquals("gatwmykyu", model.projectId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpProjectEnvironmentDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpProjectEnvironmentDataTests.java deleted file mode 100644 index b9609d7436ab..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GcpProjectEnvironmentDataTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GcpOrganizationalData; -import com.azure.resourcemanager.security.models.GcpProjectDetails; -import com.azure.resourcemanager.security.models.GcpProjectEnvironmentData; -import org.junit.jupiter.api.Assertions; - -public final class GcpProjectEnvironmentDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GcpProjectEnvironmentData model = - BinaryData - .fromString( - "{\"environmentType\":\"GcpProject\",\"organizationalData\":{\"organizationMembershipType\":\"GcpOrganizationalData\"},\"projectDetails\":{\"projectNumber\":\"dfpdqwtygevg\",\"projectId\":\"sehar\",\"workloadIdentityPoolId\":\"fv\",\"projectName\":\"rxtmbpjptnvw\"}}") - .toObject(GcpProjectEnvironmentData.class); - Assertions.assertEquals("dfpdqwtygevg", model.projectDetails().projectNumber()); - Assertions.assertEquals("sehar", model.projectDetails().projectId()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GcpProjectEnvironmentData model = - new GcpProjectEnvironmentData() - .withOrganizationalData(new GcpOrganizationalData()) - .withProjectDetails(new GcpProjectDetails().withProjectNumber("dfpdqwtygevg").withProjectId("sehar")); - model = BinaryData.fromObject(model).toObject(GcpProjectEnvironmentData.class); - Assertions.assertEquals("dfpdqwtygevg", model.projectDetails().projectNumber()); - Assertions.assertEquals("sehar", model.projectDetails().projectId()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GithubScopeEnvironmentDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GithubScopeEnvironmentDataTests.java deleted file mode 100644 index 417e9df0ab9e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GithubScopeEnvironmentDataTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GithubScopeEnvironmentData; - -public final class GithubScopeEnvironmentDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GithubScopeEnvironmentData model = - BinaryData.fromString("{\"environmentType\":\"GithubScope\"}").toObject(GithubScopeEnvironmentData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GithubScopeEnvironmentData model = new GithubScopeEnvironmentData(); - model = BinaryData.fromObject(model).toObject(GithubScopeEnvironmentData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitlabScopeEnvironmentDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitlabScopeEnvironmentDataTests.java deleted file mode 100644 index 4d3f168d78d2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GitlabScopeEnvironmentDataTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GitlabScopeEnvironmentData; - -public final class GitlabScopeEnvironmentDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GitlabScopeEnvironmentData model = - BinaryData.fromString("{\"environmentType\":\"GitlabScope\"}").toObject(GitlabScopeEnvironmentData.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GitlabScopeEnvironmentData model = new GitlabScopeEnvironmentData(); - model = BinaryData.fromObject(model).toObject(GitlabScopeEnvironmentData.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentAdditionalDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentAdditionalDataTests.java deleted file mode 100644 index 136043399b91..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentAdditionalDataTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceAssignmentAdditionalDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceAssignmentAdditionalData model = - BinaryData - .fromString("{\"ticketNumber\":885021040,\"ticketLink\":\"njuhpsprkzya\",\"ticketStatus\":\"ia\"}") - .toObject(GovernanceAssignmentAdditionalData.class); - Assertions.assertEquals(885021040, model.ticketNumber()); - Assertions.assertEquals("njuhpsprkzya", model.ticketLink()); - Assertions.assertEquals("ia", model.ticketStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceAssignmentAdditionalData model = - new GovernanceAssignmentAdditionalData() - .withTicketNumber(885021040) - .withTicketLink("njuhpsprkzya") - .withTicketStatus("ia"); - model = BinaryData.fromObject(model).toObject(GovernanceAssignmentAdditionalData.class); - Assertions.assertEquals(885021040, model.ticketNumber()); - Assertions.assertEquals("njuhpsprkzya", model.ticketLink()); - Assertions.assertEquals("ia", model.ticketStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentInnerTests.java deleted file mode 100644 index c48520226212..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentInnerTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentInner; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceAssignmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceAssignmentInner model = - BinaryData - .fromString( - "{\"properties\":{\"owner\":\"wzfgbrttuiaclkie\",\"remediationDueDate\":\"2021-01-24T04:29:25Z\",\"remediationEta\":{\"eta\":\"2021-03-15T08:06:52Z\",\"justification\":\"lfnthiqfyut\"},\"isGracePeriod\":false,\"governanceEmailNotification\":{\"disableManagerEmailNotification\":false,\"disableOwnerEmailNotification\":false},\"additionalData\":{\"ticketNumber\":1375874232,\"ticketLink\":\"mtx\",\"ticketStatus\":\"ctwwgzw\"}},\"id\":\"jlmec\",\"name\":\"og\",\"type\":\"gzyvnee\"}") - .toObject(GovernanceAssignmentInner.class); - Assertions.assertEquals("wzfgbrttuiaclkie", model.owner()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-24T04:29:25Z"), model.remediationDueDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-15T08:06:52Z"), model.remediationEta().eta()); - Assertions.assertEquals("lfnthiqfyut", model.remediationEta().justification()); - Assertions.assertEquals(false, model.isGracePeriod()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableOwnerEmailNotification()); - Assertions.assertEquals(1375874232, model.additionalData().ticketNumber()); - Assertions.assertEquals("mtx", model.additionalData().ticketLink()); - Assertions.assertEquals("ctwwgzw", model.additionalData().ticketStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceAssignmentInner model = - new GovernanceAssignmentInner() - .withOwner("wzfgbrttuiaclkie") - .withRemediationDueDate(OffsetDateTime.parse("2021-01-24T04:29:25Z")) - .withRemediationEta( - new RemediationEta() - .withEta(OffsetDateTime.parse("2021-03-15T08:06:52Z")) - .withJustification("lfnthiqfyut")) - .withIsGracePeriod(false) - .withGovernanceEmailNotification( - new GovernanceEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(false)) - .withAdditionalData( - new GovernanceAssignmentAdditionalData() - .withTicketNumber(1375874232) - .withTicketLink("mtx") - .withTicketStatus("ctwwgzw")); - model = BinaryData.fromObject(model).toObject(GovernanceAssignmentInner.class); - Assertions.assertEquals("wzfgbrttuiaclkie", model.owner()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-24T04:29:25Z"), model.remediationDueDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-15T08:06:52Z"), model.remediationEta().eta()); - Assertions.assertEquals("lfnthiqfyut", model.remediationEta().justification()); - Assertions.assertEquals(false, model.isGracePeriod()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableOwnerEmailNotification()); - Assertions.assertEquals(1375874232, model.additionalData().ticketNumber()); - Assertions.assertEquals("mtx", model.additionalData().ticketLink()); - Assertions.assertEquals("ctwwgzw", model.additionalData().ticketStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentPropertiesTests.java deleted file mode 100644 index f39d10fb18c4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentPropertiesTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.GovernanceAssignmentProperties; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceAssignmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceAssignmentProperties model = - BinaryData - .fromString( - "{\"owner\":\"ifgh\",\"remediationDueDate\":\"2021-06-10T17:08:41Z\",\"remediationEta\":{\"eta\":\"2021-08-19T14:37:02Z\",\"justification\":\"qtlffhzbk\"},\"isGracePeriod\":true,\"governanceEmailNotification\":{\"disableManagerEmailNotification\":true,\"disableOwnerEmailNotification\":true},\"additionalData\":{\"ticketNumber\":1233073634,\"ticketLink\":\"nq\",\"ticketStatus\":\"wdogiyetesyp\"}}") - .toObject(GovernanceAssignmentProperties.class); - Assertions.assertEquals("ifgh", model.owner()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T17:08:41Z"), model.remediationDueDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-19T14:37:02Z"), model.remediationEta().eta()); - Assertions.assertEquals("qtlffhzbk", model.remediationEta().justification()); - Assertions.assertEquals(true, model.isGracePeriod()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableOwnerEmailNotification()); - Assertions.assertEquals(1233073634, model.additionalData().ticketNumber()); - Assertions.assertEquals("nq", model.additionalData().ticketLink()); - Assertions.assertEquals("wdogiyetesyp", model.additionalData().ticketStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceAssignmentProperties model = - new GovernanceAssignmentProperties() - .withOwner("ifgh") - .withRemediationDueDate(OffsetDateTime.parse("2021-06-10T17:08:41Z")) - .withRemediationEta( - new RemediationEta() - .withEta(OffsetDateTime.parse("2021-08-19T14:37:02Z")) - .withJustification("qtlffhzbk")) - .withIsGracePeriod(true) - .withGovernanceEmailNotification( - new GovernanceEmailNotification() - .withDisableManagerEmailNotification(true) - .withDisableOwnerEmailNotification(true)) - .withAdditionalData( - new GovernanceAssignmentAdditionalData() - .withTicketNumber(1233073634) - .withTicketLink("nq") - .withTicketStatus("wdogiyetesyp")); - model = BinaryData.fromObject(model).toObject(GovernanceAssignmentProperties.class); - Assertions.assertEquals("ifgh", model.owner()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T17:08:41Z"), model.remediationDueDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-19T14:37:02Z"), model.remediationEta().eta()); - Assertions.assertEquals("qtlffhzbk", model.remediationEta().justification()); - Assertions.assertEquals(true, model.isGracePeriod()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableOwnerEmailNotification()); - Assertions.assertEquals(1233073634, model.additionalData().ticketNumber()); - Assertions.assertEquals("nq", model.additionalData().ticketLink()); - Assertions.assertEquals("wdogiyetesyp", model.additionalData().ticketStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index ff420b6923fc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.GovernanceAssignment; -import com.azure.resourcemanager.security.models.GovernanceAssignmentAdditionalData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceAssignmentsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"owner\":\"jjzgxqgqw\",\"remediationDueDate\":\"2021-06-27T22:34:45Z\",\"remediationEta\":{\"eta\":\"2021-09-27T23:54:35Z\",\"justification\":\"gtvh\"},\"isGracePeriod\":false,\"governanceEmailNotification\":{\"disableManagerEmailNotification\":true,\"disableOwnerEmailNotification\":false},\"additionalData\":{\"ticketNumber\":1254338347,\"ticketLink\":\"zejogmkorvvmvm\",\"ticketStatus\":\"fnqh\"}},\"id\":\"bsn\",\"name\":\"snqliwkmzojfe\",\"type\":\"yalhtgm\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GovernanceAssignment response = - manager - .governanceAssignments() - .define("canzb") - .withExistingAssessment("kgdet", "z") - .withOwner("wu") - .withRemediationDueDate(OffsetDateTime.parse("2021-04-13T16:18:12Z")) - .withRemediationEta( - new RemediationEta() - .withEta(OffsetDateTime.parse("2021-10-14T16:12:54Z")) - .withJustification("vnensmuffiw")) - .withIsGracePeriod(true) - .withGovernanceEmailNotification( - new GovernanceEmailNotification() - .withDisableManagerEmailNotification(true) - .withDisableOwnerEmailNotification(true)) - .withAdditionalData( - new GovernanceAssignmentAdditionalData() - .withTicketNumber(844736587) - .withTicketLink("totdxposcslh") - .withTicketStatus("usiecktybhjuxid")) - .create(); - - Assertions.assertEquals("jjzgxqgqw", response.owner()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-27T22:34:45Z"), response.remediationDueDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T23:54:35Z"), response.remediationEta().eta()); - Assertions.assertEquals("gtvh", response.remediationEta().justification()); - Assertions.assertEquals(false, response.isGracePeriod()); - Assertions.assertEquals(true, response.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(false, response.governanceEmailNotification().disableOwnerEmailNotification()); - Assertions.assertEquals(1254338347, response.additionalData().ticketNumber()); - Assertions.assertEquals("zejogmkorvvmvm", response.additionalData().ticketLink()); - Assertions.assertEquals("fnqh", response.additionalData().ticketStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteWithResponseMockTests.java deleted file mode 100644 index d70eb2bae786..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceAssignmentsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.governanceAssignments().deleteWithResponse("iqegm", "db", "ohcwhpyv", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetWithResponseMockTests.java deleted file mode 100644 index 1ca23309416b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsGetWithResponseMockTests.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.GovernanceAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceAssignmentsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"owner\":\"w\",\"remediationDueDate\":\"2021-05-03T11:44:34Z\",\"remediationEta\":{\"eta\":\"2021-04-13T20:47Z\",\"justification\":\"ioctqk\"},\"isGracePeriod\":false,\"governanceEmailNotification\":{\"disableManagerEmailNotification\":true,\"disableOwnerEmailNotification\":true},\"additionalData\":{\"ticketNumber\":27888858,\"ticketLink\":\"tj\",\"ticketStatus\":\"oss\"}},\"id\":\"fjxtvlxxzqfc\",\"name\":\"rr\",\"type\":\"omxeezwyhjmb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GovernanceAssignment response = - manager - .governanceAssignments() - .getWithResponse("wgsoriobijeiydy", "uynhbokayrgwybr", "opdweoft", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("w", response.owner()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-03T11:44:34Z"), response.remediationDueDate()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-13T20:47Z"), response.remediationEta().eta()); - Assertions.assertEquals("ioctqk", response.remediationEta().justification()); - Assertions.assertEquals(false, response.isGracePeriod()); - Assertions.assertEquals(true, response.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, response.governanceEmailNotification().disableOwnerEmailNotification()); - Assertions.assertEquals(27888858, response.additionalData().ticketNumber()); - Assertions.assertEquals("tj", response.additionalData().ticketLink()); - Assertions.assertEquals("oss", response.additionalData().ticketStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListMockTests.java deleted file mode 100644 index 82014d8dfbe5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListMockTests.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.GovernanceAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceAssignmentsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"owner\":\"npxraqawbmpspf\",\"remediationDueDate\":\"2021-02-16T15:05:28Z\",\"remediationEta\":{\"eta\":\"2021-05-30T23:09:04Z\",\"justification\":\"ocvvujexayglxrk\"},\"isGracePeriod\":false,\"governanceEmailNotification\":{\"disableManagerEmailNotification\":true,\"disableOwnerEmailNotification\":true},\"additionalData\":{\"ticketNumber\":1922725665,\"ticketLink\":\"jfiuofpi\",\"ticketStatus\":\"dzlvssqywj\"}},\"id\":\"packyh\",\"name\":\"dvikm\",\"type\":\"ngpmillxgjsci\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.governanceAssignments().list("khowgomvvhxow", "c", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("npxraqawbmpspf", response.iterator().next().owner()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-02-16T15:05:28Z"), response.iterator().next().remediationDueDate()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-05-30T23:09:04Z"), response.iterator().next().remediationEta().eta()); - Assertions.assertEquals("ocvvujexayglxrk", response.iterator().next().remediationEta().justification()); - Assertions.assertEquals(false, response.iterator().next().isGracePeriod()); - Assertions - .assertEquals( - true, response.iterator().next().governanceEmailNotification().disableManagerEmailNotification()); - Assertions - .assertEquals( - true, response.iterator().next().governanceEmailNotification().disableOwnerEmailNotification()); - Assertions.assertEquals(1922725665, response.iterator().next().additionalData().ticketNumber()); - Assertions.assertEquals("jfiuofpi", response.iterator().next().additionalData().ticketLink()); - Assertions.assertEquals("dzlvssqywj", response.iterator().next().additionalData().ticketStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListTests.java deleted file mode 100644 index a52e9b7b2cbd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceAssignmentsListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GovernanceAssignmentsList; - -public final class GovernanceAssignmentsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceAssignmentsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"owner\":\"ny\",\"remediationDueDate\":\"2021-07-02T15:24:24Z\",\"isGracePeriod\":true},\"id\":\"nsrpmeyy\",\"name\":\"pkpatlbijpzgsks\",\"type\":\"fhfv\"}],\"nextLink\":\"mknbnxwcdommpv\"}") - .toObject(GovernanceAssignmentsList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceAssignmentsList model = new GovernanceAssignmentsList(); - model = BinaryData.fromObject(model).toObject(GovernanceAssignmentsList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceEmailNotificationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceEmailNotificationTests.java deleted file mode 100644 index c4a0f5b47213..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceEmailNotificationTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GovernanceEmailNotification; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceEmailNotificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceEmailNotification model = - BinaryData - .fromString("{\"disableManagerEmailNotification\":false,\"disableOwnerEmailNotification\":true}") - .toObject(GovernanceEmailNotification.class); - Assertions.assertEquals(false, model.disableManagerEmailNotification()); - Assertions.assertEquals(true, model.disableOwnerEmailNotification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceEmailNotification model = - new GovernanceEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(true); - model = BinaryData.fromObject(model).toObject(GovernanceEmailNotification.class); - Assertions.assertEquals(false, model.disableManagerEmailNotification()); - Assertions.assertEquals(true, model.disableOwnerEmailNotification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleEmailNotificationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleEmailNotificationTests.java deleted file mode 100644 index a83db39ccb7a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleEmailNotificationTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceRuleEmailNotificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceRuleEmailNotification model = - BinaryData - .fromString("{\"disableManagerEmailNotification\":false,\"disableOwnerEmailNotification\":true}") - .toObject(GovernanceRuleEmailNotification.class); - Assertions.assertEquals(false, model.disableManagerEmailNotification()); - Assertions.assertEquals(true, model.disableOwnerEmailNotification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceRuleEmailNotification model = - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(true); - model = BinaryData.fromObject(model).toObject(GovernanceRuleEmailNotification.class); - Assertions.assertEquals(false, model.disableManagerEmailNotification()); - Assertions.assertEquals(true, model.disableOwnerEmailNotification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleInnerTests.java deleted file mode 100644 index c6715cea6442..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleInnerTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleInner; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceRuleInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceRuleInner model = - BinaryData - .fromString( - "{\"properties\":{\"tenantId\":\"liufiqwoyxq\",\"displayName\":\"apcohhouc\",\"description\":\"q\",\"remediationTimeframe\":\"xcxzrzdcgdzben\",\"isGracePeriod\":false,\"rulePriority\":314467274,\"isDisabled\":true,\"ruleType\":\"Integrated\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[\"ddtjwfljhznam\"],\"conditionSets\":[\"dataatmzw\",\"datajj\",\"datacqtjzmi\",\"datavgbgatzuuvbxng\"],\"includeMemberScopes\":false,\"ownerSource\":{\"type\":\"ByTag\",\"value\":\"ahttzlswvajqfut\"},\"governanceEmailNotification\":{\"disableManagerEmailNotification\":false,\"disableOwnerEmailNotification\":true},\"metadata\":{\"createdBy\":\"unwqr\",\"createdOn\":\"2021-01-05T19:17:25Z\",\"updatedBy\":\"gqhaohcmbuocn\",\"updatedOn\":\"2021-05-14T07:13:07Z\"}},\"id\":\"hmbpyryxamebly\",\"name\":\"yvk\",\"type\":\"kmrocxne\"}") - .toObject(GovernanceRuleInner.class); - Assertions.assertEquals("apcohhouc", model.displayName()); - Assertions.assertEquals("q", model.description()); - Assertions.assertEquals("xcxzrzdcgdzben", model.remediationTimeframe()); - Assertions.assertEquals(false, model.isGracePeriod()); - Assertions.assertEquals(314467274, model.rulePriority()); - Assertions.assertEquals(true, model.isDisabled()); - Assertions.assertEquals(GovernanceRuleType.INTEGRATED, model.ruleType()); - Assertions.assertEquals(GovernanceRuleSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - Assertions.assertEquals("ddtjwfljhznam", model.excludedScopes().get(0)); - Assertions.assertEquals(false, model.includeMemberScopes()); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, model.ownerSource().type()); - Assertions.assertEquals("ahttzlswvajqfut", model.ownerSource().value()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableOwnerEmailNotification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceRuleInner model = - new GovernanceRuleInner() - .withDisplayName("apcohhouc") - .withDescription("q") - .withRemediationTimeframe("xcxzrzdcgdzben") - .withIsGracePeriod(false) - .withRulePriority(314467274) - .withIsDisabled(true) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withExcludedScopes(Arrays.asList("ddtjwfljhznam")) - .withConditionSets(Arrays.asList("dataatmzw", "datajj", "datacqtjzmi", "datavgbgatzuuvbxng")) - .withIncludeMemberScopes(false) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.BY_TAG) - .withValue("ahttzlswvajqfut")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(true)) - .withMetadata(new GovernanceRuleMetadata()); - model = BinaryData.fromObject(model).toObject(GovernanceRuleInner.class); - Assertions.assertEquals("apcohhouc", model.displayName()); - Assertions.assertEquals("q", model.description()); - Assertions.assertEquals("xcxzrzdcgdzben", model.remediationTimeframe()); - Assertions.assertEquals(false, model.isGracePeriod()); - Assertions.assertEquals(314467274, model.rulePriority()); - Assertions.assertEquals(true, model.isDisabled()); - Assertions.assertEquals(GovernanceRuleType.INTEGRATED, model.ruleType()); - Assertions.assertEquals(GovernanceRuleSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - Assertions.assertEquals("ddtjwfljhznam", model.excludedScopes().get(0)); - Assertions.assertEquals(false, model.includeMemberScopes()); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, model.ownerSource().type()); - Assertions.assertEquals("ahttzlswvajqfut", model.ownerSource().value()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableOwnerEmailNotification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleListTests.java deleted file mode 100644 index 62c6e0f78e0f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GovernanceRuleList; - -public final class GovernanceRuleListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceRuleList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"tenantId\":\"p\",\"displayName\":\"bkdq\",\"description\":\"dzsylollgtrczz\",\"remediationTimeframe\":\"mxzjijpvua\",\"isGracePeriod\":true,\"rulePriority\":153071773,\"isDisabled\":false,\"ruleType\":\"Integrated\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[],\"conditionSets\":[],\"includeMemberScopes\":true},\"id\":\"rdcoxnbkkj\",\"name\":\"nurnnq\",\"type\":\"nqbpi\"},{\"properties\":{\"tenantId\":\"ltgrdogypxrxv\",\"displayName\":\"fihwu\",\"description\":\"ctafsrbxrblm\",\"remediationTimeframe\":\"owxih\",\"isGracePeriod\":false,\"rulePriority\":491471659,\"isDisabled\":true,\"ruleType\":\"ServiceNow\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[],\"conditionSets\":[],\"includeMemberScopes\":true},\"id\":\"aklsbsbq\",\"name\":\"qagwwrxaomz\",\"type\":\"sgl\"},{\"properties\":{\"tenantId\":\"zezkhhltnjadh\",\"displayName\":\"oawjqoyueay\",\"description\":\"pcmsplbyrrueqth\",\"remediationTimeframe\":\"gnmbscbbxigdhx\",\"isGracePeriod\":false,\"rulePriority\":1518081378,\"isDisabled\":true,\"ruleType\":\"Integrated\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[],\"conditionSets\":[],\"includeMemberScopes\":true},\"id\":\"qyybxubmdnafcbq\",\"name\":\"remj\",\"type\":\"laqacigele\"},{\"properties\":{\"tenantId\":\"bvqvwzkjopwbeo\",\"displayName\":\"r\",\"description\":\"wzdqybxceakxcpts\",\"remediationTimeframe\":\"fyiaseqch\",\"isGracePeriod\":true,\"rulePriority\":375914410,\"isDisabled\":false,\"ruleType\":\"Integrated\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[],\"conditionSets\":[],\"includeMemberScopes\":false},\"id\":\"iuemvanbwzohmnr\",\"name\":\"xbsojkli\",\"type\":\"hmdp\"}],\"nextLink\":\"sprqsgnzxojpslsv\"}") - .toObject(GovernanceRuleList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceRuleList model = new GovernanceRuleList(); - model = BinaryData.fromObject(model).toObject(GovernanceRuleList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleMetadataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleMetadataTests.java deleted file mode 100644 index ac4d620cc5c8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleMetadataTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; - -public final class GovernanceRuleMetadataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceRuleMetadata model = - BinaryData - .fromString( - "{\"createdBy\":\"dvrmazlpd\",\"createdOn\":\"2021-01-11T12:00:50Z\",\"updatedBy\":\"ymzvla\",\"updatedOn\":\"2021-05-17T23:09:54Z\"}") - .toObject(GovernanceRuleMetadata.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceRuleMetadata model = new GovernanceRuleMetadata(); - model = BinaryData.fromObject(model).toObject(GovernanceRuleMetadata.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleOwnerSourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleOwnerSourceTests.java deleted file mode 100644 index 67374d090a31..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRuleOwnerSourceTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceRuleOwnerSourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceRuleOwnerSource model = - BinaryData - .fromString("{\"type\":\"ByTag\",\"value\":\"vfkoxml\"}") - .toObject(GovernanceRuleOwnerSource.class); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, model.type()); - Assertions.assertEquals("vfkoxml", model.value()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceRuleOwnerSource model = - new GovernanceRuleOwnerSource().withType(GovernanceRuleOwnerSourceType.BY_TAG).withValue("vfkoxml"); - model = BinaryData.fromObject(model).toObject(GovernanceRuleOwnerSource.class); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, model.type()); - Assertions.assertEquals("vfkoxml", model.value()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulePropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulePropertiesTests.java deleted file mode 100644 index e80930dfba71..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulePropertiesTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.GovernanceRuleProperties; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class GovernanceRulePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - GovernanceRuleProperties model = - BinaryData - .fromString( - "{\"tenantId\":\"sm\",\"displayName\":\"odlfpyapucygvo\",\"description\":\"yunssx\",\"remediationTimeframe\":\"hi\",\"isGracePeriod\":true,\"rulePriority\":230828821,\"isDisabled\":false,\"ruleType\":\"Integrated\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[\"seksgbux\",\"ntuygdhgaqipir\",\"iwrqofulopmjnl\",\"x\"],\"conditionSets\":[\"datacbjpibkephuu\",\"dataerctatoyin\"],\"includeMemberScopes\":true,\"ownerSource\":{\"type\":\"ByTag\",\"value\":\"cyrduczkg\"},\"governanceEmailNotification\":{\"disableManagerEmailNotification\":false,\"disableOwnerEmailNotification\":true},\"metadata\":{\"createdBy\":\"cvcrrp\",\"createdOn\":\"2021-06-14T17:45:27Z\",\"updatedBy\":\"bstvje\",\"updatedOn\":\"2021-06-06T13:44:54Z\"}}") - .toObject(GovernanceRuleProperties.class); - Assertions.assertEquals("odlfpyapucygvo", model.displayName()); - Assertions.assertEquals("yunssx", model.description()); - Assertions.assertEquals("hi", model.remediationTimeframe()); - Assertions.assertEquals(true, model.isGracePeriod()); - Assertions.assertEquals(230828821, model.rulePriority()); - Assertions.assertEquals(false, model.isDisabled()); - Assertions.assertEquals(GovernanceRuleType.INTEGRATED, model.ruleType()); - Assertions.assertEquals(GovernanceRuleSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - Assertions.assertEquals("seksgbux", model.excludedScopes().get(0)); - Assertions.assertEquals(true, model.includeMemberScopes()); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, model.ownerSource().type()); - Assertions.assertEquals("cyrduczkg", model.ownerSource().value()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableOwnerEmailNotification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - GovernanceRuleProperties model = - new GovernanceRuleProperties() - .withDisplayName("odlfpyapucygvo") - .withDescription("yunssx") - .withRemediationTimeframe("hi") - .withIsGracePeriod(true) - .withRulePriority(230828821) - .withIsDisabled(false) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withExcludedScopes(Arrays.asList("seksgbux", "ntuygdhgaqipir", "iwrqofulopmjnl", "x")) - .withConditionSets(Arrays.asList("datacbjpibkephuu", "dataerctatoyin")) - .withIncludeMemberScopes(true) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.BY_TAG) - .withValue("cyrduczkg")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(true)) - .withMetadata(new GovernanceRuleMetadata()); - model = BinaryData.fromObject(model).toObject(GovernanceRuleProperties.class); - Assertions.assertEquals("odlfpyapucygvo", model.displayName()); - Assertions.assertEquals("yunssx", model.description()); - Assertions.assertEquals("hi", model.remediationTimeframe()); - Assertions.assertEquals(true, model.isGracePeriod()); - Assertions.assertEquals(230828821, model.rulePriority()); - Assertions.assertEquals(false, model.isDisabled()); - Assertions.assertEquals(GovernanceRuleType.INTEGRATED, model.ruleType()); - Assertions.assertEquals(GovernanceRuleSourceResourceType.ASSESSMENTS, model.sourceResourceType()); - Assertions.assertEquals("seksgbux", model.excludedScopes().get(0)); - Assertions.assertEquals(true, model.includeMemberScopes()); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, model.ownerSource().type()); - Assertions.assertEquals("cyrduczkg", model.ownerSource().value()); - Assertions.assertEquals(false, model.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, model.governanceEmailNotification().disableOwnerEmailNotification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 08cdf523f1d7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.GovernanceRuleEmailNotification; -import com.azure.resourcemanager.security.models.GovernanceRuleMetadata; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSource; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceRulesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"tenantId\":\"jqjpv\",\"displayName\":\"aihxjtgzgtaiywbq\",\"description\":\"oig\",\"remediationTimeframe\":\"fsgsa\",\"isGracePeriod\":false,\"rulePriority\":1919322541,\"isDisabled\":false,\"ruleType\":\"ServiceNow\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[\"qlxspmrj\",\"tryldsxebuhsxr\",\"nmgsdaluyckhef\"],\"conditionSets\":[\"datahs\"],\"includeMemberScopes\":false,\"ownerSource\":{\"type\":\"Manually\",\"value\":\"pxebjlud\"},\"governanceEmailNotification\":{\"disableManagerEmailNotification\":true,\"disableOwnerEmailNotification\":true},\"metadata\":{\"createdBy\":\"xdtpry\",\"createdOn\":\"2021-05-23T11:25:30Z\",\"updatedBy\":\"nsewouxl\",\"updatedOn\":\"2021-04-21T21:20:48Z\"}},\"id\":\"vvyljurkepose\",\"name\":\"qqylmpctwjwds\",\"type\":\"lzmkxerxxxotee\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GovernanceRule response = - manager - .governanceRules() - .define("lhpses") - .withExistingScope("zpvxak") - .withDisplayName("goqg") - .withDescription("yqyxyjrcbqpbis") - .withRemediationTimeframe("lqjoxtda") - .withIsGracePeriod(false) - .withRulePriority(352859817) - .withIsDisabled(false) - .withRuleType(GovernanceRuleType.INTEGRATED) - .withSourceResourceType(GovernanceRuleSourceResourceType.ASSESSMENTS) - .withExcludedScopes(Arrays.asList("ztivfwjl", "fzekfsrm", "uklajvcfoc", "hapejov")) - .withConditionSets(Arrays.asList("datawxn", "datawhhnoyrzaa", "dataee", "datapmjen")) - .withIncludeMemberScopes(false) - .withOwnerSource( - new GovernanceRuleOwnerSource() - .withType(GovernanceRuleOwnerSourceType.MANUALLY) - .withValue("axxcrxoxdj")) - .withGovernanceEmailNotification( - new GovernanceRuleEmailNotification() - .withDisableManagerEmailNotification(false) - .withDisableOwnerEmailNotification(false)) - .withMetadata(new GovernanceRuleMetadata()) - .create(); - - Assertions.assertEquals("aihxjtgzgtaiywbq", response.displayName()); - Assertions.assertEquals("oig", response.description()); - Assertions.assertEquals("fsgsa", response.remediationTimeframe()); - Assertions.assertEquals(false, response.isGracePeriod()); - Assertions.assertEquals(1919322541, response.rulePriority()); - Assertions.assertEquals(false, response.isDisabled()); - Assertions.assertEquals(GovernanceRuleType.SERVICE_NOW, response.ruleType()); - Assertions.assertEquals(GovernanceRuleSourceResourceType.ASSESSMENTS, response.sourceResourceType()); - Assertions.assertEquals("qlxspmrj", response.excludedScopes().get(0)); - Assertions.assertEquals(false, response.includeMemberScopes()); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.MANUALLY, response.ownerSource().type()); - Assertions.assertEquals("pxebjlud", response.ownerSource().value()); - Assertions.assertEquals(true, response.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, response.governanceEmailNotification().disableOwnerEmailNotification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteMockTests.java deleted file mode 100644 index 17e7f70aa603..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesDeleteMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceRulesDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.governanceRules().delete("wpdkktpmbmxbmb", "wgzzxljb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetWithResponseMockTests.java deleted file mode 100644 index f82053789e5d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesGetWithResponseMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceRulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"tenantId\":\"j\",\"displayName\":\"n\",\"description\":\"dtjva\",\"remediationTimeframe\":\"yznm\",\"isGracePeriod\":false,\"rulePriority\":1496636288,\"isDisabled\":false,\"ruleType\":\"ServiceNow\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[\"gytoxuwhtt\",\"zqsa\"],\"conditionSets\":[\"dataebg\",\"datazplusdekpdzzms\",\"datagpgvokyejidbdq\"],\"includeMemberScopes\":true,\"ownerSource\":{\"type\":\"ByTag\",\"value\":\"cwztlvvws\"},\"governanceEmailNotification\":{\"disableManagerEmailNotification\":false,\"disableOwnerEmailNotification\":true},\"metadata\":{\"createdBy\":\"repwpwfkcaux\",\"createdOn\":\"2021-07-16T09:20:09Z\",\"updatedBy\":\"cpfpdofuckcl\",\"updatedOn\":\"2021-10-21T16:06:31Z\"}},\"id\":\"luevsolzwilfng\",\"name\":\"jfsqeb\",\"type\":\"uxjxhfxf\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - GovernanceRule response = - manager - .governanceRules() - .getWithResponse("gsevmdm", "enlrstgf", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("n", response.displayName()); - Assertions.assertEquals("dtjva", response.description()); - Assertions.assertEquals("yznm", response.remediationTimeframe()); - Assertions.assertEquals(false, response.isGracePeriod()); - Assertions.assertEquals(1496636288, response.rulePriority()); - Assertions.assertEquals(false, response.isDisabled()); - Assertions.assertEquals(GovernanceRuleType.SERVICE_NOW, response.ruleType()); - Assertions.assertEquals(GovernanceRuleSourceResourceType.ASSESSMENTS, response.sourceResourceType()); - Assertions.assertEquals("gytoxuwhtt", response.excludedScopes().get(0)); - Assertions.assertEquals(true, response.includeMemberScopes()); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, response.ownerSource().type()); - Assertions.assertEquals("cwztlvvws", response.ownerSource().value()); - Assertions.assertEquals(false, response.governanceEmailNotification().disableManagerEmailNotification()); - Assertions.assertEquals(true, response.governanceEmailNotification().disableOwnerEmailNotification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesListMockTests.java deleted file mode 100644 index d5739fd28d74..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesListMockTests.java +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.GovernanceRule; -import com.azure.resourcemanager.security.models.GovernanceRuleOwnerSourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleSourceResourceType; -import com.azure.resourcemanager.security.models.GovernanceRuleType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceRulesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"tenantId\":\"oaeoc\",\"displayName\":\"ajtfey\",\"description\":\"bdgddkrh\",\"remediationTimeframe\":\"cxbeuuqutkzwtjww\",\"isGracePeriod\":false,\"rulePriority\":574110550,\"isDisabled\":false,\"ruleType\":\"Integrated\",\"sourceResourceType\":\"Assessments\",\"excludedScopes\":[\"nondegjdyd\"],\"conditionSets\":[\"datakkkbjuckcatuqbh\",\"dataowcnxtpz\",\"datalyseidtoak\",\"datat\"],\"includeMemberScopes\":true,\"ownerSource\":{\"type\":\"ByTag\",\"value\":\"hzbqfdpfawrptvcs\"},\"governanceEmailNotification\":{\"disableManagerEmailNotification\":true,\"disableOwnerEmailNotification\":true},\"metadata\":{\"createdBy\":\"tbqgdirdamm\",\"createdOn\":\"2021-04-05T19:23:11Z\",\"updatedBy\":\"cfjfxtbwjj\",\"updatedOn\":\"2021-06-25T16:41:01Z\"}},\"id\":\"uydgfttmdofgeoa\",\"name\":\"fuof\",\"type\":\"nxodwxmdajwiyg\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.governanceRules().list("yjfzi", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ajtfey", response.iterator().next().displayName()); - Assertions.assertEquals("bdgddkrh", response.iterator().next().description()); - Assertions.assertEquals("cxbeuuqutkzwtjww", response.iterator().next().remediationTimeframe()); - Assertions.assertEquals(false, response.iterator().next().isGracePeriod()); - Assertions.assertEquals(574110550, response.iterator().next().rulePriority()); - Assertions.assertEquals(false, response.iterator().next().isDisabled()); - Assertions.assertEquals(GovernanceRuleType.INTEGRATED, response.iterator().next().ruleType()); - Assertions - .assertEquals( - GovernanceRuleSourceResourceType.ASSESSMENTS, response.iterator().next().sourceResourceType()); - Assertions.assertEquals("nondegjdyd", response.iterator().next().excludedScopes().get(0)); - Assertions.assertEquals(true, response.iterator().next().includeMemberScopes()); - Assertions.assertEquals(GovernanceRuleOwnerSourceType.BY_TAG, response.iterator().next().ownerSource().type()); - Assertions.assertEquals("hzbqfdpfawrptvcs", response.iterator().next().ownerSource().value()); - Assertions - .assertEquals( - true, response.iterator().next().governanceEmailNotification().disableManagerEmailNotification()); - Assertions - .assertEquals( - true, response.iterator().next().governanceEmailNotification().disableOwnerEmailNotification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsWithResponseMockTests.java deleted file mode 100644 index ffe9ddfdb235..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/GovernanceRulesOperationResultsWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.OperationResultAutoGenerated; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class GovernanceRulesOperationResultsWithResponseMockTests { - @Test - public void testOperationResultsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"status\":\"Failed\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationResultAutoGenerated response = - manager - .governanceRules() - .operationResultsWithResponse( - "hxsdplaumydmhwe", "jf", "xydgtokvqbvwg", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthDataClassificationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthDataClassificationTests.java deleted file mode 100644 index 276de2c075f9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthDataClassificationTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.HealthDataClassification; -import com.azure.resourcemanager.security.models.ScopeName; -import org.junit.jupiter.api.Assertions; - -public final class HealthDataClassificationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HealthDataClassification model = - BinaryData - .fromString("{\"component\":\"fxjelg\",\"scenario\":\"pzqjhhhq\",\"scope\":\"Connectors\"}") - .toObject(HealthDataClassification.class); - Assertions.assertEquals("fxjelg", model.component()); - Assertions.assertEquals("pzqjhhhq", model.scenario()); - Assertions.assertEquals(ScopeName.CONNECTORS, model.scope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HealthDataClassification model = - new HealthDataClassification() - .withComponent("fxjelg") - .withScenario("pzqjhhhq") - .withScope(ScopeName.CONNECTORS); - model = BinaryData.fromObject(model).toObject(HealthDataClassification.class); - Assertions.assertEquals("fxjelg", model.component()); - Assertions.assertEquals("pzqjhhhq", model.scenario()); - Assertions.assertEquals(ScopeName.CONNECTORS, model.scope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthReportsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthReportsListTests.java deleted file mode 100644 index 92a2accc73fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HealthReportsListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.HealthReportsList; - -public final class HealthReportsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HealthReportsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"affectedDefendersPlans\":[],\"issues\":[]},\"id\":\"rpq\",\"name\":\"vmblcouqe\",\"type\":\"bhbcdszir\"}],\"nextLink\":\"an\"}") - .toObject(HealthReportsList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HealthReportsList model = new HealthReportsList(); - model = BinaryData.fromObject(model).toObject(HealthReportsList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpC2DMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpC2DMessagesNotInAllowedRangeTests.java deleted file mode 100644 index 945fff22cb97..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpC2DMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.HttpC2DMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class HttpC2DMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HttpC2DMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"HttpC2DMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT97H37M31S\",\"minThreshold\":1748294835,\"maxThreshold\":94404068,\"displayName\":\"mouvbl\",\"description\":\"okzkltr\",\"isEnabled\":true}") - .toObject(HttpC2DMessagesNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1748294835, model.minThreshold()); - Assertions.assertEquals(94404068, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT97H37M31S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HttpC2DMessagesNotInAllowedRange model = - new HttpC2DMessagesNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(1748294835) - .withMaxThreshold(94404068) - .withTimeWindowSize(Duration.parse("PT97H37M31S")); - model = BinaryData.fromObject(model).toObject(HttpC2DMessagesNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1748294835, model.minThreshold()); - Assertions.assertEquals(94404068, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT97H37M31S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpC2DRejectedMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpC2DRejectedMessagesNotInAllowedRangeTests.java deleted file mode 100644 index 84b708f60d13..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpC2DRejectedMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.HttpC2DRejectedMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class HttpC2DRejectedMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HttpC2DRejectedMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"HttpC2DRejectedMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT63H43M46S\",\"minThreshold\":290921266,\"maxThreshold\":1500801234,\"displayName\":\"qxmbjroumzzn\",\"description\":\"l\",\"isEnabled\":false}") - .toObject(HttpC2DRejectedMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(290921266, model.minThreshold()); - Assertions.assertEquals(1500801234, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT63H43M46S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HttpC2DRejectedMessagesNotInAllowedRange model = - new HttpC2DRejectedMessagesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(290921266) - .withMaxThreshold(1500801234) - .withTimeWindowSize(Duration.parse("PT63H43M46S")); - model = BinaryData.fromObject(model).toObject(HttpC2DRejectedMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(290921266, model.minThreshold()); - Assertions.assertEquals(1500801234, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT63H43M46S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpD2CMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpD2CMessagesNotInAllowedRangeTests.java deleted file mode 100644 index 9ec53e3fd2fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/HttpD2CMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.HttpD2CMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class HttpD2CMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - HttpD2CMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"HttpD2CMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT111H55M28S\",\"minThreshold\":1174525778,\"maxThreshold\":184797601,\"displayName\":\"jkqev\",\"description\":\"rmmwiuawvcmj\",\"isEnabled\":true}") - .toObject(HttpD2CMessagesNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1174525778, model.minThreshold()); - Assertions.assertEquals(184797601, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT111H55M28S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - HttpD2CMessagesNotInAllowedRange model = - new HttpD2CMessagesNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(1174525778) - .withMaxThreshold(184797601) - .withTimeWindowSize(Duration.parse("PT111H55M28S")); - model = BinaryData.fromObject(model).toObject(HttpD2CMessagesNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1174525778, model.minThreshold()); - Assertions.assertEquals(184797601, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT111H55M28S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IdentityTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IdentityTests.java deleted file mode 100644 index 16716635e2a9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IdentityTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Identity; -import com.azure.resourcemanager.security.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class IdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Identity model = - BinaryData - .fromString("{\"principalId\":\"pzfngqjcli\",\"tenantId\":\"tujwjju\",\"type\":\"SystemAssigned\"}") - .toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Identity model = new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED); - model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionAwsOfferingInformationProtectionTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionAwsOfferingInformationProtectionTests.java deleted file mode 100644 index cf5a043d9f54..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionAwsOfferingInformationProtectionTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.InformationProtectionAwsOfferingInformationProtection; -import org.junit.jupiter.api.Assertions; - -public final class InformationProtectionAwsOfferingInformationProtectionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InformationProtectionAwsOfferingInformationProtection model = - BinaryData - .fromString("{\"cloudRoleArn\":\"atolekscbc\"}") - .toObject(InformationProtectionAwsOfferingInformationProtection.class); - Assertions.assertEquals("atolekscbc", model.cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InformationProtectionAwsOfferingInformationProtection model = - new InformationProtectionAwsOfferingInformationProtection().withCloudRoleArn("atolekscbc"); - model = BinaryData.fromObject(model).toObject(InformationProtectionAwsOfferingInformationProtection.class); - Assertions.assertEquals("atolekscbc", model.cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionAwsOfferingTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionAwsOfferingTests.java deleted file mode 100644 index 06d1cdde4fb0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionAwsOfferingTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.InformationProtectionAwsOffering; -import com.azure.resourcemanager.security.models.InformationProtectionAwsOfferingInformationProtection; -import org.junit.jupiter.api.Assertions; - -public final class InformationProtectionAwsOfferingTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InformationProtectionAwsOffering model = - BinaryData - .fromString( - "{\"offeringType\":\"InformationProtectionAws\",\"informationProtection\":{\"cloudRoleArn\":\"ytt\"},\"description\":\"knwfrkebsmhpdujd\"}") - .toObject(InformationProtectionAwsOffering.class); - Assertions.assertEquals("ytt", model.informationProtection().cloudRoleArn()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InformationProtectionAwsOffering model = - new InformationProtectionAwsOffering() - .withInformationProtection( - new InformationProtectionAwsOfferingInformationProtection().withCloudRoleArn("ytt")); - model = BinaryData.fromObject(model).toObject(InformationProtectionAwsOffering.class); - Assertions.assertEquals("ytt", model.informationProtection().cloudRoleArn()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionKeywordTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionKeywordTests.java deleted file mode 100644 index d3dedd80d401..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionKeywordTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.InformationProtectionKeyword; -import org.junit.jupiter.api.Assertions; - -public final class InformationProtectionKeywordTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InformationProtectionKeyword model = - BinaryData - .fromString( - "{\"pattern\":\"zlxwabmqoefkifr\",\"custom\":true,\"canBeNumeric\":true,\"excluded\":false}") - .toObject(InformationProtectionKeyword.class); - Assertions.assertEquals("zlxwabmqoefkifr", model.pattern()); - Assertions.assertEquals(true, model.custom()); - Assertions.assertEquals(true, model.canBeNumeric()); - Assertions.assertEquals(false, model.excluded()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InformationProtectionKeyword model = - new InformationProtectionKeyword() - .withPattern("zlxwabmqoefkifr") - .withCustom(true) - .withCanBeNumeric(true) - .withExcluded(false); - model = BinaryData.fromObject(model).toObject(InformationProtectionKeyword.class); - Assertions.assertEquals("zlxwabmqoefkifr", model.pattern()); - Assertions.assertEquals(true, model.custom()); - Assertions.assertEquals(true, model.canBeNumeric()); - Assertions.assertEquals(false, model.excluded()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 6b9bc99e2e6e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.InformationProtectionPolicy; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InformationProtectionPoliciesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"lastModifiedUtc\":\"2021-09-28T10:09:58Z\",\"version\":\"ugggzlfbgrdcgu\",\"labels\":{},\"informationTypes\":{}},\"id\":\"dylperpilttjzgc\",\"name\":\"fcm\",\"type\":\"pfb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InformationProtectionPolicy response = - manager - .informationProtectionPolicies() - .define(InformationProtectionPolicyName.EFFECTIVE) - .withExistingScope("auwazcgwd") - .withLabels(mapOf()) - .withInformationTypes(mapOf()) - .create(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetWithResponseMockTests.java deleted file mode 100644 index afe0d0fc390c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesGetWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.InformationProtectionPolicy; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InformationProtectionPoliciesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"lastModifiedUtc\":\"2021-04-24T13:47:51Z\",\"version\":\"xnxmlbmuoswkj\",\"labels\":{},\"informationTypes\":{}},\"id\":\"cy\",\"name\":\"yzlwhbwzjnufzrf\",\"type\":\"m\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - InformationProtectionPolicy response = - manager - .informationProtectionPolicies() - .getWithResponse("rf", InformationProtectionPolicyName.CUSTOM, com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListMockTests.java deleted file mode 100644 index dc5034b7ba76..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPoliciesListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.InformationProtectionPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class InformationProtectionPoliciesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"lastModifiedUtc\":\"2021-01-14T00:19:35Z\",\"version\":\"dzuubjtvgjsxm\",\"labels\":{},\"informationTypes\":{}},\"id\":\"avdpwwobtdphtits\",\"name\":\"fofwan\",\"type\":\"hks\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.informationProtectionPolicies().list("qgnnbz", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPolicyListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPolicyListTests.java deleted file mode 100644 index 95c38e44ca1e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/InformationProtectionPolicyListTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.InformationProtectionPolicyInner; -import com.azure.resourcemanager.security.models.InformationProtectionPolicyList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -public final class InformationProtectionPolicyListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - InformationProtectionPolicyList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"lastModifiedUtc\":\"2021-01-14T06:42:30Z\",\"version\":\"btndo\",\"labels\":{},\"informationTypes\":{}},\"id\":\"gbjcntujitcjed\",\"name\":\"twwaezkojvdcpzf\",\"type\":\"qouicybxarzgsz\"},{\"properties\":{\"lastModifiedUtc\":\"2021-07-26T12:22:12Z\",\"version\":\"iqopidoamciod\",\"labels\":{},\"informationTypes\":{}},\"id\":\"azxkhnzbonlwnto\",\"name\":\"gokdwbwhks\",\"type\":\"zcmrvexztvb\"}],\"nextLink\":\"gsfraoyzkoow\"}") - .toObject(InformationProtectionPolicyList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - InformationProtectionPolicyList model = - new InformationProtectionPolicyList() - .withValue( - Arrays - .asList( - new InformationProtectionPolicyInner().withLabels(mapOf()).withInformationTypes(mapOf()), - new InformationProtectionPolicyInner().withLabels(mapOf()).withInformationTypes(mapOf()))); - model = BinaryData.fromObject(model).toObject(InformationProtectionPolicyList.class); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionConnectionStringTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionConnectionStringTests.java deleted file mode 100644 index b2e32e7d4689..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionConnectionStringTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IngestionConnectionString; - -public final class IngestionConnectionStringTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IngestionConnectionString model = - BinaryData - .fromString("{\"location\":\"d\",\"value\":\"ypivlsbb\"}") - .toObject(IngestionConnectionString.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IngestionConnectionString model = new IngestionConnectionString(); - model = BinaryData.fromObject(model).toObject(IngestionConnectionString.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingInnerTests.java deleted file mode 100644 index 2aa4af3471bf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IngestionSettingInner; - -public final class IngestionSettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IngestionSettingInner model = - BinaryData - .fromString("{\"properties\":\"datacqlh\",\"id\":\"isws\",\"name\":\"miii\",\"type\":\"v\"}") - .toObject(IngestionSettingInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IngestionSettingInner model = new IngestionSettingInner().withProperties("datacqlh"); - model = BinaryData.fromObject(model).toObject(IngestionSettingInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingListTests.java deleted file mode 100644 index f261272c0e03..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IngestionSettingList; - -public final class IngestionSettingListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IngestionSettingList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":\"datamhdroznnhdrlktg\",\"id\":\"csgguxhemlw\",\"name\":\"waeeczgfb\",\"type\":\"kklelssxblycs\"},{\"properties\":\"dataujksrlsmdesqplpv\",\"id\":\"jcdoewb\",\"name\":\"dyvt\",\"type\":\"owx\"},{\"properties\":\"datapiudeugfsxzecpa\",\"id\":\"wkufykhvuhxepm\",\"name\":\"utznabaobns\",\"type\":\"ujdjltymkmvg\"},{\"properties\":\"datahywartspph\",\"id\":\"ixkykxd\",\"name\":\"sj\",\"type\":\"emmucfxh\"}],\"nextLink\":\"kflrmymy\"}") - .toObject(IngestionSettingList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IngestionSettingList model = new IngestionSettingList(); - model = BinaryData.fromObject(model).toObject(IngestionSettingList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateWithResponseMockTests.java deleted file mode 100644 index 957fb8471852..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsCreateWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IngestionSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IngestionSettingsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":\"datanzrsbkkzovlzdmn\",\"id\":\"mfwsxafofu\",\"name\":\"orimmo\",\"type\":\"zwdehkkmvhz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IngestionSetting response = manager.ingestionSettings().define("ecuyr").withProperties("dataimb").create(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteWithResponseMockTests.java deleted file mode 100644 index 4e039d04b20b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IngestionSettingsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.ingestionSettings().deleteWithResponse("ezp", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetWithResponseMockTests.java deleted file mode 100644 index fb7975dc5601..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IngestionSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IngestionSettingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":\"datafiybxqich\",\"id\":\"ybfzdqekivycp\",\"name\":\"cv\",\"type\":\"izulrqtbht\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IngestionSetting response = - manager.ingestionSettings().getWithResponse("kdtfo", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsWithResponseMockTests.java deleted file mode 100644 index bb78d72945b5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListConnectionStringsWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ConnectionStrings; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IngestionSettingsListConnectionStringsWithResponseMockTests { - @Test - public void testListConnectionStringsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"dccgndjgdpriggqq\",\"value\":\"qfcbuul\"},{\"location\":\"uflqjfshtuj\",\"value\":\"ohigimwdcsk\"},{\"location\":\"qnq\",\"value\":\"ixnmbz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ConnectionStrings response = - manager - .ingestionSettings() - .listConnectionStringsWithResponse("il", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListMockTests.java deleted file mode 100644 index a8b3100f8f67..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IngestionSettingsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IngestionSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IngestionSettingsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":\"datahgjnaq\",\"id\":\"qipslz\",\"name\":\"vcdsvm\",\"type\":\"bit\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.ingestionSettings().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertInnerTests.java deleted file mode 100644 index 634b34355835..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecurityAggregatedAlertInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAggregatedAlertInner model = - BinaryData - .fromString( - "{\"properties\":{\"alertType\":\"riplrbpbewtg\",\"alertDisplayName\":\"gblcgwxzvlvq\",\"vendorName\":\"begibtnmxiebwwa\",\"reportedSeverity\":\"Low\",\"remediationSteps\":\"qcgw\",\"description\":\"zjuzgwyz\",\"count\":4114340895697399622,\"effectedResourceType\":\"ngmtsavjcb\",\"systemSource\":\"xqpsrknftguv\",\"actionTaken\":\"uhprwmdyvxqt\",\"logAnalyticsQuery\":\"riwwroy\",\"topDevicesList\":[{\"deviceId\":\"rmcqiby\",\"alertsCount\":8763943848607308417,\"lastOccurrence\":\"knme\"},{\"deviceId\":\"sgzvahapjyzhpv\",\"alertsCount\":6872658649281325491,\"lastOccurrence\":\"rvxdjzlmw\"},{\"deviceId\":\"kvugfhzovawjvzun\",\"alertsCount\":6384208989627743230,\"lastOccurrence\":\"n\"},{\"deviceId\":\"nxipeil\",\"alertsCount\":7813618899616430195,\"lastOccurrence\":\"e\"}]},\"tags\":{\"mv\":\"ultskzbbtdz\",\"wozuhkf\":\"ekg\"},\"id\":\"bsjyofdx\",\"name\":\"uusdttouwa\",\"type\":\"oekqvk\"}") - .toObject(IoTSecurityAggregatedAlertInner.class); - Assertions.assertEquals("ultskzbbtdz", model.tags().get("mv")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAggregatedAlertInner model = - new IoTSecurityAggregatedAlertInner().withTags(mapOf("mv", "ultskzbbtdz", "wozuhkf", "ekg")); - model = BinaryData.fromObject(model).toObject(IoTSecurityAggregatedAlertInner.class); - Assertions.assertEquals("ultskzbbtdz", model.tags().get("mv")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertListTests.java deleted file mode 100644 index cb00af9b5533..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertListTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertInner; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecurityAggregatedAlertListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAggregatedAlertList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"alertType\":\"b\",\"alertDisplayName\":\"ldawkzbaliourqha\",\"vendorName\":\"hashsfwxosow\",\"reportedSeverity\":\"Medium\",\"remediationSteps\":\"gicjooxdjeb\",\"description\":\"ucww\",\"count\":2907518339137583712,\"effectedResourceType\":\"vmeueci\",\"systemSource\":\"hzceuojgjrwjue\",\"actionTaken\":\"twm\",\"logAnalyticsQuery\":\"ytdxwit\",\"topDevicesList\":[]},\"tags\":{\"kxfbkpycgklwndn\":\"awgqwgxhni\",\"wzbtdhxu\":\"jdauwhvy\"},\"id\":\"znbmpowuwprzq\",\"name\":\"veual\",\"type\":\"pjmkhfxobbc\"}],\"nextLink\":\"s\"}") - .toObject(IoTSecurityAggregatedAlertList.class); - Assertions.assertEquals("awgqwgxhni", model.value().get(0).tags().get("kxfbkpycgklwndn")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAggregatedAlertList model = - new IoTSecurityAggregatedAlertList() - .withValue( - Arrays - .asList( - new IoTSecurityAggregatedAlertInner() - .withTags(mapOf("kxfbkpycgklwndn", "awgqwgxhni", "wzbtdhxu", "jdauwhvy")))); - model = BinaryData.fromObject(model).toObject(IoTSecurityAggregatedAlertList.class); - Assertions.assertEquals("awgqwgxhni", model.value().get(0).tags().get("kxfbkpycgklwndn")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertPropertiesTests.java deleted file mode 100644 index f2d7da1f12e4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedAlertProperties; - -public final class IoTSecurityAggregatedAlertPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAggregatedAlertProperties model = - BinaryData - .fromString( - "{\"alertType\":\"nsmvbxwyj\",\"alertDisplayName\":\"lh\",\"vendorName\":\"aln\",\"reportedSeverity\":\"High\",\"remediationSteps\":\"sxyawjoyaqcs\",\"description\":\"jpkiidzyexznelix\",\"count\":3030315127445847890,\"effectedResourceType\":\"folhbnxknal\",\"systemSource\":\"lp\",\"actionTaken\":\"gdtpnapnyiro\",\"logAnalyticsQuery\":\"hpigv\",\"topDevicesList\":[{\"deviceId\":\"gqgitxmedjvcsl\",\"alertsCount\":5849348987172300465,\"lastOccurrence\":\"ncw\"},{\"deviceId\":\"hxg\",\"alertsCount\":8312530618702549187,\"lastOccurrence\":\"ucnapkteoellwp\"},{\"deviceId\":\"d\",\"alertsCount\":4494990539994529771,\"lastOccurrence\":\"b\"},{\"deviceId\":\"ceopzfqrhhuaopp\",\"alertsCount\":5543596082951034644,\"lastOccurrence\":\"xolzdahzx\"}]}") - .toObject(IoTSecurityAggregatedAlertProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAggregatedAlertProperties model = new IoTSecurityAggregatedAlertProperties(); - model = BinaryData.fromObject(model).toObject(IoTSecurityAggregatedAlertProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertPropertiesTopDevicesListItemTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertPropertiesTopDevicesListItemTests.java deleted file mode 100644 index bd0e8b85ac1c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedAlertPropertiesTopDevicesListItemTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem; - -public final class IoTSecurityAggregatedAlertPropertiesTopDevicesListItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAggregatedAlertPropertiesTopDevicesListItem model = - BinaryData - .fromString( - "{\"deviceId\":\"obgbkdmoizp\",\"alertsCount\":753837388632017239,\"lastOccurrence\":\"rcfbunrm\"}") - .toObject(IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAggregatedAlertPropertiesTopDevicesListItem model = - new IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(); - model = BinaryData.fromObject(model).toObject(IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationInnerTests.java deleted file mode 100644 index c96292eadcba..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecurityAggregatedRecommendationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAggregatedRecommendationInner model = - BinaryData - .fromString( - "{\"properties\":{\"recommendationName\":\"hhkxbp\",\"recommendationDisplayName\":\"ymjhxxjyngudivkr\",\"description\":\"wbxqzvszjfau\",\"recommendationTypeId\":\"fdxxivetvtcqaqtd\",\"detectedBy\":\"mcbxvwvxysl\",\"remediationSteps\":\"hsfxoblytkb\",\"reportedSeverity\":\"Informational\",\"healthyDevices\":7965235858819395640,\"unhealthyDeviceCount\":2233870853702293034,\"logAnalyticsQuery\":\"rvrnsvshqjohxc\"},\"tags\":{\"uvwbhsqfs\":\"fovasr\",\"bsrfbj\":\"bcgjbirxbp\",\"otftpvjzbexilz\":\"dtws\",\"qtaruoujmkcjhwq\":\"nfqqnvwp\"},\"id\":\"tjrybnwjewgdr\",\"name\":\"ervnaenqpehi\",\"type\":\"doy\"}") - .toObject(IoTSecurityAggregatedRecommendationInner.class); - Assertions.assertEquals("fovasr", model.tags().get("uvwbhsqfs")); - Assertions.assertEquals("hhkxbp", model.recommendationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAggregatedRecommendationInner model = - new IoTSecurityAggregatedRecommendationInner() - .withTags( - mapOf( - "uvwbhsqfs", - "fovasr", - "bsrfbj", - "bcgjbirxbp", - "otftpvjzbexilz", - "dtws", - "qtaruoujmkcjhwq", - "nfqqnvwp")) - .withRecommendationName("hhkxbp"); - model = BinaryData.fromObject(model).toObject(IoTSecurityAggregatedRecommendationInner.class); - Assertions.assertEquals("fovasr", model.tags().get("uvwbhsqfs")); - Assertions.assertEquals("hhkxbp", model.recommendationName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationListTests.java deleted file mode 100644 index a0132eb01140..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationListTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationInner; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedRecommendationList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecurityAggregatedRecommendationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAggregatedRecommendationList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"recommendationName\":\"sadbz\",\"recommendationDisplayName\":\"vdfznudaodvxzb\",\"description\":\"blylpstdbh\",\"recommendationTypeId\":\"srzdzucerscdn\",\"detectedBy\":\"evfiwjmygt\",\"remediationSteps\":\"slswtm\",\"reportedSeverity\":\"Medium\",\"healthyDevices\":3002295961372287593,\"unhealthyDeviceCount\":3838355662332369134,\"logAnalyticsQuery\":\"semwabnet\"},\"tags\":{\"wubmwmbesldn\":\"szhedplvw\",\"lcxog\":\"wwtppj\",\"qqkdltfzxmhhvhgu\":\"okonzmnsikvmkqz\",\"xtibqdxbxwakbog\":\"eodkwobda\"},\"id\":\"xndlkzgxhu\",\"name\":\"iplbpodxunkbebxm\",\"type\":\"byyntwlrbqt\"},{\"properties\":{\"recommendationName\":\"evseotgqrlltmuwl\",\"recommendationDisplayName\":\"wzizxbmpgcjefuzm\",\"description\":\"pbttdum\",\"recommendationTypeId\":\"p\",\"detectedBy\":\"ebmnzbtbhjpglk\",\"remediationSteps\":\"ohdneuel\",\"reportedSeverity\":\"Informational\",\"healthyDevices\":8674928390516574118,\"unhealthyDeviceCount\":250164414285445387,\"logAnalyticsQuery\":\"fikdowwqu\"},\"tags\":{\"lvithhqzonosgg\":\"zx\",\"ljuti\":\"hcohfwdsjnk\"},\"id\":\"swacffgdkzz\",\"name\":\"wkfvhqcrailvp\",\"type\":\"ppfufl\"},{\"properties\":{\"recommendationName\":\"mh\",\"recommendationDisplayName\":\"xyjrxsagafcnih\",\"description\":\"qapnedgfbcv\",\"recommendationTypeId\":\"vq\",\"detectedBy\":\"keqdcvdrhvoods\",\"remediationSteps\":\"bobzdopcjwvnhd\",\"reportedSeverity\":\"Medium\",\"healthyDevices\":2069944131022748416,\"unhealthyDeviceCount\":6392707975975047926,\"logAnalyticsQuery\":\"lpmutwuoegrpkhj\"},\"tags\":{\"dggkzzlvmbmpa\":\"yqsluic\"},\"id\":\"modfvuefywsbpfvm\",\"name\":\"yhrfouyftaakcpw\",\"type\":\"yzvqt\"}],\"nextLink\":\"ubex\"}") - .toObject(IoTSecurityAggregatedRecommendationList.class); - Assertions.assertEquals("szhedplvw", model.value().get(0).tags().get("wubmwmbesldn")); - Assertions.assertEquals("sadbz", model.value().get(0).recommendationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAggregatedRecommendationList model = - new IoTSecurityAggregatedRecommendationList() - .withValue( - Arrays - .asList( - new IoTSecurityAggregatedRecommendationInner() - .withTags( - mapOf( - "wubmwmbesldn", - "szhedplvw", - "lcxog", - "wwtppj", - "qqkdltfzxmhhvhgu", - "okonzmnsikvmkqz", - "xtibqdxbxwakbog", - "eodkwobda")) - .withRecommendationName("sadbz"), - new IoTSecurityAggregatedRecommendationInner() - .withTags(mapOf("lvithhqzonosgg", "zx", "ljuti", "hcohfwdsjnk")) - .withRecommendationName("evseotgqrlltmuwl"), - new IoTSecurityAggregatedRecommendationInner() - .withTags(mapOf("dggkzzlvmbmpa", "yqsluic")) - .withRecommendationName("mh"))); - model = BinaryData.fromObject(model).toObject(IoTSecurityAggregatedRecommendationList.class); - Assertions.assertEquals("szhedplvw", model.value().get(0).tags().get("wubmwmbesldn")); - Assertions.assertEquals("sadbz", model.value().get(0).recommendationName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationPropertiesTests.java deleted file mode 100644 index 965d77288d01..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAggregatedRecommendationPropertiesTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecurityAggregatedRecommendationProperties; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecurityAggregatedRecommendationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAggregatedRecommendationProperties model = - BinaryData - .fromString( - "{\"recommendationName\":\"ifthnz\",\"recommendationDisplayName\":\"dslgnayqigynduh\",\"description\":\"hqlkthumaqo\",\"recommendationTypeId\":\"gycdu\",\"detectedBy\":\"r\",\"remediationSteps\":\"ccymvaolpsslql\",\"reportedSeverity\":\"High\",\"healthyDevices\":245140836582564523,\"unhealthyDeviceCount\":2285407320964329848,\"logAnalyticsQuery\":\"pswiydmcwyh\"}") - .toObject(IoTSecurityAggregatedRecommendationProperties.class); - Assertions.assertEquals("ifthnz", model.recommendationName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAggregatedRecommendationProperties model = - new IoTSecurityAggregatedRecommendationProperties().withRecommendationName("ifthnz"); - model = BinaryData.fromObject(model).toObject(IoTSecurityAggregatedRecommendationProperties.class); - Assertions.assertEquals("ifthnz", model.recommendationName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAlertedDeviceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAlertedDeviceTests.java deleted file mode 100644 index ad5edc1d2a5b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityAlertedDeviceTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice; - -public final class IoTSecurityAlertedDeviceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityAlertedDevice model = - BinaryData - .fromString("{\"deviceId\":\"laexqp\",\"alertsCount\":3403871146459803360}") - .toObject(IoTSecurityAlertedDevice.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityAlertedDevice model = new IoTSecurityAlertedDevice(); - model = BinaryData.fromObject(model).toObject(IoTSecurityAlertedDevice.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityDeviceAlertTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityDeviceAlertTests.java deleted file mode 100644 index 54c7ac693964..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityDeviceAlertTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert; - -public final class IoTSecurityDeviceAlertTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityDeviceAlert model = - BinaryData - .fromString( - "{\"alertDisplayName\":\"ws\",\"reportedSeverity\":\"Informational\",\"alertsCount\":8220008823832302214}") - .toObject(IoTSecurityDeviceAlert.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityDeviceAlert model = new IoTSecurityDeviceAlert(); - model = BinaryData.fromObject(model).toObject(IoTSecurityDeviceAlert.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityDeviceRecommendationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityDeviceRecommendationTests.java deleted file mode 100644 index 643cce2df7a3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecurityDeviceRecommendationTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation; - -public final class IoTSecurityDeviceRecommendationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecurityDeviceRecommendation model = - BinaryData - .fromString( - "{\"recommendationDisplayName\":\"vgomz\",\"reportedSeverity\":\"Low\",\"devicesCount\":2110052424631332756}") - .toObject(IoTSecurityDeviceRecommendation.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecurityDeviceRecommendation model = new IoTSecurityDeviceRecommendation(); - model = BinaryData.fromObject(model).toObject(IoTSecurityDeviceRecommendation.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelInnerTests.java deleted file mode 100644 index d54e2f52dd4c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelInnerTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner; -import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation; -import java.util.Arrays; - -public final class IoTSecuritySolutionAnalyticsModelInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecuritySolutionAnalyticsModelInner model = - BinaryData - .fromString( - "{\"properties\":{\"metrics\":{\"high\":4021445942662392747,\"medium\":4294667967107007677,\"low\":7036117632331754318},\"unhealthyDeviceCount\":2795086805451114111,\"devicesMetrics\":[{\"date\":\"2021-06-07T11:11Z\"}],\"topAlertedDevices\":[{\"deviceId\":\"lbbovplw\",\"alertsCount\":3734794049628665607},{\"deviceId\":\"yuguosvmkfssx\",\"alertsCount\":5126500575476383860},{\"deviceId\":\"plgmgsxnk\",\"alertsCount\":2541322280404196409}],\"mostPrevalentDeviceAlerts\":[{\"alertDisplayName\":\"pvlopwiyighxpkd\",\"reportedSeverity\":\"Medium\",\"alertsCount\":1775218219583343661},{\"alertDisplayName\":\"bbaumnyquped\",\"reportedSeverity\":\"Informational\",\"alertsCount\":533974290165093237}],\"mostPrevalentDeviceRecommendations\":[{\"recommendationDisplayName\":\"smtxpsieb\",\"reportedSeverity\":\"High\",\"devicesCount\":6627631118472357246},{\"recommendationDisplayName\":\"apskrdqm\",\"reportedSeverity\":\"Medium\",\"devicesCount\":6206046747227637327},{\"recommendationDisplayName\":\"dwkyzxuu\",\"reportedSeverity\":\"High\",\"devicesCount\":1186103723197260996}]},\"id\":\"cwsvlxotog\",\"name\":\"wrupqsxvnmicykvc\",\"type\":\"o\"}") - .toObject(IoTSecuritySolutionAnalyticsModelInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecuritySolutionAnalyticsModelInner model = - new IoTSecuritySolutionAnalyticsModelInner() - .withTopAlertedDevices( - Arrays - .asList( - new IoTSecurityAlertedDevice(), - new IoTSecurityAlertedDevice(), - new IoTSecurityAlertedDevice())) - .withMostPrevalentDeviceAlerts( - Arrays.asList(new IoTSecurityDeviceAlert(), new IoTSecurityDeviceAlert())) - .withMostPrevalentDeviceRecommendations( - Arrays - .asList( - new IoTSecurityDeviceRecommendation(), - new IoTSecurityDeviceRecommendation(), - new IoTSecurityDeviceRecommendation())); - model = BinaryData.fromObject(model).toObject(IoTSecuritySolutionAnalyticsModelInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelListInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelListInnerTests.java deleted file mode 100644 index f129646abccb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelListInnerTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelInner; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelListInner; -import java.util.Arrays; - -public final class IoTSecuritySolutionAnalyticsModelListInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecuritySolutionAnalyticsModelListInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"unhealthyDeviceCount\":623670055928945506,\"devicesMetrics\":[],\"topAlertedDevices\":[],\"mostPrevalentDeviceAlerts\":[],\"mostPrevalentDeviceRecommendations\":[]},\"id\":\"eyueaxibxujwb\",\"name\":\"qwalmuzyoxaepd\",\"type\":\"zjancuxr\"},{\"properties\":{\"unhealthyDeviceCount\":8073615781533611484,\"devicesMetrics\":[],\"topAlertedDevices\":[],\"mostPrevalentDeviceAlerts\":[],\"mostPrevalentDeviceRecommendations\":[]},\"id\":\"wd\",\"name\":\"swzts\",\"type\":\"bpg\"}],\"nextLink\":\"ytxhp\"}") - .toObject(IoTSecuritySolutionAnalyticsModelListInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecuritySolutionAnalyticsModelListInner model = - new IoTSecuritySolutionAnalyticsModelListInner() - .withValue( - Arrays - .asList( - new IoTSecuritySolutionAnalyticsModelInner() - .withTopAlertedDevices(Arrays.asList()) - .withMostPrevalentDeviceAlerts(Arrays.asList()) - .withMostPrevalentDeviceRecommendations(Arrays.asList()), - new IoTSecuritySolutionAnalyticsModelInner() - .withTopAlertedDevices(Arrays.asList()) - .withMostPrevalentDeviceAlerts(Arrays.asList()) - .withMostPrevalentDeviceRecommendations(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(IoTSecuritySolutionAnalyticsModelListInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItemTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItemTests.java deleted file mode 100644 index 9af4402ea31f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItemTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem; -import com.azure.resourcemanager.security.models.IoTSeverityMetrics; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItemTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem model = - BinaryData - .fromString( - "{\"date\":\"2021-08-28T04:10:12Z\",\"devicesMetrics\":{\"high\":6531016586304771464,\"medium\":6112562014909407139,\"low\":4716171323603349027}}") - .toObject(IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T04:10:12Z"), model.date()); - Assertions.assertEquals(6531016586304771464L, model.devicesMetrics().high()); - Assertions.assertEquals(6112562014909407139L, model.devicesMetrics().medium()); - Assertions.assertEquals(4716171323603349027L, model.devicesMetrics().low()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem model = - new IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem() - .withDate(OffsetDateTime.parse("2021-08-28T04:10:12Z")) - .withDevicesMetrics( - new IoTSeverityMetrics() - .withHigh(6531016586304771464L) - .withMedium(6112562014909407139L) - .withLow(4716171323603349027L)); - model = - BinaryData.fromObject(model).toObject(IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T04:10:12Z"), model.date()); - Assertions.assertEquals(6531016586304771464L, model.devicesMetrics().high()); - Assertions.assertEquals(6112562014909407139L, model.devicesMetrics().medium()); - Assertions.assertEquals(4716171323603349027L, model.devicesMetrics().low()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelPropertiesTests.java deleted file mode 100644 index 805e5e37424a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionAnalyticsModelPropertiesTests.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionAnalyticsModelProperties; -import com.azure.resourcemanager.security.models.IoTSecurityAlertedDevice; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceAlert; -import com.azure.resourcemanager.security.models.IoTSecurityDeviceRecommendation; -import java.util.Arrays; - -public final class IoTSecuritySolutionAnalyticsModelPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecuritySolutionAnalyticsModelProperties model = - BinaryData - .fromString( - "{\"metrics\":{\"high\":2202893815567667311,\"medium\":5776325152256074523,\"low\":2732685754264877829},\"unhealthyDeviceCount\":3928242933963476014,\"devicesMetrics\":[{\"date\":\"2021-03-07T15:05:13Z\",\"devicesMetrics\":{\"high\":319665118186558655,\"medium\":3857673152007757003,\"low\":2825151831912713640}},{\"date\":\"2021-06-24T08:22:45Z\",\"devicesMetrics\":{\"high\":2116320352279967667,\"medium\":962291776216015099,\"low\":6718667665096544770}},{\"date\":\"2021-09-22T11:52:27Z\",\"devicesMetrics\":{\"high\":2840285264321299730,\"medium\":6255558235157330938,\"low\":3221959502351885450}},{\"date\":\"2021-10-09T14:43:40Z\",\"devicesMetrics\":{\"high\":4392160629829565824,\"medium\":1781523879629973808,\"low\":3301208873451353508}}],\"topAlertedDevices\":[{\"deviceId\":\"zq\",\"alertsCount\":8605356393131124323},{\"deviceId\":\"pmueefjzwfqk\",\"alertsCount\":7502146387336972702},{\"deviceId\":\"suyonobglaocq\",\"alertsCount\":2903733515306491145},{\"deviceId\":\"g\",\"alertsCount\":4531156159452032810}],\"mostPrevalentDeviceAlerts\":[{\"alertDisplayName\":\"moyrxvwfudwpz\",\"reportedSeverity\":\"High\",\"alertsCount\":6087131419458323367},{\"alertDisplayName\":\"lrqjbhckfr\",\"reportedSeverity\":\"Low\",\"alertsCount\":6356911616351908297}],\"mostPrevalentDeviceRecommendations\":[{\"recommendationDisplayName\":\"pycanuzbpz\",\"reportedSeverity\":\"High\",\"devicesCount\":3708510664132188472},{\"recommendationDisplayName\":\"crnwbmeh\",\"reportedSeverity\":\"High\",\"devicesCount\":455506710783591694},{\"recommendationDisplayName\":\"srtslhspkdeem\",\"reportedSeverity\":\"Informational\",\"devicesCount\":5804956821269941754},{\"recommendationDisplayName\":\"kv\",\"reportedSeverity\":\"Low\",\"devicesCount\":8799257187575805529}]}") - .toObject(IoTSecuritySolutionAnalyticsModelProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecuritySolutionAnalyticsModelProperties model = - new IoTSecuritySolutionAnalyticsModelProperties() - .withTopAlertedDevices( - Arrays - .asList( - new IoTSecurityAlertedDevice(), - new IoTSecurityAlertedDevice(), - new IoTSecurityAlertedDevice(), - new IoTSecurityAlertedDevice())) - .withMostPrevalentDeviceAlerts( - Arrays.asList(new IoTSecurityDeviceAlert(), new IoTSecurityDeviceAlert())) - .withMostPrevalentDeviceRecommendations( - Arrays - .asList( - new IoTSecurityDeviceRecommendation(), - new IoTSecurityDeviceRecommendation(), - new IoTSecurityDeviceRecommendation(), - new IoTSecurityDeviceRecommendation())); - model = BinaryData.fromObject(model).toObject(IoTSecuritySolutionAnalyticsModelProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionModelInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionModelInnerTests.java deleted file mode 100644 index 6d1733cdce9b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionModelInnerTests.java +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner; -import com.azure.resourcemanager.security.models.AdditionalWorkspaceType; -import com.azure.resourcemanager.security.models.AdditionalWorkspacesProperties; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.RecommendationConfigStatus; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecuritySolutionModelInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecuritySolutionModelInner model = - BinaryData - .fromString( - "{\"location\":\"yocf\",\"properties\":{\"workspace\":\"s\",\"displayName\":\"mddystkiiux\",\"status\":\"Disabled\",\"export\":[\"RawEvents\",\"RawEvents\",\"RawEvents\",\"RawEvents\"],\"disabledDataSources\":[\"TwinData\",\"TwinData\",\"TwinData\",\"TwinData\"],\"iotHubs\":[\"vyifqrvkdvjsl\",\"rm\",\"vdfwatkpn\"],\"userDefinedResources\":{\"query\":\"lexxbczwtru\",\"querySubscriptions\":[\"qzbqjvsov\",\"yokacspkw\"]},\"autoDiscoveredResources\":[\"dobpxjmflbvvn\",\"hrk\",\"ciwwzjuqkhr\",\"ajiwkuo\"],\"recommendationsConfiguration\":[{\"recommendationType\":\"IoT_AgentSendsUnutilizedMessages\",\"name\":\"hsauuimjmvxied\",\"status\":\"Disabled\"},{\"recommendationType\":\"IoT_IPFilter_DenyAll\",\"name\":\"dyjrrfbyaosv\",\"status\":\"Disabled\"},{\"recommendationType\":\"IoT_PermissiveFirewallPolicy\",\"name\":\"onpc\",\"status\":\"Enabled\"}],\"unmaskedIpLoggingStatus\":\"Disabled\",\"additionalWorkspaces\":[{\"workspace\":\"lkevle\",\"type\":\"Sentinel\",\"dataTypes\":[]},{\"workspace\":\"u\",\"type\":\"Sentinel\",\"dataTypes\":[]},{\"workspace\":\"axkffei\",\"type\":\"Sentinel\",\"dataTypes\":[]}]},\"tags\":{\"shxmzsbbzoggigrx\":\"zy\"},\"id\":\"burvjxxjnspy\",\"name\":\"ptkoenkoukn\",\"type\":\"udwtiukbl\"}") - .toObject(IoTSecuritySolutionModelInner.class); - Assertions.assertEquals("yocf", model.location()); - Assertions.assertEquals("zy", model.tags().get("shxmzsbbzoggigrx")); - Assertions.assertEquals("s", model.workspace()); - Assertions.assertEquals("mddystkiiux", model.displayName()); - Assertions.assertEquals(SecuritySolutionStatus.DISABLED, model.status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, model.export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, model.disabledDataSources().get(0)); - Assertions.assertEquals("vyifqrvkdvjsl", model.iotHubs().get(0)); - Assertions.assertEquals("lexxbczwtru", model.userDefinedResources().query()); - Assertions.assertEquals("qzbqjvsov", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_AGENT_SENDS_UNUTILIZED_MESSAGES, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.DISABLED, model.recommendationsConfiguration().get(0).status()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.DISABLED, model.unmaskedIpLoggingStatus()); - Assertions.assertEquals("lkevle", model.additionalWorkspaces().get(0).workspace()); - Assertions.assertEquals(AdditionalWorkspaceType.SENTINEL, model.additionalWorkspaces().get(0).type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecuritySolutionModelInner model = - new IoTSecuritySolutionModelInner() - .withLocation("yocf") - .withTags(mapOf("shxmzsbbzoggigrx", "zy")) - .withWorkspace("s") - .withDisplayName("mddystkiiux") - .withStatus(SecuritySolutionStatus.DISABLED) - .withExport( - Arrays - .asList( - ExportData.RAW_EVENTS, ExportData.RAW_EVENTS, ExportData.RAW_EVENTS, ExportData.RAW_EVENTS)) - .withDisabledDataSources( - Arrays - .asList(DataSource.TWIN_DATA, DataSource.TWIN_DATA, DataSource.TWIN_DATA, DataSource.TWIN_DATA)) - .withIotHubs(Arrays.asList("vyifqrvkdvjsl", "rm", "vdfwatkpn")) - .withUserDefinedResources( - new UserDefinedResourcesProperties() - .withQuery("lexxbczwtru") - .withQuerySubscriptions(Arrays.asList("qzbqjvsov", "yokacspkw"))) - .withRecommendationsConfiguration( - Arrays - .asList( - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_AGENT_SENDS_UNUTILIZED_MESSAGES) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_IPFILTER_DENY_ALL) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_PERMISSIVE_FIREWALL_POLICY) - .withStatus(RecommendationConfigStatus.ENABLED))) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.DISABLED) - .withAdditionalWorkspaces( - Arrays - .asList( - new AdditionalWorkspacesProperties() - .withWorkspace("lkevle") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes(Arrays.asList()), - new AdditionalWorkspacesProperties() - .withWorkspace("u") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes(Arrays.asList()), - new AdditionalWorkspacesProperties() - .withWorkspace("axkffei") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(IoTSecuritySolutionModelInner.class); - Assertions.assertEquals("yocf", model.location()); - Assertions.assertEquals("zy", model.tags().get("shxmzsbbzoggigrx")); - Assertions.assertEquals("s", model.workspace()); - Assertions.assertEquals("mddystkiiux", model.displayName()); - Assertions.assertEquals(SecuritySolutionStatus.DISABLED, model.status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, model.export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, model.disabledDataSources().get(0)); - Assertions.assertEquals("vyifqrvkdvjsl", model.iotHubs().get(0)); - Assertions.assertEquals("lexxbczwtru", model.userDefinedResources().query()); - Assertions.assertEquals("qzbqjvsov", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_AGENT_SENDS_UNUTILIZED_MESSAGES, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.DISABLED, model.recommendationsConfiguration().get(0).status()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.DISABLED, model.unmaskedIpLoggingStatus()); - Assertions.assertEquals("lkevle", model.additionalWorkspaces().get(0).workspace()); - Assertions.assertEquals(AdditionalWorkspaceType.SENTINEL, model.additionalWorkspaces().get(0).type()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionPropertiesTests.java deleted file mode 100644 index 61a6ccee5b0a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionPropertiesTests.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionProperties; -import com.azure.resourcemanager.security.models.AdditionalWorkspaceDataType; -import com.azure.resourcemanager.security.models.AdditionalWorkspaceType; -import com.azure.resourcemanager.security.models.AdditionalWorkspacesProperties; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.RecommendationConfigStatus; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecuritySolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecuritySolutionProperties model = - BinaryData - .fromString( - "{\"workspace\":\"gkpocipazyxoe\",\"displayName\":\"ukgjnpiucgygevq\",\"status\":\"Disabled\",\"export\":[\"RawEvents\"],\"disabledDataSources\":[\"TwinData\",\"TwinData\",\"TwinData\",\"TwinData\"],\"iotHubs\":[\"r\",\"j\"],\"userDefinedResources\":{\"query\":\"pyd\",\"querySubscriptions\":[\"yhxdeoejzicwi\",\"sjttgzfbish\"]},\"autoDiscoveredResources\":[\"hajdeyeamdpha\"],\"recommendationsConfiguration\":[{\"recommendationType\":\"IoT_PermissiveInputFirewallRules\",\"name\":\"uxwgipwho\",\"status\":\"Disabled\"},{\"recommendationType\":\"IoT_InstallAgent\",\"name\":\"gshwankixz\",\"status\":\"Disabled\"},{\"recommendationType\":\"IoT_PermissiveInputFirewallRules\",\"name\":\"eputtmrywnuzoqf\",\"status\":\"Disabled\"},{\"recommendationType\":\"IoT_PermissiveOutputFirewallRules\",\"name\":\"zrnkcqvyxlwh\",\"status\":\"Enabled\"}],\"unmaskedIpLoggingStatus\":\"Enabled\",\"additionalWorkspaces\":[{\"workspace\":\"oqqnwvlryav\",\"type\":\"Sentinel\",\"dataTypes\":[\"RawEvents\",\"RawEvents\"]},{\"workspace\":\"qhgyxzkonocukok\",\"type\":\"Sentinel\",\"dataTypes\":[\"RawEvents\",\"Alerts\",\"RawEvents\",\"Alerts\"]},{\"workspace\":\"szfkbe\",\"type\":\"Sentinel\",\"dataTypes\":[\"RawEvents\",\"Alerts\",\"RawEvents\"]},{\"workspace\":\"vvjektcxsenhwlrs\",\"type\":\"Sentinel\",\"dataTypes\":[\"Alerts\",\"Alerts\"]}]}") - .toObject(IoTSecuritySolutionProperties.class); - Assertions.assertEquals("gkpocipazyxoe", model.workspace()); - Assertions.assertEquals("ukgjnpiucgygevq", model.displayName()); - Assertions.assertEquals(SecuritySolutionStatus.DISABLED, model.status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, model.export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, model.disabledDataSources().get(0)); - Assertions.assertEquals("r", model.iotHubs().get(0)); - Assertions.assertEquals("pyd", model.userDefinedResources().query()); - Assertions.assertEquals("yhxdeoejzicwi", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_PERMISSIVE_INPUT_FIREWALL_RULES, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.DISABLED, model.recommendationsConfiguration().get(0).status()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.ENABLED, model.unmaskedIpLoggingStatus()); - Assertions.assertEquals("oqqnwvlryav", model.additionalWorkspaces().get(0).workspace()); - Assertions.assertEquals(AdditionalWorkspaceType.SENTINEL, model.additionalWorkspaces().get(0).type()); - Assertions - .assertEquals( - AdditionalWorkspaceDataType.RAW_EVENTS, model.additionalWorkspaces().get(0).dataTypes().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecuritySolutionProperties model = - new IoTSecuritySolutionProperties() - .withWorkspace("gkpocipazyxoe") - .withDisplayName("ukgjnpiucgygevq") - .withStatus(SecuritySolutionStatus.DISABLED) - .withExport(Arrays.asList(ExportData.RAW_EVENTS)) - .withDisabledDataSources( - Arrays - .asList(DataSource.TWIN_DATA, DataSource.TWIN_DATA, DataSource.TWIN_DATA, DataSource.TWIN_DATA)) - .withIotHubs(Arrays.asList("r", "j")) - .withUserDefinedResources( - new UserDefinedResourcesProperties() - .withQuery("pyd") - .withQuerySubscriptions(Arrays.asList("yhxdeoejzicwi", "sjttgzfbish"))) - .withRecommendationsConfiguration( - Arrays - .asList( - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_PERMISSIVE_INPUT_FIREWALL_RULES) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_INSTALL_AGENT) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_PERMISSIVE_INPUT_FIREWALL_RULES) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_PERMISSIVE_OUTPUT_FIREWALL_RULES) - .withStatus(RecommendationConfigStatus.ENABLED))) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.ENABLED) - .withAdditionalWorkspaces( - Arrays - .asList( - new AdditionalWorkspacesProperties() - .withWorkspace("oqqnwvlryav") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes( - Arrays - .asList( - AdditionalWorkspaceDataType.RAW_EVENTS, - AdditionalWorkspaceDataType.RAW_EVENTS)), - new AdditionalWorkspacesProperties() - .withWorkspace("qhgyxzkonocukok") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes( - Arrays - .asList( - AdditionalWorkspaceDataType.RAW_EVENTS, - AdditionalWorkspaceDataType.ALERTS, - AdditionalWorkspaceDataType.RAW_EVENTS, - AdditionalWorkspaceDataType.ALERTS)), - new AdditionalWorkspacesProperties() - .withWorkspace("szfkbe") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes( - Arrays - .asList( - AdditionalWorkspaceDataType.RAW_EVENTS, - AdditionalWorkspaceDataType.ALERTS, - AdditionalWorkspaceDataType.RAW_EVENTS)), - new AdditionalWorkspacesProperties() - .withWorkspace("vvjektcxsenhwlrs") - .withType(AdditionalWorkspaceType.SENTINEL) - .withDataTypes( - Arrays - .asList( - AdditionalWorkspaceDataType.ALERTS, AdditionalWorkspaceDataType.ALERTS)))); - model = BinaryData.fromObject(model).toObject(IoTSecuritySolutionProperties.class); - Assertions.assertEquals("gkpocipazyxoe", model.workspace()); - Assertions.assertEquals("ukgjnpiucgygevq", model.displayName()); - Assertions.assertEquals(SecuritySolutionStatus.DISABLED, model.status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, model.export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, model.disabledDataSources().get(0)); - Assertions.assertEquals("r", model.iotHubs().get(0)); - Assertions.assertEquals("pyd", model.userDefinedResources().query()); - Assertions.assertEquals("yhxdeoejzicwi", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_PERMISSIVE_INPUT_FIREWALL_RULES, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.DISABLED, model.recommendationsConfiguration().get(0).status()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.ENABLED, model.unmaskedIpLoggingStatus()); - Assertions.assertEquals("oqqnwvlryav", model.additionalWorkspaces().get(0).workspace()); - Assertions.assertEquals(AdditionalWorkspaceType.SENTINEL, model.additionalWorkspaces().get(0).type()); - Assertions - .assertEquals( - AdditionalWorkspaceDataType.RAW_EVENTS, model.additionalWorkspaces().get(0).dataTypes().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionsListTests.java deleted file mode 100644 index cb1dbc83eeb1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSecuritySolutionsListTests.java +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.IoTSecuritySolutionModelInner; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionsList; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IoTSecuritySolutionsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSecuritySolutionsList model = - BinaryData - .fromString( - "{\"value\":[{\"location\":\"dgwdslfhot\",\"properties\":{\"workspace\":\"ynpwlbj\",\"displayName\":\"pgacftadehxnlty\",\"status\":\"Disabled\",\"export\":[],\"disabledDataSources\":[],\"iotHubs\":[],\"autoDiscoveredResources\":[],\"recommendationsConfiguration\":[],\"unmaskedIpLoggingStatus\":\"Disabled\",\"additionalWorkspaces\":[]},\"tags\":{\"avo\":\"ej\",\"vudwx\":\"xzdmohctb\"},\"id\":\"ndnvo\",\"name\":\"gujjugwdkcglh\",\"type\":\"lazjdyggdtjixhbk\"},{\"location\":\"fqweykhmene\",\"properties\":{\"workspace\":\"exfwhy\",\"displayName\":\"cibvyvdcsitynn\",\"status\":\"Disabled\",\"export\":[],\"disabledDataSources\":[],\"iotHubs\":[],\"autoDiscoveredResources\":[],\"recommendationsConfiguration\":[],\"unmaskedIpLoggingStatus\":\"Disabled\",\"additionalWorkspaces\":[]},\"tags\":{\"hezrkgq\":\"jeyp\"},\"id\":\"c\",\"name\":\"refovgmkqsleyyvx\",\"type\":\"qjpkcattpngjcrc\"},{\"location\":\"sqpjhvmdajvn\",\"properties\":{\"workspace\":\"unqecanoae\",\"displayName\":\"pfhyhl\",\"status\":\"Enabled\",\"export\":[],\"disabledDataSources\":[],\"iotHubs\":[],\"autoDiscoveredResources\":[],\"recommendationsConfiguration\":[],\"unmaskedIpLoggingStatus\":\"Disabled\",\"additionalWorkspaces\":[]},\"tags\":{\"aodsfcpkv\":\"kthfui\"},\"id\":\"odpuozmyzydag\",\"name\":\"uaxbezyiuokkt\",\"type\":\"hrdxwzywqsmbs\"}],\"nextLink\":\"exim\"}") - .toObject(IoTSecuritySolutionsList.class); - Assertions.assertEquals("dgwdslfhot", model.value().get(0).location()); - Assertions.assertEquals("ej", model.value().get(0).tags().get("avo")); - Assertions.assertEquals("ynpwlbj", model.value().get(0).workspace()); - Assertions.assertEquals("pgacftadehxnlty", model.value().get(0).displayName()); - Assertions.assertEquals(SecuritySolutionStatus.DISABLED, model.value().get(0).status()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.DISABLED, model.value().get(0).unmaskedIpLoggingStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSecuritySolutionsList model = - new IoTSecuritySolutionsList() - .withValue( - Arrays - .asList( - new IoTSecuritySolutionModelInner() - .withLocation("dgwdslfhot") - .withTags(mapOf("avo", "ej", "vudwx", "xzdmohctb")) - .withWorkspace("ynpwlbj") - .withDisplayName("pgacftadehxnlty") - .withStatus(SecuritySolutionStatus.DISABLED) - .withExport(Arrays.asList()) - .withDisabledDataSources(Arrays.asList()) - .withIotHubs(Arrays.asList()) - .withRecommendationsConfiguration(Arrays.asList()) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.DISABLED) - .withAdditionalWorkspaces(Arrays.asList()), - new IoTSecuritySolutionModelInner() - .withLocation("fqweykhmene") - .withTags(mapOf("hezrkgq", "jeyp")) - .withWorkspace("exfwhy") - .withDisplayName("cibvyvdcsitynn") - .withStatus(SecuritySolutionStatus.DISABLED) - .withExport(Arrays.asList()) - .withDisabledDataSources(Arrays.asList()) - .withIotHubs(Arrays.asList()) - .withRecommendationsConfiguration(Arrays.asList()) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.DISABLED) - .withAdditionalWorkspaces(Arrays.asList()), - new IoTSecuritySolutionModelInner() - .withLocation("sqpjhvmdajvn") - .withTags(mapOf("aodsfcpkv", "kthfui")) - .withWorkspace("unqecanoae") - .withDisplayName("pfhyhl") - .withStatus(SecuritySolutionStatus.ENABLED) - .withExport(Arrays.asList()) - .withDisabledDataSources(Arrays.asList()) - .withIotHubs(Arrays.asList()) - .withRecommendationsConfiguration(Arrays.asList()) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.DISABLED) - .withAdditionalWorkspaces(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(IoTSecuritySolutionsList.class); - Assertions.assertEquals("dgwdslfhot", model.value().get(0).location()); - Assertions.assertEquals("ej", model.value().get(0).tags().get("avo")); - Assertions.assertEquals("ynpwlbj", model.value().get(0).workspace()); - Assertions.assertEquals("pgacftadehxnlty", model.value().get(0).displayName()); - Assertions.assertEquals(SecuritySolutionStatus.DISABLED, model.value().get(0).status()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.DISABLED, model.value().get(0).unmaskedIpLoggingStatus()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSeverityMetricsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSeverityMetricsTests.java deleted file mode 100644 index 17e411e56574..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IoTSeverityMetricsTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.IoTSeverityMetrics; -import org.junit.jupiter.api.Assertions; - -public final class IoTSeverityMetricsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IoTSeverityMetrics model = - BinaryData - .fromString("{\"high\":9028045602986691631,\"medium\":2874780118088744582,\"low\":9144697658006681867}") - .toObject(IoTSeverityMetrics.class); - Assertions.assertEquals(9028045602986691631L, model.high()); - Assertions.assertEquals(2874780118088744582L, model.medium()); - Assertions.assertEquals(9144697658006681867L, model.low()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IoTSeverityMetrics model = - new IoTSeverityMetrics() - .withHigh(9028045602986691631L) - .withMedium(2874780118088744582L) - .withLow(9144697658006681867L); - model = BinaryData.fromObject(model).toObject(IoTSeverityMetrics.class); - Assertions.assertEquals(9028045602986691631L, model.high()); - Assertions.assertEquals(2874780118088744582L, model.medium()); - Assertions.assertEquals(9144697658006681867L, model.low()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetWithResponseMockTests.java deleted file mode 100644 index 0457202989af..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModel; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionAnalyticsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"metrics\":{\"high\":5542611774329052681,\"medium\":6661372100363486743,\"low\":3710990785713505162},\"unhealthyDeviceCount\":7761016592414796563,\"devicesMetrics\":[],\"topAlertedDevices\":[],\"mostPrevalentDeviceAlerts\":[],\"mostPrevalentDeviceRecommendations\":[]},\"id\":\"tjoxztfw\",\"name\":\"qchvczevjn\",\"type\":\"cta\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IoTSecuritySolutionAnalyticsModel response = - manager - .iotSecuritySolutionAnalytics() - .getWithResponse("u", "t", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListWithResponseMockTests.java deleted file mode 100644 index 12ef01040d97..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionAnalyticsListWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionAnalyticsModelList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionAnalyticsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"bjgmnzj\",\"name\":\"t\",\"type\":\"mrxkhlobvv\"},{\"id\":\"hvhd\",\"name\":\"qayfl\",\"type\":\"iyu\"}],\"nextLink\":\"n\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IoTSecuritySolutionAnalyticsModelList response = - manager - .iotSecuritySolutionAnalytics() - .listWithResponse("aaqgzeka", "clyzgs", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsDismissWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsDismissWithResponseMockTests.java deleted file mode 100644 index 40c910b36ec4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsDismissWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsAnalyticsAggregatedAlertsDismissWithResponseMockTests { - @Test - public void testDismissWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .dismissWithResponse("z", "xlujkhnjcm", "nkfm", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsGetWithResponseMockTests.java deleted file mode 100644 index 51be7ab6a50e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlert; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsAnalyticsAggregatedAlertsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"alertType\":\"psimioy\",\"alertDisplayName\":\"glkmiqwnnr\",\"vendorName\":\"ibb\",\"reportedSeverity\":\"High\",\"remediationSteps\":\"pkl\",\"description\":\"ydgnha\",\"count\":3154276649040417156,\"effectedResourceType\":\"exzgpmnmabedd\",\"systemSource\":\"lwgdfpfqfpcvs\",\"actionTaken\":\"l\",\"logAnalyticsQuery\":\"rvwerfwxbsmtb\",\"topDevicesList\":[]},\"tags\":{\"kwdvbtb\":\"hci\"},\"id\":\"ekqhs\",\"name\":\"htfpwpqb\",\"type\":\"ejuwyqwdqigmghgi\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IoTSecurityAggregatedAlert response = - manager - .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .getWithResponse("tdavuqmcbymsfobj", "quvjez", "j", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("hci", response.tags().get("kwdvbtb")); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsListMockTests.java deleted file mode 100644 index 611fe6f5a224..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsAggregatedAlertsListMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedAlert; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsAnalyticsAggregatedAlertsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"alertType\":\"xqabckmzeoxi\",\"alertDisplayName\":\"greohtwhlpuzjp\",\"vendorName\":\"znzangprbfaxy\",\"reportedSeverity\":\"Medium\",\"remediationSteps\":\"ciphmsexr\",\"description\":\"rndktx\",\"count\":8107112782048178404,\"effectedResourceType\":\"eeqgpkri\",\"systemSource\":\"bgnixxoww\",\"actionTaken\":\"yfwnw\",\"logAnalyticsQuery\":\"wxeiicrmpepk\",\"topDevicesList\":[]},\"tags\":{\"rasek\":\"xijvskwsdgkjgyac\"},\"id\":\"efcvo\",\"name\":\"nwoqartwy\",\"type\":\"qicladv\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .iotSecuritySolutionsAnalyticsAggregatedAlerts() - .list("fyvrtpqpemhzcgk", "epdqhqyhwq", 252630032, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xijvskwsdgkjgyac", response.iterator().next().tags().get("rasek")); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationsGetWithResponseMockTests.java deleted file mode 100644 index e4f5c8c4df4a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationsGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedRecommendation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsAnalyticsRecommendationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"recommendationName\":\"uavt\",\"recommendationDisplayName\":\"bkew\",\"description\":\"yn\",\"recommendationTypeId\":\"gbvoffbkk\",\"detectedBy\":\"dxaexqokmyrljia\",\"remediationSteps\":\"bn\",\"reportedSeverity\":\"Medium\",\"healthyDevices\":565720864272399930,\"unhealthyDeviceCount\":7735327142708488909,\"logAnalyticsQuery\":\"rpzuyudivbx\"},\"tags\":{\"nqelwgdhuru\":\"qeae\",\"za\":\"y\",\"mpinmzvfkneerzzt\":\"ogatmoljiy\"},\"id\":\"knsjulugd\",\"name\":\"bnhrxlelfjhkeiz\",\"type\":\"pihtdmiwjekpt\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IoTSecurityAggregatedRecommendation response = - manager - .iotSecuritySolutionsAnalyticsRecommendations() - .getWithResponse("h", "qtwmlmhjnqtqeahj", "dvragpokddxejhh", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("qeae", response.tags().get("nqelwgdhuru")); - Assertions.assertEquals("uavt", response.recommendationName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationsListMockTests.java deleted file mode 100644 index f2b7c7fd6e64..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsAnalyticsRecommendationsListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.IoTSecurityAggregatedRecommendation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsAnalyticsRecommendationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"recommendationName\":\"auolawiu\",\"recommendationDisplayName\":\"oms\",\"description\":\"vjhvvlr\",\"recommendationTypeId\":\"hewjjmajnkdflqio\",\"detectedBy\":\"waeqkzfzqxjosho\",\"remediationSteps\":\"otryegp\",\"reportedSeverity\":\"Medium\",\"healthyDevices\":341577657952902216,\"unhealthyDeviceCount\":4595206481574403678,\"logAnalyticsQuery\":\"wkbfokxkhupzer\"},\"tags\":{\"yykyalu\":\"jblcdrmyfcemftz\"},\"id\":\"ekdfqnhttwd\",\"name\":\"wrczfjjnnuxxrk\",\"type\":\"mhmnulwemp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .iotSecuritySolutionsAnalyticsRecommendations() - .list("caydbjzcqymlcfnz", "mhsurlgwqkpmm", 1745325763, com.azure.core.util.Context.NONE); - - Assertions.assertEquals("jblcdrmyfcemftz", response.iterator().next().tags().get("yykyalu")); - Assertions.assertEquals("auolawiu", response.iterator().next().recommendationName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index d379b4a647bc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"location\":\"vmtumxpym\",\"properties\":{\"workspace\":\"uaxroqvqpilrgu\",\"displayName\":\"canlduwzorxs\",\"status\":\"Enabled\",\"export\":[\"RawEvents\"],\"disabledDataSources\":[\"TwinData\"],\"iotHubs\":[\"x\",\"qvfqepdxc\"],\"userDefinedResources\":{\"query\":\"uubwyvpjb\",\"querySubscriptions\":[]},\"autoDiscoveredResources\":[\"pjqduqgix\"],\"recommendationsConfiguration\":[],\"unmaskedIpLoggingStatus\":\"Disabled\",\"additionalWorkspaces\":[]},\"tags\":{\"ftcvbii\":\"avhuerkjddvrglie\"},\"id\":\"tksdwgdnkefgmw\",\"name\":\"hcebuvczldbglzo\",\"type\":\"t\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IoTSecuritySolutionModel response = - manager - .iotSecuritySolutions() - .define("rulfuct") - .withExistingResourceGroup("aqgvto") - .withRegion("rthcfjzh") - .withTags(mapOf("iibelwcerw", "quwzp", "pjxljtxb", "w", "sdzhgbdgzpagsec", "sqtbxxniu")) - .withWorkspace("ubqjro") - .withDisplayName("tvrjeqmtz") - .withStatus(SecuritySolutionStatus.DISABLED) - .withExport( - Arrays - .asList( - ExportData.RAW_EVENTS, ExportData.RAW_EVENTS, ExportData.RAW_EVENTS, ExportData.RAW_EVENTS)) - .withDisabledDataSources( - Arrays - .asList(DataSource.TWIN_DATA, DataSource.TWIN_DATA, DataSource.TWIN_DATA, DataSource.TWIN_DATA)) - .withIotHubs(Arrays.asList("bsrwrsnrhpqat")) - .withUserDefinedResources( - new UserDefinedResourcesProperties().withQuery("kkvyanxk").withQuerySubscriptions(Arrays.asList())) - .withRecommendationsConfiguration(Arrays.asList()) - .withUnmaskedIpLoggingStatus(UnmaskedIpLoggingStatus.DISABLED) - .withAdditionalWorkspaces(Arrays.asList()) - .create(); - - Assertions.assertEquals("vmtumxpym", response.location()); - Assertions.assertEquals("avhuerkjddvrglie", response.tags().get("ftcvbii")); - Assertions.assertEquals("uaxroqvqpilrgu", response.workspace()); - Assertions.assertEquals("canlduwzorxs", response.displayName()); - Assertions.assertEquals(SecuritySolutionStatus.ENABLED, response.status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, response.export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, response.disabledDataSources().get(0)); - Assertions.assertEquals("x", response.iotHubs().get(0)); - Assertions.assertEquals("uubwyvpjb", response.userDefinedResources().query()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.DISABLED, response.unmaskedIpLoggingStatus()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 2cc55bb3dc76..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .iotSecuritySolutions() - .deleteByResourceGroupWithResponse("chskxxka", "sbvr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsGetByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index d0af517eeafd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"location\":\"gwokmikpazfbmjxu\",\"properties\":{\"workspace\":\"pfdvhaxdv\",\"displayName\":\"zaehpphthd\",\"status\":\"Disabled\",\"export\":[\"RawEvents\",\"RawEvents\"],\"disabledDataSources\":[\"TwinData\"],\"iotHubs\":[\"fqoixwgiksbbvt\",\"oxrpogw\",\"hchgjtnhtukf\",\"cihmbfntumeezbxv\"],\"userDefinedResources\":{\"query\":\"bnuvwcg\",\"querySubscriptions\":[]},\"autoDiscoveredResources\":[\"omtmjzwxuqgov\",\"xpwwzt\"],\"recommendationsConfiguration\":[],\"unmaskedIpLoggingStatus\":\"Enabled\",\"additionalWorkspaces\":[]},\"tags\":{\"grllcc\":\"edmls\",\"zhpabac\":\"aovjow\",\"wsxnsrqor\":\"mlyotg\",\"eetqujxcxxq\":\"genmvceb\"},\"id\":\"dcqjkedwqurc\",\"name\":\"ojmrvvxwjongzse\",\"type\":\"qqrsil\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - IoTSecuritySolutionModel response = - manager - .iotSecuritySolutions() - .getByResourceGroupWithResponse("ezsdsuxheq", "gcruxspinym", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("gwokmikpazfbmjxu", response.location()); - Assertions.assertEquals("edmls", response.tags().get("grllcc")); - Assertions.assertEquals("pfdvhaxdv", response.workspace()); - Assertions.assertEquals("zaehpphthd", response.displayName()); - Assertions.assertEquals(SecuritySolutionStatus.DISABLED, response.status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, response.export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, response.disabledDataSources().get(0)); - Assertions.assertEquals("fqoixwgiksbbvt", response.iotHubs().get(0)); - Assertions.assertEquals("bnuvwcg", response.userDefinedResources().query()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.ENABLED, response.unmaskedIpLoggingStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsListByResourceGroupMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsListByResourceGroupMockTests.java deleted file mode 100644 index ad9b2a936743..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsListByResourceGroupMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"wtltngvmreuptrk\",\"properties\":{\"workspace\":\"ijajwolx\",\"displayName\":\"s\",\"status\":\"Enabled\",\"export\":[\"RawEvents\",\"RawEvents\",\"RawEvents\"],\"disabledDataSources\":[\"TwinData\",\"TwinData\",\"TwinData\"],\"iotHubs\":[\"igt\"],\"userDefinedResources\":{\"query\":\"cvbxqlapsnss\",\"querySubscriptions\":[]},\"autoDiscoveredResources\":[\"xpavid\",\"ievw\",\"fcvvy\"],\"recommendationsConfiguration\":[],\"unmaskedIpLoggingStatus\":\"Enabled\",\"additionalWorkspaces\":[]},\"tags\":{\"pazwug\":\"dsvalpnptwtrkx\",\"hldiuhzzgqlm\":\"yqvnjobfe\"},\"id\":\"aewzgiudjp\",\"name\":\"pqht\",\"type\":\"qhnmhk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.iotSecuritySolutions().listByResourceGroup("kfscjfncjwv", "ag", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wtltngvmreuptrk", response.iterator().next().location()); - Assertions.assertEquals("dsvalpnptwtrkx", response.iterator().next().tags().get("pazwug")); - Assertions.assertEquals("ijajwolx", response.iterator().next().workspace()); - Assertions.assertEquals("s", response.iterator().next().displayName()); - Assertions.assertEquals(SecuritySolutionStatus.ENABLED, response.iterator().next().status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, response.iterator().next().export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, response.iterator().next().disabledDataSources().get(0)); - Assertions.assertEquals("igt", response.iterator().next().iotHubs().get(0)); - Assertions.assertEquals("cvbxqlapsnss", response.iterator().next().userDefinedResources().query()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.ENABLED, response.iterator().next().unmaskedIpLoggingStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsListMockTests.java deleted file mode 100644 index 53ac1a10cf82..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/IotSecuritySolutionsListMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.DataSource; -import com.azure.resourcemanager.security.models.ExportData; -import com.azure.resourcemanager.security.models.IoTSecuritySolutionModel; -import com.azure.resourcemanager.security.models.SecuritySolutionStatus; -import com.azure.resourcemanager.security.models.UnmaskedIpLoggingStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class IotSecuritySolutionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"utmdpvozg\",\"properties\":{\"workspace\":\"bknlzcl\",\"displayName\":\"tzeyowmndcovd\",\"status\":\"Enabled\",\"export\":[\"RawEvents\"],\"disabledDataSources\":[\"TwinData\"],\"iotHubs\":[\"mk\",\"fruwkud\",\"bcpftxudqyemebun\",\"ucmci\"],\"userDefinedResources\":{\"query\":\"nee\",\"querySubscriptions\":[]},\"autoDiscoveredResources\":[\"auwcg\",\"efnoh\",\"itranizerwguda\",\"mxubvfbngfcoce\"],\"recommendationsConfiguration\":[],\"unmaskedIpLoggingStatus\":\"Enabled\",\"additionalWorkspaces\":[]},\"tags\":{\"vhl\":\"ztraud\",\"tmojhvrztnvgyshq\":\"dculregp\",\"zlpykcfazzwjcay\":\"dgrtwmew\"},\"id\":\"rzrr\",\"name\":\"nsyby\",\"type\":\"polwzrghsrlei\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.iotSecuritySolutions().list("q", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("utmdpvozg", response.iterator().next().location()); - Assertions.assertEquals("ztraud", response.iterator().next().tags().get("vhl")); - Assertions.assertEquals("bknlzcl", response.iterator().next().workspace()); - Assertions.assertEquals("tzeyowmndcovd", response.iterator().next().displayName()); - Assertions.assertEquals(SecuritySolutionStatus.ENABLED, response.iterator().next().status()); - Assertions.assertEquals(ExportData.RAW_EVENTS, response.iterator().next().export().get(0)); - Assertions.assertEquals(DataSource.TWIN_DATA, response.iterator().next().disabledDataSources().get(0)); - Assertions.assertEquals("mk", response.iterator().next().iotHubs().get(0)); - Assertions.assertEquals("nee", response.iterator().next().userDefinedResources().query()); - Assertions.assertEquals(UnmaskedIpLoggingStatus.ENABLED, response.iterator().next().unmaskedIpLoggingStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index be841f97dd2c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"npv\"},\"kind\":\"szrbwtdrcwg\",\"location\":\"ll\",\"id\":\"zlhhfix\",\"name\":\"cfculzj\",\"type\":\"mhpfywvy\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - JitNetworkAccessPolicy response = - manager - .jitNetworkAccessPolicies() - .define("hkfktlt") - .withExistingLocation("qhfnkvycqqqds", "ipnquwzxhrptyod") - .withVirtualMachines(Arrays.asList()) - .withKind("saluzyi") - .withRequests(Arrays.asList()) - .create(); - - Assertions.assertEquals("szrbwtdrcwg", response.kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteWithResponseMockTests.java deleted file mode 100644 index cd540e24437b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .jitNetworkAccessPolicies() - .deleteWithResponse("jsumxpezcoio", "jrmfqzwqd", "xkeedcnwmy", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetWithResponseMockTests.java deleted file mode 100644 index 0516669d3765..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"qbriq\"},\"kind\":\"wwtrjm\",\"location\":\"kvyhzokpoyu\",\"id\":\"h\",\"name\":\"ensnaa\",\"type\":\"phmpoejnglpwsada\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - JitNetworkAccessPolicy response = - manager - .jitNetworkAccessPolicies() - .getWithResponse("ooxrqwoeurb", "igapdy", "rikeejdpdfht", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("wwtrjm", response.kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateWithResponseMockTests.java deleted file mode 100644 index 5cebd93ca782..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesInitiateWithResponseMockTests.java +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateVirtualMachine; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequest; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesInitiateWithResponseMockTests { - @Test - public void testInitiateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"virtualMachines\":[{\"id\":\"xyrujmt\",\"ports\":[]}],\"startTimeUtc\":\"2021-06-08T04:38:24Z\",\"requestor\":\"s\",\"justification\":\"kyohzix\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(202); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - JitNetworkAccessRequest response = - manager - .jitNetworkAccessPolicies() - .initiateWithResponse( - "xfqzkvemyzd", - "czaqpqifdbmpt", - "wtxzuisam", - new JitNetworkAccessPolicyInitiateRequest() - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId("at") - .withPorts(Arrays.asList()), - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId("zexroqsqjgh") - .withPorts(Arrays.asList()), - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId("thsplwsttxsr") - .withPorts(Arrays.asList()), - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId("fq") - .withPorts(Arrays.asList()))) - .withJustification("iceovxgzw"), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("xyrujmt", response.virtualMachines().get(0).id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-08T04:38:24Z"), response.startTimeUtc()); - Assertions.assertEquals("s", response.requestor()); - Assertions.assertEquals("kyohzix", response.justification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionMockTests.java deleted file mode 100644 index b1e5ff351f1c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByRegionMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesListByRegionMockTests { - @Test - public void testListByRegion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"kzidgzwdyd\"},\"kind\":\"isvpztdivykpxkqe\",\"location\":\"pjfojiunrls\",\"id\":\"xuknsykdtoi\",\"name\":\"oancdrco\",\"type\":\"nvxuldxonckb\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.jitNetworkAccessPolicies().listByRegion("nzvajbvbnkrdem", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("isvpztdivykpxkqe", response.iterator().next().kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionMockTests.java deleted file mode 100644 index d21c22cac68c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupAndRegionMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesListByResourceGroupAndRegionMockTests { - @Test - public void testListByResourceGroupAndRegion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"o\"},\"kind\":\"dvrgptqmawzjdrp\",\"location\":\"fu\",\"id\":\"gyc\",\"name\":\"sd\",\"type\":\"tqgkujd\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .jitNetworkAccessPolicies() - .listByResourceGroupAndRegion("pimyndnoxax", "rqaqotn", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("dvrgptqmawzjdrp", response.iterator().next().kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupMockTests.java deleted file mode 100644 index ee8b1eaec2a0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListByResourceGroupMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"ghlww\"},\"kind\":\"gvgfklqiyndveqe\",\"location\":\"b\",\"id\":\"vd\",\"name\":\"trkzxsgtznsvlrds\",\"type\":\"o\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .jitNetworkAccessPolicies() - .listByResourceGroup("lblfxlupibaqzizx", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("gvgfklqiyndveqe", response.iterator().next().kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListMockTests.java deleted file mode 100644 index e2e93c7bb422..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicy; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class JitNetworkAccessPoliciesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"sgqk\"},\"kind\":\"yecup\",\"location\":\"ijpardavsjcf\",\"id\":\"azpzdqwuz\",\"name\":\"cmcokxizekuv\",\"type\":\"rjwuca\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.jitNetworkAccessPolicies().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("yecup", response.iterator().next().kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListTests.java deleted file mode 100644 index a18c27241fc2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPoliciesListTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPoliciesList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPoliciesListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPoliciesList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"bzefezr\"},\"kind\":\"czurtlei\",\"location\":\"xbkwv\",\"id\":\"gnzvdfbzdixzm\",\"name\":\"pnodawopqhe\",\"type\":\"jptmcgsbost\"},{\"properties\":{\"virtualMachines\":[],\"requests\":[],\"provisioningState\":\"ndlatutmzlbi\"},\"kind\":\"lvfhrbbp\",\"location\":\"qvcww\",\"id\":\"yurmochpprprs\",\"name\":\"mo\",\"type\":\"ayzejnhlbkpbz\"}],\"nextLink\":\"piljhahzvech\"}") - .toObject(JitNetworkAccessPoliciesList.class); - Assertions.assertEquals("czurtlei", model.value().get(0).kind()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPoliciesList model = - new JitNetworkAccessPoliciesList() - .withValue( - Arrays - .asList( - new JitNetworkAccessPolicyInner() - .withKind("czurtlei") - .withVirtualMachines(Arrays.asList()) - .withRequests(Arrays.asList()), - new JitNetworkAccessPolicyInner() - .withKind("lvfhrbbp") - .withVirtualMachines(Arrays.asList()) - .withRequests(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPoliciesList.class); - Assertions.assertEquals("czurtlei", model.value().get(0).kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiatePortTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiatePortTests.java deleted file mode 100644 index 583a5d020cf6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiatePortTests.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiatePort; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPolicyInitiatePortTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPolicyInitiatePort model = - BinaryData - .fromString( - "{\"number\":30912450,\"allowedSourceAddressPrefix\":\"wwp\",\"endTimeUtc\":\"2021-06-18T17:27:40Z\"}") - .toObject(JitNetworkAccessPolicyInitiatePort.class); - Assertions.assertEquals(30912450, model.number()); - Assertions.assertEquals("wwp", model.allowedSourceAddressPrefix()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T17:27:40Z"), model.endTimeUtc()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPolicyInitiatePort model = - new JitNetworkAccessPolicyInitiatePort() - .withNumber(30912450) - .withAllowedSourceAddressPrefix("wwp") - .withEndTimeUtc(OffsetDateTime.parse("2021-06-18T17:27:40Z")); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPolicyInitiatePort.class); - Assertions.assertEquals(30912450, model.number()); - Assertions.assertEquals("wwp", model.allowedSourceAddressPrefix()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-18T17:27:40Z"), model.endTimeUtc()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiateRequestTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiateRequestTests.java deleted file mode 100644 index 03b9fcd341ae..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiateRequestTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateRequest; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateVirtualMachine; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPolicyInitiateRequestTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPolicyInitiateRequest model = - BinaryData - .fromString( - "{\"virtualMachines\":[{\"id\":\"trsqqw\",\"ports\":[]}],\"justification\":\"mwqkchcxwaxf\"}") - .toObject(JitNetworkAccessPolicyInitiateRequest.class); - Assertions.assertEquals("trsqqw", model.virtualMachines().get(0).id()); - Assertions.assertEquals("mwqkchcxwaxf", model.justification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPolicyInitiateRequest model = - new JitNetworkAccessPolicyInitiateRequest() - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId("trsqqw") - .withPorts(Arrays.asList()))) - .withJustification("mwqkchcxwaxf"); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPolicyInitiateRequest.class); - Assertions.assertEquals("trsqqw", model.virtualMachines().get(0).id()); - Assertions.assertEquals("mwqkchcxwaxf", model.justification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiateVirtualMachineTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiateVirtualMachineTests.java deleted file mode 100644 index 23d745f14acd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInitiateVirtualMachineTests.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiatePort; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyInitiateVirtualMachine; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPolicyInitiateVirtualMachineTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPolicyInitiateVirtualMachine model = - BinaryData - .fromString( - "{\"id\":\"w\",\"ports\":[{\"number\":636641870,\"allowedSourceAddressPrefix\":\"exfdeqvhpsylk\",\"endTimeUtc\":\"2021-04-17T08:49:18Z\"},{\"number\":2021763833,\"allowedSourceAddressPrefix\":\"bffmbmxz\",\"endTimeUtc\":\"2021-06-13T14:19:09Z\"}]}") - .toObject(JitNetworkAccessPolicyInitiateVirtualMachine.class); - Assertions.assertEquals("w", model.id()); - Assertions.assertEquals(636641870, model.ports().get(0).number()); - Assertions.assertEquals("exfdeqvhpsylk", model.ports().get(0).allowedSourceAddressPrefix()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T08:49:18Z"), model.ports().get(0).endTimeUtc()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPolicyInitiateVirtualMachine model = - new JitNetworkAccessPolicyInitiateVirtualMachine() - .withId("w") - .withPorts( - Arrays - .asList( - new JitNetworkAccessPolicyInitiatePort() - .withNumber(636641870) - .withAllowedSourceAddressPrefix("exfdeqvhpsylk") - .withEndTimeUtc(OffsetDateTime.parse("2021-04-17T08:49:18Z")), - new JitNetworkAccessPolicyInitiatePort() - .withNumber(2021763833) - .withAllowedSourceAddressPrefix("bffmbmxz") - .withEndTimeUtc(OffsetDateTime.parse("2021-06-13T14:19:09Z")))); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPolicyInitiateVirtualMachine.class); - Assertions.assertEquals("w", model.id()); - Assertions.assertEquals(636641870, model.ports().get(0).number()); - Assertions.assertEquals("exfdeqvhpsylk", model.ports().get(0).allowedSourceAddressPrefix()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-17T08:49:18Z"), model.ports().get(0).endTimeUtc()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInnerTests.java deleted file mode 100644 index 758a18f86b8e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyInnerTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyInner; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPolicyInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPolicyInner model = - BinaryData - .fromString( - "{\"properties\":{\"virtualMachines\":[{\"id\":\"bnwieholew\",\"ports\":[],\"publicIpAddress\":\"iuubwefqsf\"}],\"requests\":[{\"virtualMachines\":[],\"startTimeUtc\":\"2021-06-03T00:57:38Z\",\"requestor\":\"tf\",\"justification\":\"rqwexjkmfxapjwog\"},{\"virtualMachines\":[],\"startTimeUtc\":\"2021-01-30T20:27:58Z\",\"requestor\":\"nobpudcdabtqwpw\",\"justification\":\"wbzasqbuclj\"}],\"provisioningState\":\"yexaoguy\"},\"kind\":\"p\",\"location\":\"sdaultxij\",\"id\":\"um\",\"name\":\"qwazlnqnmcjngzq\",\"type\":\"qxtbjwgnyf\"}") - .toObject(JitNetworkAccessPolicyInner.class); - Assertions.assertEquals("p", model.kind()); - Assertions.assertEquals("bnwieholew", model.virtualMachines().get(0).id()); - Assertions.assertEquals("iuubwefqsf", model.virtualMachines().get(0).publicIpAddress()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-03T00:57:38Z"), model.requests().get(0).startTimeUtc()); - Assertions.assertEquals("tf", model.requests().get(0).requestor()); - Assertions.assertEquals("rqwexjkmfxapjwog", model.requests().get(0).justification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPolicyInner model = - new JitNetworkAccessPolicyInner() - .withKind("p") - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessPolicyVirtualMachine() - .withId("bnwieholew") - .withPorts(Arrays.asList()) - .withPublicIpAddress("iuubwefqsf"))) - .withRequests( - Arrays - .asList( - new JitNetworkAccessRequestInner() - .withVirtualMachines(Arrays.asList()) - .withStartTimeUtc(OffsetDateTime.parse("2021-06-03T00:57:38Z")) - .withRequestor("tf") - .withJustification("rqwexjkmfxapjwog"), - new JitNetworkAccessRequestInner() - .withVirtualMachines(Arrays.asList()) - .withStartTimeUtc(OffsetDateTime.parse("2021-01-30T20:27:58Z")) - .withRequestor("nobpudcdabtqwpw") - .withJustification("wbzasqbuclj"))); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPolicyInner.class); - Assertions.assertEquals("p", model.kind()); - Assertions.assertEquals("bnwieholew", model.virtualMachines().get(0).id()); - Assertions.assertEquals("iuubwefqsf", model.virtualMachines().get(0).publicIpAddress()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-03T00:57:38Z"), model.requests().get(0).startTimeUtc()); - Assertions.assertEquals("tf", model.requests().get(0).requestor()); - Assertions.assertEquals("rqwexjkmfxapjwog", model.requests().get(0).justification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyPropertiesTests.java deleted file mode 100644 index 1a3836f3e5c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyPropertiesTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessPolicyProperties; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPolicyPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPolicyProperties model = - BinaryData - .fromString( - "{\"virtualMachines\":[{\"id\":\"fzsvtuikzh\",\"ports\":[],\"publicIpAddress\":\"glcfhmlrqryxyn\"}],\"requests\":[{\"virtualMachines\":[],\"startTimeUtc\":\"2021-01-25T20:50:55Z\",\"requestor\":\"p\",\"justification\":\"vwxzn\"},{\"virtualMachines\":[],\"startTimeUtc\":\"2021-11-01T02:58:07Z\",\"requestor\":\"oeiy\",\"justification\":\"abpfhvfs\"},{\"virtualMachines\":[],\"startTimeUtc\":\"2021-03-03T19:37:28Z\",\"requestor\":\"ntjlr\",\"justification\":\"jkskyr\"},{\"virtualMachines\":[],\"startTimeUtc\":\"2021-02-22T17:46:16Z\",\"requestor\":\"vzidsxwaab\",\"justification\":\"ifrygzn\"}],\"provisioningState\":\"axri\"}") - .toObject(JitNetworkAccessPolicyProperties.class); - Assertions.assertEquals("fzsvtuikzh", model.virtualMachines().get(0).id()); - Assertions.assertEquals("glcfhmlrqryxyn", model.virtualMachines().get(0).publicIpAddress()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-25T20:50:55Z"), model.requests().get(0).startTimeUtc()); - Assertions.assertEquals("p", model.requests().get(0).requestor()); - Assertions.assertEquals("vwxzn", model.requests().get(0).justification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPolicyProperties model = - new JitNetworkAccessPolicyProperties() - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessPolicyVirtualMachine() - .withId("fzsvtuikzh") - .withPorts(Arrays.asList()) - .withPublicIpAddress("glcfhmlrqryxyn"))) - .withRequests( - Arrays - .asList( - new JitNetworkAccessRequestInner() - .withVirtualMachines(Arrays.asList()) - .withStartTimeUtc(OffsetDateTime.parse("2021-01-25T20:50:55Z")) - .withRequestor("p") - .withJustification("vwxzn"), - new JitNetworkAccessRequestInner() - .withVirtualMachines(Arrays.asList()) - .withStartTimeUtc(OffsetDateTime.parse("2021-11-01T02:58:07Z")) - .withRequestor("oeiy") - .withJustification("abpfhvfs"), - new JitNetworkAccessRequestInner() - .withVirtualMachines(Arrays.asList()) - .withStartTimeUtc(OffsetDateTime.parse("2021-03-03T19:37:28Z")) - .withRequestor("ntjlr") - .withJustification("jkskyr"), - new JitNetworkAccessRequestInner() - .withVirtualMachines(Arrays.asList()) - .withStartTimeUtc(OffsetDateTime.parse("2021-02-22T17:46:16Z")) - .withRequestor("vzidsxwaab") - .withJustification("ifrygzn"))); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPolicyProperties.class); - Assertions.assertEquals("fzsvtuikzh", model.virtualMachines().get(0).id()); - Assertions.assertEquals("glcfhmlrqryxyn", model.virtualMachines().get(0).publicIpAddress()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-25T20:50:55Z"), model.requests().get(0).startTimeUtc()); - Assertions.assertEquals("p", model.requests().get(0).requestor()); - Assertions.assertEquals("vwxzn", model.requests().get(0).justification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyVirtualMachineTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyVirtualMachineTests.java deleted file mode 100644 index ad224c7ace12..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPolicyVirtualMachineTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.JitNetworkAccessPolicyVirtualMachine; -import com.azure.resourcemanager.security.models.JitNetworkAccessPortRule; -import com.azure.resourcemanager.security.models.Protocol; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPolicyVirtualMachineTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPolicyVirtualMachine model = - BinaryData - .fromString( - "{\"id\":\"kzobgopxlhsln\",\"ports\":[{\"number\":1024527659,\"protocol\":\"*\",\"allowedSourceAddressPrefix\":\"ixynllxecwcrojp\",\"allowedSourceAddressPrefixes\":[\"hcawjutifdwfmv\"],\"maxRequestAccessDuration\":\"gorqjbttzh\"},{\"number\":65250234,\"protocol\":\"*\",\"allowedSourceAddressPrefix\":\"kafhonqj\",\"allowedSourceAddressPrefixes\":[\"ickpz\",\"cpopmxel\"],\"maxRequestAccessDuration\":\"wcltyjede\"},{\"number\":427218214,\"protocol\":\"*\",\"allowedSourceAddressPrefix\":\"f\",\"allowedSourceAddressPrefixes\":[\"scazuawxtzxpu\",\"mwabzxrvxc\",\"s\"],\"maxRequestAccessDuration\":\"sphaivmxyasflvg\"},{\"number\":1752644697,\"protocol\":\"*\",\"allowedSourceAddressPrefix\":\"ywakoihk\",\"allowedSourceAddressPrefixes\":[\"jblmljhlnymz\",\"tqyryuzcbmqqv\",\"mv\"],\"maxRequestAccessDuration\":\"fgtayxonsup\"}],\"publicIpAddress\":\"jlzqnhc\"}") - .toObject(JitNetworkAccessPolicyVirtualMachine.class); - Assertions.assertEquals("kzobgopxlhsln", model.id()); - Assertions.assertEquals(1024527659, model.ports().get(0).number()); - Assertions.assertEquals(Protocol.ASTERISK, model.ports().get(0).protocol()); - Assertions.assertEquals("ixynllxecwcrojp", model.ports().get(0).allowedSourceAddressPrefix()); - Assertions.assertEquals("hcawjutifdwfmv", model.ports().get(0).allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals("gorqjbttzh", model.ports().get(0).maxRequestAccessDuration()); - Assertions.assertEquals("jlzqnhc", model.publicIpAddress()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPolicyVirtualMachine model = - new JitNetworkAccessPolicyVirtualMachine() - .withId("kzobgopxlhsln") - .withPorts( - Arrays - .asList( - new JitNetworkAccessPortRule() - .withNumber(1024527659) - .withProtocol(Protocol.ASTERISK) - .withAllowedSourceAddressPrefix("ixynllxecwcrojp") - .withAllowedSourceAddressPrefixes(Arrays.asList("hcawjutifdwfmv")) - .withMaxRequestAccessDuration("gorqjbttzh"), - new JitNetworkAccessPortRule() - .withNumber(65250234) - .withProtocol(Protocol.ASTERISK) - .withAllowedSourceAddressPrefix("kafhonqj") - .withAllowedSourceAddressPrefixes(Arrays.asList("ickpz", "cpopmxel")) - .withMaxRequestAccessDuration("wcltyjede"), - new JitNetworkAccessPortRule() - .withNumber(427218214) - .withProtocol(Protocol.ASTERISK) - .withAllowedSourceAddressPrefix("f") - .withAllowedSourceAddressPrefixes(Arrays.asList("scazuawxtzxpu", "mwabzxrvxc", "s")) - .withMaxRequestAccessDuration("sphaivmxyasflvg"), - new JitNetworkAccessPortRule() - .withNumber(1752644697) - .withProtocol(Protocol.ASTERISK) - .withAllowedSourceAddressPrefix("ywakoihk") - .withAllowedSourceAddressPrefixes(Arrays.asList("jblmljhlnymz", "tqyryuzcbmqqv", "mv")) - .withMaxRequestAccessDuration("fgtayxonsup"))) - .withPublicIpAddress("jlzqnhc"); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPolicyVirtualMachine.class); - Assertions.assertEquals("kzobgopxlhsln", model.id()); - Assertions.assertEquals(1024527659, model.ports().get(0).number()); - Assertions.assertEquals(Protocol.ASTERISK, model.ports().get(0).protocol()); - Assertions.assertEquals("ixynllxecwcrojp", model.ports().get(0).allowedSourceAddressPrefix()); - Assertions.assertEquals("hcawjutifdwfmv", model.ports().get(0).allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals("gorqjbttzh", model.ports().get(0).maxRequestAccessDuration()); - Assertions.assertEquals("jlzqnhc", model.publicIpAddress()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPortRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPortRuleTests.java deleted file mode 100644 index 7aa5a94171a5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessPortRuleTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.JitNetworkAccessPortRule; -import com.azure.resourcemanager.security.models.Protocol; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessPortRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessPortRule model = - BinaryData - .fromString( - "{\"number\":1664438715,\"protocol\":\"UDP\",\"allowedSourceAddressPrefix\":\"tnzoibgsxgnxfy\",\"allowedSourceAddressPrefixes\":[\"mpqoxw\",\"o\",\"dbxiqx\"],\"maxRequestAccessDuration\":\"iiqbi\"}") - .toObject(JitNetworkAccessPortRule.class); - Assertions.assertEquals(1664438715, model.number()); - Assertions.assertEquals(Protocol.UDP, model.protocol()); - Assertions.assertEquals("tnzoibgsxgnxfy", model.allowedSourceAddressPrefix()); - Assertions.assertEquals("mpqoxw", model.allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals("iiqbi", model.maxRequestAccessDuration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessPortRule model = - new JitNetworkAccessPortRule() - .withNumber(1664438715) - .withProtocol(Protocol.UDP) - .withAllowedSourceAddressPrefix("tnzoibgsxgnxfy") - .withAllowedSourceAddressPrefixes(Arrays.asList("mpqoxw", "o", "dbxiqx")) - .withMaxRequestAccessDuration("iiqbi"); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessPortRule.class); - Assertions.assertEquals(1664438715, model.number()); - Assertions.assertEquals(Protocol.UDP, model.protocol()); - Assertions.assertEquals("tnzoibgsxgnxfy", model.allowedSourceAddressPrefix()); - Assertions.assertEquals("mpqoxw", model.allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals("iiqbi", model.maxRequestAccessDuration()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestInnerTests.java deleted file mode 100644 index 971f33535ba9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestInnerTests.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.JitNetworkAccessRequestInner; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestVirtualMachine; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessRequestInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessRequestInner model = - BinaryData - .fromString( - "{\"virtualMachines\":[{\"id\":\"tmwwi\",\"ports\":[]},{\"id\":\"ehfqpofvwbc\",\"ports\":[]}],\"startTimeUtc\":\"2021-02-06T20:45:07Z\",\"requestor\":\"mbnkb\",\"justification\":\"qvxkd\"}") - .toObject(JitNetworkAccessRequestInner.class); - Assertions.assertEquals("tmwwi", model.virtualMachines().get(0).id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T20:45:07Z"), model.startTimeUtc()); - Assertions.assertEquals("mbnkb", model.requestor()); - Assertions.assertEquals("qvxkd", model.justification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessRequestInner model = - new JitNetworkAccessRequestInner() - .withVirtualMachines( - Arrays - .asList( - new JitNetworkAccessRequestVirtualMachine().withId("tmwwi").withPorts(Arrays.asList()), - new JitNetworkAccessRequestVirtualMachine() - .withId("ehfqpofvwbc") - .withPorts(Arrays.asList()))) - .withStartTimeUtc(OffsetDateTime.parse("2021-02-06T20:45:07Z")) - .withRequestor("mbnkb") - .withJustification("qvxkd"); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessRequestInner.class); - Assertions.assertEquals("tmwwi", model.virtualMachines().get(0).id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T20:45:07Z"), model.startTimeUtc()); - Assertions.assertEquals("mbnkb", model.requestor()); - Assertions.assertEquals("qvxkd", model.justification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestPortTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestPortTests.java deleted file mode 100644 index 3d5fb39d2d5d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestPortTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestPort; -import com.azure.resourcemanager.security.models.Status; -import com.azure.resourcemanager.security.models.StatusReason; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessRequestPortTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessRequestPort model = - BinaryData - .fromString( - "{\"number\":839780472,\"allowedSourceAddressPrefix\":\"hzfylsgcrpfbc\",\"allowedSourceAddressPrefixes\":[\"zzcezelfwyfwlw\",\"jwetnpsihcla\"],\"endTimeUtc\":\"2021-03-16T15:49:25Z\",\"status\":\"Revoked\",\"statusReason\":\"UserRequested\",\"mappedPort\":743676437}") - .toObject(JitNetworkAccessRequestPort.class); - Assertions.assertEquals(839780472, model.number()); - Assertions.assertEquals("hzfylsgcrpfbc", model.allowedSourceAddressPrefix()); - Assertions.assertEquals("zzcezelfwyfwlw", model.allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-16T15:49:25Z"), model.endTimeUtc()); - Assertions.assertEquals(Status.REVOKED, model.status()); - Assertions.assertEquals(StatusReason.USER_REQUESTED, model.statusReason()); - Assertions.assertEquals(743676437, model.mappedPort()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessRequestPort model = - new JitNetworkAccessRequestPort() - .withNumber(839780472) - .withAllowedSourceAddressPrefix("hzfylsgcrpfbc") - .withAllowedSourceAddressPrefixes(Arrays.asList("zzcezelfwyfwlw", "jwetnpsihcla")) - .withEndTimeUtc(OffsetDateTime.parse("2021-03-16T15:49:25Z")) - .withStatus(Status.REVOKED) - .withStatusReason(StatusReason.USER_REQUESTED) - .withMappedPort(743676437); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessRequestPort.class); - Assertions.assertEquals(839780472, model.number()); - Assertions.assertEquals("hzfylsgcrpfbc", model.allowedSourceAddressPrefix()); - Assertions.assertEquals("zzcezelfwyfwlw", model.allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-16T15:49:25Z"), model.endTimeUtc()); - Assertions.assertEquals(Status.REVOKED, model.status()); - Assertions.assertEquals(StatusReason.USER_REQUESTED, model.statusReason()); - Assertions.assertEquals(743676437, model.mappedPort()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestVirtualMachineTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestVirtualMachineTests.java deleted file mode 100644 index 6c4b4cc81a9c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/JitNetworkAccessRequestVirtualMachineTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestPort; -import com.azure.resourcemanager.security.models.JitNetworkAccessRequestVirtualMachine; -import com.azure.resourcemanager.security.models.Status; -import com.azure.resourcemanager.security.models.StatusReason; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class JitNetworkAccessRequestVirtualMachineTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - JitNetworkAccessRequestVirtualMachine model = - BinaryData - .fromString( - "{\"id\":\"vqihebwtswbzuwf\",\"ports\":[{\"number\":1479921462,\"allowedSourceAddressPrefix\":\"agegiz\",\"allowedSourceAddressPrefixes\":[\"felisdjub\",\"gbqi\",\"kxkbsazgakgacyr\",\"m\"],\"endTimeUtc\":\"2021-07-17T04:39:31Z\",\"status\":\"Initiated\",\"statusReason\":\"Expired\",\"mappedPort\":374782594},{\"number\":1831739785,\"allowedSourceAddressPrefix\":\"pv\",\"allowedSourceAddressPrefixes\":[\"ylnio\",\"rz\",\"bzjedmstk\"],\"endTimeUtc\":\"2021-11-19T17:56:37Z\",\"status\":\"Revoked\",\"statusReason\":\"Expired\",\"mappedPort\":1553181859},{\"number\":114492978,\"allowedSourceAddressPrefix\":\"iiznktwfan\",\"allowedSourceAddressPrefixes\":[\"pdibmikostbzbki\"],\"endTimeUtc\":\"2021-11-09T06:15:16Z\",\"status\":\"Revoked\",\"statusReason\":\"NewerRequestInitiated\",\"mappedPort\":1276364779}]}") - .toObject(JitNetworkAccessRequestVirtualMachine.class); - Assertions.assertEquals("vqihebwtswbzuwf", model.id()); - Assertions.assertEquals(1479921462, model.ports().get(0).number()); - Assertions.assertEquals("agegiz", model.ports().get(0).allowedSourceAddressPrefix()); - Assertions.assertEquals("felisdjub", model.ports().get(0).allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-17T04:39:31Z"), model.ports().get(0).endTimeUtc()); - Assertions.assertEquals(Status.INITIATED, model.ports().get(0).status()); - Assertions.assertEquals(StatusReason.EXPIRED, model.ports().get(0).statusReason()); - Assertions.assertEquals(374782594, model.ports().get(0).mappedPort()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - JitNetworkAccessRequestVirtualMachine model = - new JitNetworkAccessRequestVirtualMachine() - .withId("vqihebwtswbzuwf") - .withPorts( - Arrays - .asList( - new JitNetworkAccessRequestPort() - .withNumber(1479921462) - .withAllowedSourceAddressPrefix("agegiz") - .withAllowedSourceAddressPrefixes( - Arrays.asList("felisdjub", "gbqi", "kxkbsazgakgacyr", "m")) - .withEndTimeUtc(OffsetDateTime.parse("2021-07-17T04:39:31Z")) - .withStatus(Status.INITIATED) - .withStatusReason(StatusReason.EXPIRED) - .withMappedPort(374782594), - new JitNetworkAccessRequestPort() - .withNumber(1831739785) - .withAllowedSourceAddressPrefix("pv") - .withAllowedSourceAddressPrefixes(Arrays.asList("ylnio", "rz", "bzjedmstk")) - .withEndTimeUtc(OffsetDateTime.parse("2021-11-19T17:56:37Z")) - .withStatus(Status.REVOKED) - .withStatusReason(StatusReason.EXPIRED) - .withMappedPort(1553181859), - new JitNetworkAccessRequestPort() - .withNumber(114492978) - .withAllowedSourceAddressPrefix("iiznktwfan") - .withAllowedSourceAddressPrefixes(Arrays.asList("pdibmikostbzbki")) - .withEndTimeUtc(OffsetDateTime.parse("2021-11-09T06:15:16Z")) - .withStatus(Status.REVOKED) - .withStatusReason(StatusReason.NEWER_REQUEST_INITIATED) - .withMappedPort(1276364779))); - model = BinaryData.fromObject(model).toObject(JitNetworkAccessRequestVirtualMachine.class); - Assertions.assertEquals("vqihebwtswbzuwf", model.id()); - Assertions.assertEquals(1479921462, model.ports().get(0).number()); - Assertions.assertEquals("agegiz", model.ports().get(0).allowedSourceAddressPrefix()); - Assertions.assertEquals("felisdjub", model.ports().get(0).allowedSourceAddressPrefixes().get(0)); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-17T04:39:31Z"), model.ports().get(0).endTimeUtc()); - Assertions.assertEquals(Status.INITIATED, model.ports().get(0).status()); - Assertions.assertEquals(StatusReason.EXPIRED, model.ports().get(0).statusReason()); - Assertions.assertEquals(374782594, model.ports().get(0).mappedPort()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/KindAutoGeneratedTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/KindAutoGeneratedTests.java deleted file mode 100644 index 81395b2e1c72..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/KindAutoGeneratedTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.KindAutoGenerated; -import org.junit.jupiter.api.Assertions; - -public final class KindAutoGeneratedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - KindAutoGenerated model = BinaryData.fromString("{\"kind\":\"mczuo\"}").toObject(KindAutoGenerated.class); - Assertions.assertEquals("mczuo", model.kind()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - KindAutoGenerated model = new KindAutoGenerated().withKind("mczuo"); - model = BinaryData.fromObject(model).toObject(KindAutoGenerated.class); - Assertions.assertEquals("mczuo", model.kind()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ListCustomAlertRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ListCustomAlertRuleTests.java deleted file mode 100644 index fd9e2819e974..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ListCustomAlertRuleTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ListCustomAlertRule; -import org.junit.jupiter.api.Assertions; - -public final class ListCustomAlertRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListCustomAlertRule model = - BinaryData - .fromString( - "{\"ruleType\":\"ListCustomAlertRule\",\"valueType\":\"String\",\"displayName\":\"xnj\",\"description\":\"seiphe\",\"isEnabled\":false}") - .toObject(ListCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListCustomAlertRule model = new ListCustomAlertRule().withIsEnabled(false); - model = BinaryData.fromObject(model).toObject(ListCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocalUserNotAllowedTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocalUserNotAllowedTests.java deleted file mode 100644 index 6c7ac78cdcce..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocalUserNotAllowedTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.LocalUserNotAllowed; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class LocalUserNotAllowedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LocalUserNotAllowed model = - BinaryData - .fromString( - "{\"ruleType\":\"LocalUserNotAllowed\",\"allowlistValues\":[\"rijwai\",\"fanraybfu\",\"qfrojsydgrhyd\",\"ygywe\"],\"valueType\":\"String\",\"displayName\":\"ec\",\"description\":\"ygzmxieqvdsmak\",\"isEnabled\":true}") - .toObject(LocalUserNotAllowed.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("rijwai", model.allowlistValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LocalUserNotAllowed model = - new LocalUserNotAllowed() - .withIsEnabled(true) - .withAllowlistValues(Arrays.asList("rijwai", "fanraybfu", "qfrojsydgrhyd", "ygywe")); - model = BinaryData.fromObject(model).toObject(LocalUserNotAllowed.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("rijwai", model.allowlistValues().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationTests.java deleted file mode 100644 index 3233ca4fc910..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Location; - -public final class LocationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Location model = BinaryData.fromString("{\"location\":\"zunbixx\"}").toObject(Location.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Location model = new Location(); - model = BinaryData.fromObject(model).toObject(Location.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationsGetWithResponseMockTests.java deleted file mode 100644 index 1d362fe8ce8a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationsGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AscLocation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class LocationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":\"datacqydey\",\"id\":\"vskiczd\",\"name\":\"rjeizik\",\"type\":\"qaboohxbms\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - AscLocation response = - manager.locations().getWithResponse("ighctxbxmo", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationsListMockTests.java deleted file mode 100644 index be83688b7c89..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LocationsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.AscLocation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class LocationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":\"dataifrhjulrsul\",\"id\":\"zpfl\",\"name\":\"snawmhhgzotfri\",\"type\":\"rgkoekvzwxxyx\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.locations().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LogAnalyticsIdentifierTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LogAnalyticsIdentifierTests.java deleted file mode 100644 index a806e1adb8a0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/LogAnalyticsIdentifierTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.LogAnalyticsIdentifier; - -public final class LogAnalyticsIdentifierTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LogAnalyticsIdentifier model = - BinaryData - .fromString( - "{\"type\":\"LogAnalytics\",\"workspaceId\":\"o\",\"workspaceSubscriptionId\":\"qocarkuzlbc\",\"workspaceResourceGroup\":\"dtsnxawqytllhdyz\",\"agentId\":\"ckze\"}") - .toObject(LogAnalyticsIdentifier.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LogAnalyticsIdentifier model = new LogAnalyticsIdentifier(); - model = BinaryData.fromObject(model).toObject(LogAnalyticsIdentifier.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataInnerTests.java deleted file mode 100644 index 9e9d55146699..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; - -public final class MdeOnboardingDataInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MdeOnboardingDataInner model = - BinaryData - .fromString( - "{\"properties\":{},\"id\":\"oqijgkdmbpaz\",\"name\":\"obcu\",\"type\":\"pdznrbtcqqjnqgl\"}") - .toObject(MdeOnboardingDataInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MdeOnboardingDataInner model = new MdeOnboardingDataInner(); - model = BinaryData.fromObject(model).toObject(MdeOnboardingDataInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataListInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataListInnerTests.java deleted file mode 100644 index c6b143d79fa0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataListInnerTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataInner; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataListInner; -import java.util.Arrays; - -public final class MdeOnboardingDataListInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MdeOnboardingDataListInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{},\"id\":\"vgjxpybczm\",\"name\":\"hmtzopbsphrup\",\"type\":\"dgs\"},{\"properties\":{},\"id\":\"jhphoyc\",\"name\":\"sx\",\"type\":\"obhdxbmtqioqjze\"},{\"properties\":{},\"id\":\"ufpo\",\"name\":\"noi\",\"type\":\"hwlrx\"}]}") - .toObject(MdeOnboardingDataListInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MdeOnboardingDataListInner model = - new MdeOnboardingDataListInner() - .withValue( - Arrays - .asList( - new MdeOnboardingDataInner(), new MdeOnboardingDataInner(), new MdeOnboardingDataInner())); - model = BinaryData.fromObject(model).toObject(MdeOnboardingDataListInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataPropertiesTests.java deleted file mode 100644 index 89dc9b92f31b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingDataPropertiesTests.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.MdeOnboardingDataProperties; - -public final class MdeOnboardingDataPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MdeOnboardingDataProperties model = BinaryData.fromString("{}").toObject(MdeOnboardingDataProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MdeOnboardingDataProperties model = new MdeOnboardingDataProperties(); - model = BinaryData.fromObject(model).toObject(MdeOnboardingDataProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetWithResponseMockTests.java deleted file mode 100644 index e87a85e07e0b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingsGetWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.MdeOnboardingData; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MdeOnboardingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"properties\":{},\"id\":\"twfhi\",\"name\":\"xwgsa\",\"type\":\"vcipo\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MdeOnboardingData response = - manager.mdeOnboardings().getWithResponse(com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListWithResponseMockTests.java deleted file mode 100644 index 95609d148e3d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MdeOnboardingsListWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.MdeOnboardingDataList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class MdeOnboardingsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"value\":[{\"id\":\"hlgmgbehl\",\"name\":\"txnr\",\"type\":\"lkndrndpgfjodh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - MdeOnboardingDataList response = - manager.mdeOnboardings().listWithResponse(com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttC2DMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttC2DMessagesNotInAllowedRangeTests.java deleted file mode 100644 index 9a5778e44899..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttC2DMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.MqttC2DMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class MqttC2DMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MqttC2DMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"MqttC2DMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT44H32M11S\",\"minThreshold\":2052753548,\"maxThreshold\":1662063978,\"displayName\":\"ds\",\"description\":\"snuyemlowuowhl\",\"isEnabled\":false}") - .toObject(MqttC2DMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(2052753548, model.minThreshold()); - Assertions.assertEquals(1662063978, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT44H32M11S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MqttC2DMessagesNotInAllowedRange model = - new MqttC2DMessagesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(2052753548) - .withMaxThreshold(1662063978) - .withTimeWindowSize(Duration.parse("PT44H32M11S")); - model = BinaryData.fromObject(model).toObject(MqttC2DMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(2052753548, model.minThreshold()); - Assertions.assertEquals(1662063978, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT44H32M11S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttC2DRejectedMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttC2DRejectedMessagesNotInAllowedRangeTests.java deleted file mode 100644 index 036867ab0f18..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttC2DRejectedMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.MqttC2DRejectedMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class MqttC2DRejectedMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MqttC2DRejectedMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"MqttC2DRejectedMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT88H6M23S\",\"minThreshold\":953823508,\"maxThreshold\":1995489309,\"displayName\":\"dxlwyojbfqz\",\"description\":\"fnjyix\",\"isEnabled\":false}") - .toObject(MqttC2DRejectedMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(953823508, model.minThreshold()); - Assertions.assertEquals(1995489309, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT88H6M23S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MqttC2DRejectedMessagesNotInAllowedRange model = - new MqttC2DRejectedMessagesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(953823508) - .withMaxThreshold(1995489309) - .withTimeWindowSize(Duration.parse("PT88H6M23S")); - model = BinaryData.fromObject(model).toObject(MqttC2DRejectedMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(953823508, model.minThreshold()); - Assertions.assertEquals(1995489309, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT88H6M23S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttD2CMessagesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttD2CMessagesNotInAllowedRangeTests.java deleted file mode 100644 index 211e6d4039f0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/MqttD2CMessagesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.MqttD2CMessagesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class MqttD2CMessagesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - MqttD2CMessagesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"MqttD2CMessagesNotInAllowedRange\",\"timeWindowSize\":\"PT217H45M3S\",\"minThreshold\":1518371143,\"maxThreshold\":1402835309,\"displayName\":\"gryfqiuasig\",\"description\":\"wsocnequygdjbo\",\"isEnabled\":false}") - .toObject(MqttD2CMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1518371143, model.minThreshold()); - Assertions.assertEquals(1402835309, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT217H45M3S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - MqttD2CMessagesNotInAllowedRange model = - new MqttD2CMessagesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(1518371143) - .withMaxThreshold(1402835309) - .withTimeWindowSize(Duration.parse("PT217H45M3S")); - model = BinaryData.fromObject(model).toObject(MqttD2CMessagesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1518371143, model.minThreshold()); - Assertions.assertEquals(1402835309, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT217H45M3S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnPremiseResourceDetailsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnPremiseResourceDetailsTests.java deleted file mode 100644 index d05839a18a3e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnPremiseResourceDetailsTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.OnPremiseResourceDetails; -import org.junit.jupiter.api.Assertions; - -public final class OnPremiseResourceDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OnPremiseResourceDetails model = - BinaryData - .fromString( - "{\"source\":\"OnPremise\",\"workspaceId\":\"ilaywkdcwm\",\"vmuuid\":\"syril\",\"sourceComputerId\":\"hxdqaol\",\"machineName\":\"ylnkkbjpjvlywltm\"}") - .toObject(OnPremiseResourceDetails.class); - Assertions.assertEquals("ilaywkdcwm", model.workspaceId()); - Assertions.assertEquals("syril", model.vmuuid()); - Assertions.assertEquals("hxdqaol", model.sourceComputerId()); - Assertions.assertEquals("ylnkkbjpjvlywltm", model.machineName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OnPremiseResourceDetails model = - new OnPremiseResourceDetails() - .withWorkspaceId("ilaywkdcwm") - .withVmuuid("syril") - .withSourceComputerId("hxdqaol") - .withMachineName("ylnkkbjpjvlywltm"); - model = BinaryData.fromObject(model).toObject(OnPremiseResourceDetails.class); - Assertions.assertEquals("ilaywkdcwm", model.workspaceId()); - Assertions.assertEquals("syril", model.vmuuid()); - Assertions.assertEquals("hxdqaol", model.sourceComputerId()); - Assertions.assertEquals("ylnkkbjpjvlywltm", model.machineName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnPremiseSqlResourceDetailsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnPremiseSqlResourceDetailsTests.java deleted file mode 100644 index e278f5b0f7ed..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OnPremiseSqlResourceDetailsTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.OnPremiseSqlResourceDetails; -import org.junit.jupiter.api.Assertions; - -public final class OnPremiseSqlResourceDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OnPremiseSqlResourceDetails model = - BinaryData - .fromString( - "{\"source\":\"OnPremiseSql\",\"serverName\":\"wob\",\"databaseName\":\"jw\",\"workspaceId\":\"lwyjfnqzocrdz\",\"vmuuid\":\"czeuntgx\",\"sourceComputerId\":\"ncaqttiekoifu\",\"machineName\":\"nyttzgix\"}") - .toObject(OnPremiseSqlResourceDetails.class); - Assertions.assertEquals("lwyjfnqzocrdz", model.workspaceId()); - Assertions.assertEquals("czeuntgx", model.vmuuid()); - Assertions.assertEquals("ncaqttiekoifu", model.sourceComputerId()); - Assertions.assertEquals("nyttzgix", model.machineName()); - Assertions.assertEquals("wob", model.serverName()); - Assertions.assertEquals("jw", model.databaseName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OnPremiseSqlResourceDetails model = - new OnPremiseSqlResourceDetails() - .withWorkspaceId("lwyjfnqzocrdz") - .withVmuuid("czeuntgx") - .withSourceComputerId("ncaqttiekoifu") - .withMachineName("nyttzgix") - .withServerName("wob") - .withDatabaseName("jw"); - model = BinaryData.fromObject(model).toObject(OnPremiseSqlResourceDetails.class); - Assertions.assertEquals("lwyjfnqzocrdz", model.workspaceId()); - Assertions.assertEquals("czeuntgx", model.vmuuid()); - Assertions.assertEquals("ncaqttiekoifu", model.sourceComputerId()); - Assertions.assertEquals("nyttzgix", model.machineName()); - Assertions.assertEquals("wob", model.serverName()); - Assertions.assertEquals("jw", model.databaseName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationDisplayTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationDisplayTests.java deleted file mode 100644 index 09d62012e821..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationDisplayTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = - BinaryData - .fromString( - "{\"provider\":\"kvpuvksgplsaknyn\",\"resource\":\"ynl\",\"operation\":\"huopxodlqiynto\",\"description\":\"ihleos\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationInnerTests.java deleted file mode 100644 index ed927f37bc49..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.OperationInner; -import com.azure.resourcemanager.security.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = - BinaryData - .fromString( - "{\"name\":\"e\",\"origin\":\"zar\",\"display\":{\"provider\":\"q\",\"resource\":\"ijfqkacewiipfp\",\"operation\":\"ji\",\"description\":\"wifto\"}}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationListTests.java deleted file mode 100644 index adcc5225ce3f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationListTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.OperationInner; -import com.azure.resourcemanager.security.models.OperationDisplay; -import com.azure.resourcemanager.security.models.OperationList; -import java.util.Arrays; - -public final class OperationListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationList model = - BinaryData - .fromString( - "{\"value\":[{\"name\":\"nwashrtd\",\"origin\":\"cnqxwbpokulpi\",\"display\":{\"provider\":\"aasipqi\",\"resource\":\"byuqerpqlp\",\"operation\":\"cciuqgbdbutau\",\"description\":\"btkuwhh\"}},{\"name\":\"ykojoxafnndlpic\",\"origin\":\"o\",\"display\":{\"provider\":\"cdyhbpkkpwdreqn\",\"resource\":\"vq\",\"operation\":\"vljxywsu\",\"description\":\"yrs\"}}],\"nextLink\":\"sytgadgvraea\"}") - .toObject(OperationList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationList model = - new OperationList() - .withValue( - Arrays - .asList( - new OperationInner().withDisplay(new OperationDisplay()), - new OperationInner().withDisplay(new OperationDisplay()))); - model = BinaryData.fromObject(model).toObject(OperationList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationResultAutoGeneratedInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationResultAutoGeneratedInnerTests.java deleted file mode 100644 index 674d96a98b2f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/OperationResultAutoGeneratedInnerTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.OperationResultAutoGeneratedInner; - -public final class OperationResultAutoGeneratedInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationResultAutoGeneratedInner model = - BinaryData.fromString("{\"status\":\"Succeeded\"}").toObject(OperationResultAutoGeneratedInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationResultAutoGeneratedInner model = new OperationResultAutoGeneratedInner(); - model = BinaryData.fromObject(model).toObject(OperationResultAutoGeneratedInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PathRecommendationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PathRecommendationTests.java deleted file mode 100644 index 93105f0342d2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PathRecommendationTests.java +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConfigurationStatus; -import com.azure.resourcemanager.security.models.FileType; -import com.azure.resourcemanager.security.models.PathRecommendation; -import com.azure.resourcemanager.security.models.PublisherInfo; -import com.azure.resourcemanager.security.models.RecommendationAction; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.UserRecommendation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PathRecommendationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PathRecommendation model = - BinaryData - .fromString( - "{\"path\":\"sgbpfgzdjtx\",\"action\":\"Remove\",\"type\":\"IoT_InstallAgent\",\"publisherInfo\":{\"publisherName\":\"gaqvlgafcqusrd\",\"productName\":\"t\",\"binaryName\":\"sdtutnwlduyc\",\"version\":\"zhyrmewipmve\"},\"common\":false,\"userSids\":[\"uqgsj\",\"xundxgk\",\"twzhhzjhfjmhv\",\"muvgp\"],\"usernames\":[{\"username\":\"qsxvmhf\",\"recommendationAction\":\"Remove\"},{\"username\":\"yihsasbhudypohyu\",\"recommendationAction\":\"Add\"}],\"fileType\":\"Script\",\"configurationStatus\":\"NoStatus\"}") - .toObject(PathRecommendation.class); - Assertions.assertEquals("sgbpfgzdjtx", model.path()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.action()); - Assertions.assertEquals(RecommendationType.IO_T_INSTALL_AGENT, model.type()); - Assertions.assertEquals("gaqvlgafcqusrd", model.publisherInfo().publisherName()); - Assertions.assertEquals("t", model.publisherInfo().productName()); - Assertions.assertEquals("sdtutnwlduyc", model.publisherInfo().binaryName()); - Assertions.assertEquals("zhyrmewipmve", model.publisherInfo().version()); - Assertions.assertEquals(false, model.common()); - Assertions.assertEquals("uqgsj", model.userSids().get(0)); - Assertions.assertEquals("qsxvmhf", model.usernames().get(0).username()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.usernames().get(0).recommendationAction()); - Assertions.assertEquals(FileType.SCRIPT, model.fileType()); - Assertions.assertEquals(ConfigurationStatus.NO_STATUS, model.configurationStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PathRecommendation model = - new PathRecommendation() - .withPath("sgbpfgzdjtx") - .withAction(RecommendationAction.REMOVE) - .withType(RecommendationType.IO_T_INSTALL_AGENT) - .withPublisherInfo( - new PublisherInfo() - .withPublisherName("gaqvlgafcqusrd") - .withProductName("t") - .withBinaryName("sdtutnwlduyc") - .withVersion("zhyrmewipmve")) - .withCommon(false) - .withUserSids(Arrays.asList("uqgsj", "xundxgk", "twzhhzjhfjmhv", "muvgp")) - .withUsernames( - Arrays - .asList( - new UserRecommendation() - .withUsername("qsxvmhf") - .withRecommendationAction(RecommendationAction.REMOVE), - new UserRecommendation() - .withUsername("yihsasbhudypohyu") - .withRecommendationAction(RecommendationAction.ADD))) - .withFileType(FileType.SCRIPT) - .withConfigurationStatus(ConfigurationStatus.NO_STATUS); - model = BinaryData.fromObject(model).toObject(PathRecommendation.class); - Assertions.assertEquals("sgbpfgzdjtx", model.path()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.action()); - Assertions.assertEquals(RecommendationType.IO_T_INSTALL_AGENT, model.type()); - Assertions.assertEquals("gaqvlgafcqusrd", model.publisherInfo().publisherName()); - Assertions.assertEquals("t", model.publisherInfo().productName()); - Assertions.assertEquals("sdtutnwlduyc", model.publisherInfo().binaryName()); - Assertions.assertEquals("zhyrmewipmve", model.publisherInfo().version()); - Assertions.assertEquals(false, model.common()); - Assertions.assertEquals("uqgsj", model.userSids().get(0)); - Assertions.assertEquals("qsxvmhf", model.usernames().get(0).username()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.usernames().get(0).recommendationAction()); - Assertions.assertEquals(FileType.SCRIPT, model.fileType()); - Assertions.assertEquals(ConfigurationStatus.NO_STATUS, model.configurationStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingInnerTests.java deleted file mode 100644 index c1116922488e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingInnerTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.models.Extension; -import com.azure.resourcemanager.security.models.IsEnabled; -import com.azure.resourcemanager.security.models.PricingTier; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class PricingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PricingInner model = - BinaryData - .fromString( - "{\"properties\":{\"pricingTier\":\"Standard\",\"subPlan\":\"dqytbciqfouflmm\",\"freeTrialRemainingTime\":\"PT108H50M46S\",\"enablementTime\":\"2021-02-23T09:34:26Z\",\"deprecated\":false,\"replacedBy\":[\"lougpbkw\",\"mutduqktaps\"],\"extensions\":[{\"name\":\"cuertu\",\"isEnabled\":\"True\",\"additionalExtensionProperties\":{}}]},\"id\":\"svqwhbmdgbbjfd\",\"name\":\"gmbmbexppbh\",\"type\":\"q\"}") - .toObject(PricingInner.class); - Assertions.assertEquals(PricingTier.STANDARD, model.pricingTier()); - Assertions.assertEquals("dqytbciqfouflmm", model.subPlan()); - Assertions.assertEquals("cuertu", model.extensions().get(0).name()); - Assertions.assertEquals(IsEnabled.TRUE, model.extensions().get(0).isEnabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PricingInner model = - new PricingInner() - .withPricingTier(PricingTier.STANDARD) - .withSubPlan("dqytbciqfouflmm") - .withExtensions( - Arrays - .asList( - new Extension() - .withName("cuertu") - .withIsEnabled(IsEnabled.TRUE) - .withAdditionalExtensionProperties(mapOf()))); - model = BinaryData.fromObject(model).toObject(PricingInner.class); - Assertions.assertEquals(PricingTier.STANDARD, model.pricingTier()); - Assertions.assertEquals("dqytbciqfouflmm", model.subPlan()); - Assertions.assertEquals("cuertu", model.extensions().get(0).name()); - Assertions.assertEquals(IsEnabled.TRUE, model.extensions().get(0).isEnabled()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingListInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingListInnerTests.java deleted file mode 100644 index 2397e29b4a9e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingListInnerTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.fluent.models.PricingListInner; -import com.azure.resourcemanager.security.models.PricingTier; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class PricingListInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PricingListInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"pricingTier\":\"Standard\",\"subPlan\":\"nqpjwnzlljfmpp\",\"freeTrialRemainingTime\":\"PT46H48M36S\",\"enablementTime\":\"2021-10-30T03:41:11Z\",\"deprecated\":true,\"replacedBy\":[],\"extensions\":[]},\"id\":\"bkyqduu\",\"name\":\"itcjczdz\",\"type\":\"vndhkrwpdapp\"},{\"properties\":{\"pricingTier\":\"Standard\",\"subPlan\":\"kvwrwjfeu\",\"freeTrialRemainingTime\":\"PT36H39M29S\",\"enablementTime\":\"2021-01-02T14:30:26Z\",\"deprecated\":true,\"replacedBy\":[],\"extensions\":[]},\"id\":\"mrldhu\",\"name\":\"jzzd\",\"type\":\"tqxhocdgeab\"},{\"properties\":{\"pricingTier\":\"Free\",\"subPlan\":\"uticndvkaozwyif\",\"freeTrialRemainingTime\":\"PT23H12M54S\",\"enablementTime\":\"2021-10-09T12:18:53Z\",\"deprecated\":false,\"replacedBy\":[],\"extensions\":[]},\"id\":\"ftyxolniw\",\"name\":\"wcukjfkgiawxk\",\"type\":\"ryplwckbasyypn\"},{\"properties\":{\"pricingTier\":\"Standard\",\"subPlan\":\"gcbacphejkot\",\"freeTrialRemainingTime\":\"PT157H5M51S\",\"enablementTime\":\"2021-02-05T05:14:14Z\",\"deprecated\":false,\"replacedBy\":[],\"extensions\":[]},\"id\":\"dlikwyqkgfgibma\",\"name\":\"gakeqsr\",\"type\":\"yb\"}]}") - .toObject(PricingListInner.class); - Assertions.assertEquals(PricingTier.STANDARD, model.value().get(0).pricingTier()); - Assertions.assertEquals("nqpjwnzlljfmpp", model.value().get(0).subPlan()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PricingListInner model = - new PricingListInner() - .withValue( - Arrays - .asList( - new PricingInner() - .withPricingTier(PricingTier.STANDARD) - .withSubPlan("nqpjwnzlljfmpp") - .withExtensions(Arrays.asList()), - new PricingInner() - .withPricingTier(PricingTier.STANDARD) - .withSubPlan("kvwrwjfeu") - .withExtensions(Arrays.asList()), - new PricingInner() - .withPricingTier(PricingTier.FREE) - .withSubPlan("uticndvkaozwyif") - .withExtensions(Arrays.asList()), - new PricingInner() - .withPricingTier(PricingTier.STANDARD) - .withSubPlan("gcbacphejkot") - .withExtensions(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(PricingListInner.class); - Assertions.assertEquals(PricingTier.STANDARD, model.value().get(0).pricingTier()); - Assertions.assertEquals("nqpjwnzlljfmpp", model.value().get(0).subPlan()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsGetWithResponseMockTests.java deleted file mode 100644 index d683a15b0034..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsGetWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Pricing; -import com.azure.resourcemanager.security.models.PricingTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PricingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"pricingTier\":\"Standard\",\"subPlan\":\"rxhjnltcet\",\"freeTrialRemainingTime\":\"PT64H42M27S\",\"enablementTime\":\"2021-02-07T05:21:42Z\",\"deprecated\":false,\"replacedBy\":[\"qkwaruwd\"],\"extensions\":[]},\"id\":\"zxoebwgjxb\",\"name\":\"banbaupwtzv\",\"type\":\"aklozk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Pricing response = manager.pricings().getWithResponse("glzrs", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(PricingTier.STANDARD, response.pricingTier()); - Assertions.assertEquals("rxhjnltcet", response.subPlan()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsListWithResponseMockTests.java deleted file mode 100644 index e2bbb9f74b2c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsListWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.PricingList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PricingsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"bafo\",\"name\":\"to\",\"type\":\"zhaquvwsxb\"},{\"id\":\"vkervqchoadhrsxq\",\"name\":\"z\",\"type\":\"spabdsrgfa\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PricingList response = manager.pricings().listWithResponse(com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsUpdateWithResponseMockTests.java deleted file mode 100644 index c7a2d86a2604..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PricingsUpdateWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.fluent.models.PricingInner; -import com.azure.resourcemanager.security.models.Pricing; -import com.azure.resourcemanager.security.models.PricingTier; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class PricingsUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"pricingTier\":\"Standard\",\"subPlan\":\"ojkpoyh\",\"freeTrialRemainingTime\":\"PT131H58M8S\",\"enablementTime\":\"2021-11-09T18:13:39Z\",\"deprecated\":true,\"replacedBy\":[\"dljzgdyrc\"],\"extensions\":[]},\"id\":\"bsgzl\",\"name\":\"qhbjnqogdxwbsfpy\",\"type\":\"x\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Pricing response = - manager - .pricings() - .updateWithResponse( - "bzrpejp", - new PricingInner() - .withPricingTier(PricingTier.FREE) - .withSubPlan("nbtttkgsuxu") - .withExtensions(Arrays.asList()), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(PricingTier.STANDARD, response.pricingTier()); - Assertions.assertEquals("ojkpoyh", response.subPlan()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProcessNotAllowedTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProcessNotAllowedTests.java deleted file mode 100644 index 91e9d144ff55..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProcessNotAllowedTests.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ProcessNotAllowed; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ProcessNotAllowedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProcessNotAllowed model = - BinaryData - .fromString( - "{\"ruleType\":\"ProcessNotAllowed\",\"allowlistValues\":[\"qcahyhxal\"],\"valueType\":\"String\",\"displayName\":\"woijpodtbl\",\"description\":\"kkwjdjodq\",\"isEnabled\":true}") - .toObject(ProcessNotAllowed.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("qcahyhxal", model.allowlistValues().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProcessNotAllowed model = - new ProcessNotAllowed().withIsEnabled(true).withAllowlistValues(Arrays.asList("qcahyhxal")); - model = BinaryData.fromObject(model).toObject(ProcessNotAllowed.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals("qcahyhxal", model.allowlistValues().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProtectionModeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProtectionModeTests.java deleted file mode 100644 index 9eb6bf3ff376..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProtectionModeTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.EnforcementMode; -import com.azure.resourcemanager.security.models.ProtectionMode; -import org.junit.jupiter.api.Assertions; - -public final class ProtectionModeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProtectionMode model = - BinaryData - .fromString("{\"exe\":\"Audit\",\"msi\":\"None\",\"script\":\"Enforce\",\"executable\":\"None\"}") - .toObject(ProtectionMode.class); - Assertions.assertEquals(EnforcementMode.AUDIT, model.exe()); - Assertions.assertEquals(EnforcementMode.NONE, model.msi()); - Assertions.assertEquals(EnforcementMode.ENFORCE, model.script()); - Assertions.assertEquals(EnforcementMode.NONE, model.executable()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProtectionMode model = - new ProtectionMode() - .withExe(EnforcementMode.AUDIT) - .withMsi(EnforcementMode.NONE) - .withScript(EnforcementMode.ENFORCE) - .withExecutable(EnforcementMode.NONE); - model = BinaryData.fromObject(model).toObject(ProtectionMode.class); - Assertions.assertEquals(EnforcementMode.AUDIT, model.exe()); - Assertions.assertEquals(EnforcementMode.NONE, model.msi()); - Assertions.assertEquals(EnforcementMode.ENFORCE, model.script()); - Assertions.assertEquals(EnforcementMode.NONE, model.executable()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProxyServerPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProxyServerPropertiesTests.java deleted file mode 100644 index 5966a7851905..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ProxyServerPropertiesTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ProxyServerProperties; -import org.junit.jupiter.api.Assertions; - -public final class ProxyServerPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ProxyServerProperties model = - BinaryData.fromString("{\"ip\":\"lobdxna\",\"port\":\"mkmlmvevfx\"}").toObject(ProxyServerProperties.class); - Assertions.assertEquals("lobdxna", model.ip()); - Assertions.assertEquals("mkmlmvevfx", model.port()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ProxyServerProperties model = new ProxyServerProperties().withIp("lobdxna").withPort("mkmlmvevfx"); - model = BinaryData.fromObject(model).toObject(ProxyServerProperties.class); - Assertions.assertEquals("lobdxna", model.ip()); - Assertions.assertEquals("mkmlmvevfx", model.port()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PublisherInfoTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PublisherInfoTests.java deleted file mode 100644 index 54dfb9a18650..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/PublisherInfoTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.PublisherInfo; -import org.junit.jupiter.api.Assertions; - -public final class PublisherInfoTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PublisherInfo model = - BinaryData - .fromString( - "{\"publisherName\":\"yrpfoobrlttymsj\",\"productName\":\"gqdnfwqzd\",\"binaryName\":\"tilaxh\",\"version\":\"hqlyvijo\"}") - .toObject(PublisherInfo.class); - Assertions.assertEquals("yrpfoobrlttymsj", model.publisherName()); - Assertions.assertEquals("gqdnfwqzd", model.productName()); - Assertions.assertEquals("tilaxh", model.binaryName()); - Assertions.assertEquals("hqlyvijo", model.version()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PublisherInfo model = - new PublisherInfo() - .withPublisherName("yrpfoobrlttymsj") - .withProductName("gqdnfwqzd") - .withBinaryName("tilaxh") - .withVersion("hqlyvijo"); - model = BinaryData.fromObject(model).toObject(PublisherInfo.class); - Assertions.assertEquals("yrpfoobrlttymsj", model.publisherName()); - Assertions.assertEquals("gqdnfwqzd", model.productName()); - Assertions.assertEquals("tilaxh", model.binaryName()); - Assertions.assertEquals("hqlyvijo", model.version()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/QueryCheckTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/QueryCheckTests.java deleted file mode 100644 index 429b84ab107c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/QueryCheckTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.QueryCheck; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class QueryCheckTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QueryCheck model = - BinaryData - .fromString( - "{\"query\":\"vcoqraswugyxpqi\",\"expectedResult\":[[\"alwvskbu\",\"z\"],[\"aq\"],[\"ltcoqc\",\"jpds\",\"zakuejk\"]],\"columnNames\":[\"iztjof\"]}") - .toObject(QueryCheck.class); - Assertions.assertEquals("vcoqraswugyxpqi", model.query()); - Assertions.assertEquals("alwvskbu", model.expectedResult().get(0).get(0)); - Assertions.assertEquals("iztjof", model.columnNames().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QueryCheck model = - new QueryCheck() - .withQuery("vcoqraswugyxpqi") - .withExpectedResult( - Arrays - .asList( - Arrays.asList("alwvskbu", "z"), - Arrays.asList("aq"), - Arrays.asList("ltcoqc", "jpds", "zakuejk"))) - .withColumnNames(Arrays.asList("iztjof")); - model = BinaryData.fromObject(model).toObject(QueryCheck.class); - Assertions.assertEquals("vcoqraswugyxpqi", model.query()); - Assertions.assertEquals("alwvskbu", model.expectedResult().get(0).get(0)); - Assertions.assertEquals("iztjof", model.columnNames().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/QueuePurgesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/QueuePurgesNotInAllowedRangeTests.java deleted file mode 100644 index acb13069353f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/QueuePurgesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.QueuePurgesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class QueuePurgesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QueuePurgesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"QueuePurgesNotInAllowedRange\",\"timeWindowSize\":\"PT46H8M28S\",\"minThreshold\":1596956883,\"maxThreshold\":2124553044,\"displayName\":\"xqiubxdukecpx\",\"description\":\"zvdhctmmkosz\",\"isEnabled\":true}") - .toObject(QueuePurgesNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1596956883, model.minThreshold()); - Assertions.assertEquals(2124553044, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT46H8M28S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QueuePurgesNotInAllowedRange model = - new QueuePurgesNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(1596956883) - .withMaxThreshold(2124553044) - .withTimeWindowSize(Duration.parse("PT46H8M28S")); - model = BinaryData.fromObject(model).toObject(QueuePurgesNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1596956883, model.minThreshold()); - Assertions.assertEquals(2124553044, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT46H8M28S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RecommendationConfigurationPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RecommendationConfigurationPropertiesTests.java deleted file mode 100644 index ff75f20716cc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RecommendationConfigurationPropertiesTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.RecommendationConfigStatus; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.RecommendationType; -import org.junit.jupiter.api.Assertions; - -public final class RecommendationConfigurationPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RecommendationConfigurationProperties model = - BinaryData - .fromString( - "{\"recommendationType\":\"IoT_PermissiveFirewallPolicy\",\"name\":\"xepcyvahfn\",\"status\":\"Disabled\"}") - .toObject(RecommendationConfigurationProperties.class); - Assertions.assertEquals(RecommendationType.IO_T_PERMISSIVE_FIREWALL_POLICY, model.recommendationType()); - Assertions.assertEquals(RecommendationConfigStatus.DISABLED, model.status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RecommendationConfigurationProperties model = - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_PERMISSIVE_FIREWALL_POLICY) - .withStatus(RecommendationConfigStatus.DISABLED); - model = BinaryData.fromObject(model).toObject(RecommendationConfigurationProperties.class); - Assertions.assertEquals(RecommendationType.IO_T_PERMISSIVE_FIREWALL_POLICY, model.recommendationType()); - Assertions.assertEquals(RecommendationConfigStatus.DISABLED, model.status()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentInnerTests.java deleted file mode 100644 index 2d63f783869e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; -import com.azure.resourcemanager.security.models.State; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceAssessmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceAssessmentInner model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"jsyingwfqatm\",\"assessmentType\":\"htmdvy\",\"assessmentDetailsLink\":\"ikdgszywkbir\",\"state\":\"Skipped\",\"passedResources\":1689730147,\"failedResources\":1361399231,\"skippedResources\":632633713,\"unsupportedResources\":1267831893},\"id\":\"rvqqaatj\",\"name\":\"nrvgoupmfiibfgg\",\"type\":\"ioolvrwxkvtkkgll\"}") - .toObject(RegulatoryComplianceAssessmentInner.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceAssessmentInner model = new RegulatoryComplianceAssessmentInner().withState(State.SKIPPED); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceAssessmentInner.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentListTests.java deleted file mode 100644 index b04f25b5d195..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentListTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessmentList; -import com.azure.resourcemanager.security.models.State; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceAssessmentListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceAssessmentList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"description\":\"jguufzdm\",\"assessmentType\":\"qtfihwhbotzinga\",\"assessmentDetailsLink\":\"pph\",\"state\":\"Failed\",\"passedResources\":1174017685,\"failedResources\":1680525224,\"skippedResources\":1947700175,\"unsupportedResources\":1694830705},\"id\":\"mvdk\",\"name\":\"wynwcvtbvkayhm\",\"type\":\"nvyq\"},{\"properties\":{\"description\":\"kzwpcnpw\",\"assessmentType\":\"jaesgvvsccya\",\"assessmentDetailsLink\":\"uq\",\"state\":\"Unsupported\",\"passedResources\":288302688,\"failedResources\":1810005859,\"skippedResources\":1249464934,\"unsupportedResources\":826622083},\"id\":\"fxusemdwzr\",\"name\":\"uh\",\"type\":\"pfcqdp\"},{\"properties\":{\"description\":\"qvpsvuoymg\",\"assessmentType\":\"elvezrypq\",\"assessmentDetailsLink\":\"feo\",\"state\":\"Failed\",\"passedResources\":1007513685,\"failedResources\":835251373,\"skippedResources\":137094818,\"unsupportedResources\":1870547697},\"id\":\"opgxedkowepb\",\"name\":\"pc\",\"type\":\"fkbw\"}],\"nextLink\":\"snjvcdwxlpqekftn\"}") - .toObject(RegulatoryComplianceAssessmentList.class); - Assertions.assertEquals(State.FAILED, model.value().get(0).state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceAssessmentList model = - new RegulatoryComplianceAssessmentList() - .withValue( - Arrays - .asList( - new RegulatoryComplianceAssessmentInner().withState(State.FAILED), - new RegulatoryComplianceAssessmentInner().withState(State.UNSUPPORTED), - new RegulatoryComplianceAssessmentInner().withState(State.FAILED))); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceAssessmentList.class); - Assertions.assertEquals(State.FAILED, model.value().get(0).state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentPropertiesTests.java deleted file mode 100644 index aed7d8293083..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceAssessmentProperties; -import com.azure.resourcemanager.security.models.State; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceAssessmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceAssessmentProperties model = - BinaryData - .fromString( - "{\"description\":\"jygvjayvbl\",\"assessmentType\":\"vkzuhbxvvyhgso\",\"assessmentDetailsLink\":\"yrqufegxuvwz\",\"state\":\"Skipped\",\"passedResources\":1709616859,\"failedResources\":882366629,\"skippedResources\":171252991,\"unsupportedResources\":488471027}") - .toObject(RegulatoryComplianceAssessmentProperties.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceAssessmentProperties model = - new RegulatoryComplianceAssessmentProperties().withState(State.SKIPPED); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceAssessmentProperties.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetWithResponseMockTests.java deleted file mode 100644 index 51fa5e4e92fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessment; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RegulatoryComplianceAssessmentsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"oshjgcze\",\"assessmentType\":\"bnxgzt\",\"assessmentDetailsLink\":\"gctjch\",\"state\":\"Unsupported\",\"passedResources\":1976746044,\"failedResources\":11816420,\"skippedResources\":549834402,\"unsupportedResources\":630846895},\"id\":\"cu\",\"name\":\"lbefvwc\",\"type\":\"jkxpylrwoxzgwpsy\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RegulatoryComplianceAssessment response = - manager - .regulatoryComplianceAssessments() - .getWithResponse("ldahlfxlmu", "fmuad", "nfsncs", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(State.UNSUPPORTED, response.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListMockTests.java deleted file mode 100644 index cfafa78526f1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceAssessmentsListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessment; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RegulatoryComplianceAssessmentsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"otjgxieqfkyfhi\",\"assessmentType\":\"jaqupbyynvskpaj\",\"assessmentDetailsLink\":\"geumexm\",\"state\":\"Skipped\",\"passedResources\":1361345524,\"failedResources\":401303949,\"skippedResources\":997716401,\"unsupportedResources\":1703770909},\"id\":\"txapeqiscrpilgf\",\"name\":\"rqre\",\"type\":\"daahuqi\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .regulatoryComplianceAssessments() - .list("uw", "jmwvvbtuqkxxi", "wgxql", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(State.SKIPPED, response.iterator().next().state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlInnerTests.java deleted file mode 100644 index 51989f4b62b1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; -import com.azure.resourcemanager.security.models.State; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceControlInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceControlInner model = - BinaryData - .fromString( - "{\"properties\":{\"description\":\"eljag\",\"state\":\"Skipped\",\"passedAssessments\":1903317968,\"failedAssessments\":777528334,\"skippedAssessments\":1378743202},\"id\":\"iiiojnalghf\",\"name\":\"vtvsexsowueluq\",\"type\":\"hahhxvrhmzkwpj\"}") - .toObject(RegulatoryComplianceControlInner.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceControlInner model = new RegulatoryComplianceControlInner().withState(State.SKIPPED); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceControlInner.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlListTests.java deleted file mode 100644 index 1e1b423cd7d9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlListTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControlList; -import com.azure.resourcemanager.security.models.State; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceControlListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceControlList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"description\":\"mbzonokix\",\"state\":\"Passed\",\"passedAssessments\":1122267125,\"failedAssessments\":1711524187,\"skippedAssessments\":2101008571},\"id\":\"frl\",\"name\":\"zszrnwoiindfpw\",\"type\":\"jylwbtlhflsj\"}],\"nextLink\":\"hszfjvfb\"}") - .toObject(RegulatoryComplianceControlList.class); - Assertions.assertEquals(State.PASSED, model.value().get(0).state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceControlList model = - new RegulatoryComplianceControlList() - .withValue(Arrays.asList(new RegulatoryComplianceControlInner().withState(State.PASSED))); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceControlList.class); - Assertions.assertEquals(State.PASSED, model.value().get(0).state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlPropertiesTests.java deleted file mode 100644 index 97780d0b2f47..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceControlProperties; -import com.azure.resourcemanager.security.models.State; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceControlPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceControlProperties model = - BinaryData - .fromString( - "{\"description\":\"wspughftqsxhqx\",\"state\":\"Skipped\",\"passedAssessments\":649615996,\"failedAssessments\":1485711526,\"skippedAssessments\":2084244471}") - .toObject(RegulatoryComplianceControlProperties.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceControlProperties model = - new RegulatoryComplianceControlProperties().withState(State.SKIPPED); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceControlProperties.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetWithResponseMockTests.java deleted file mode 100644 index 2c867d51342a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControl; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RegulatoryComplianceControlsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"description\":\"fokyks\",\"state\":\"Passed\",\"passedAssessments\":944337652,\"failedAssessments\":1143447896,\"skippedAssessments\":1950190822},\"id\":\"kcxzz\",\"name\":\"nuif\",\"type\":\"rsejegprkj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RegulatoryComplianceControl response = - manager - .regulatoryComplianceControls() - .getWithResponse("lrrskap", "xwieexuyade", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(State.PASSED, response.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListMockTests.java deleted file mode 100644 index d030b87d8cf0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceControlsListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RegulatoryComplianceControl; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RegulatoryComplianceControlsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"description\":\"wxiplkyso\",\"state\":\"Failed\",\"passedAssessments\":67847643,\"failedAssessments\":1371951498,\"skippedAssessments\":658802312},\"id\":\"whdmcvhtbbz\",\"name\":\"hfvhuwzbxpcqz\",\"type\":\"ihotjecohmxv\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .regulatoryComplianceControls() - .list("yhcdjwsuoardnag", "tpufpbpgnrholhu", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(State.FAILED, response.iterator().next().state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardInnerTests.java deleted file mode 100644 index af1d82ec432b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; -import com.azure.resourcemanager.security.models.State; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceStandardInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceStandardInner model = - BinaryData - .fromString( - "{\"properties\":{\"state\":\"Skipped\",\"passedControls\":738746300,\"failedControls\":638872994,\"skippedControls\":110101001,\"unsupportedControls\":174588693},\"id\":\"ib\",\"name\":\"rcgp\",\"type\":\"kpzi\"}") - .toObject(RegulatoryComplianceStandardInner.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceStandardInner model = new RegulatoryComplianceStandardInner().withState(State.SKIPPED); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceStandardInner.class); - Assertions.assertEquals(State.SKIPPED, model.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardListTests.java deleted file mode 100644 index 7557e7ec0183..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardListTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardInner; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandardList; -import com.azure.resourcemanager.security.models.State; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceStandardListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceStandardList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"state\":\"Skipped\",\"passedControls\":1997907611,\"failedControls\":2111279751,\"skippedControls\":1073194543,\"unsupportedControls\":387671304},\"id\":\"p\",\"name\":\"jxbkzbzkdvn\",\"type\":\"jabudurgkakmo\"},{\"properties\":{\"state\":\"Failed\",\"passedControls\":893447379,\"failedControls\":873562090,\"skippedControls\":1182691834,\"unsupportedControls\":783879068},\"id\":\"uwqlgzrfzeey\",\"name\":\"bizikayuhq\",\"type\":\"bjbsybb\"},{\"properties\":{\"state\":\"Unsupported\",\"passedControls\":948234782,\"failedControls\":1918019278,\"skippedControls\":348550148,\"unsupportedControls\":1644492935},\"id\":\"vm\",\"name\":\"ipaslthaqfxssmwu\",\"type\":\"wbdsr\"}],\"nextLink\":\"pdrhne\"}") - .toObject(RegulatoryComplianceStandardList.class); - Assertions.assertEquals(State.SKIPPED, model.value().get(0).state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceStandardList model = - new RegulatoryComplianceStandardList() - .withValue( - Arrays - .asList( - new RegulatoryComplianceStandardInner().withState(State.SKIPPED), - new RegulatoryComplianceStandardInner().withState(State.FAILED), - new RegulatoryComplianceStandardInner().withState(State.UNSUPPORTED))); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceStandardList.class); - Assertions.assertEquals(State.SKIPPED, model.value().get(0).state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardPropertiesTests.java deleted file mode 100644 index fa2123da0edc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RegulatoryComplianceStandardProperties; -import com.azure.resourcemanager.security.models.State; -import org.junit.jupiter.api.Assertions; - -public final class RegulatoryComplianceStandardPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RegulatoryComplianceStandardProperties model = - BinaryData - .fromString( - "{\"state\":\"Passed\",\"passedControls\":1289922635,\"failedControls\":2016240775,\"skippedControls\":1785480642,\"unsupportedControls\":1319362662}") - .toObject(RegulatoryComplianceStandardProperties.class); - Assertions.assertEquals(State.PASSED, model.state()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RegulatoryComplianceStandardProperties model = - new RegulatoryComplianceStandardProperties().withState(State.PASSED); - model = BinaryData.fromObject(model).toObject(RegulatoryComplianceStandardProperties.class); - Assertions.assertEquals(State.PASSED, model.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetWithResponseMockTests.java deleted file mode 100644 index 880f5141db77..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsGetWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandard; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RegulatoryComplianceStandardsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"state\":\"Passed\",\"passedControls\":1731687538,\"failedControls\":1363649991,\"skippedControls\":453247963,\"unsupportedControls\":1503663605},\"id\":\"lriqbyokvjgbzs\",\"name\":\"e\",\"type\":\"rsltt\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RegulatoryComplianceStandard response = - manager - .regulatoryComplianceStandards() - .getWithResponse("qwulynkgfcfdru", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(State.PASSED, response.state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListMockTests.java deleted file mode 100644 index 9d89eb70051e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RegulatoryComplianceStandardsListMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RegulatoryComplianceStandard; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class RegulatoryComplianceStandardsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"state\":\"Failed\",\"passedControls\":1575047020,\"failedControls\":1278915874,\"skippedControls\":1490193432,\"unsupportedControls\":146432492},\"id\":\"wiinjdllw\",\"name\":\"tlepowavvqxua\",\"type\":\"g\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.regulatoryComplianceStandards().list("uiadhbatecaatsdo", com.azure.core.util.Context.NONE); - - Assertions.assertEquals(State.FAILED, response.iterator().next().state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RemediationEtaTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RemediationEtaTests.java deleted file mode 100644 index 4d3e2f24307f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RemediationEtaTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.RemediationEta; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class RemediationEtaTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RemediationEta model = - BinaryData - .fromString("{\"eta\":\"2021-03-27T00:38:49Z\",\"justification\":\"dbztjhqtfbov\"}") - .toObject(RemediationEta.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-27T00:38:49Z"), model.eta()); - Assertions.assertEquals("dbztjhqtfbov", model.justification()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RemediationEta model = - new RemediationEta() - .withEta(OffsetDateTime.parse("2021-03-27T00:38:49Z")) - .withJustification("dbztjhqtfbov"); - model = BinaryData.fromObject(model).toObject(RemediationEta.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-27T00:38:49Z"), model.eta()); - Assertions.assertEquals("dbztjhqtfbov", model.justification()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RemediationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RemediationTests.java deleted file mode 100644 index 930327a8121d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RemediationTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Remediation; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RemediationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Remediation model = - BinaryData - .fromString( - "{\"description\":\"kzykjtjk\",\"scripts\":[\"fwushcdpkupn\",\"rmgjfbpkuwx\"],\"automated\":true,\"portalLink\":\"jfizfavkjzwfbc\"}") - .toObject(Remediation.class); - Assertions.assertEquals("kzykjtjk", model.description()); - Assertions.assertEquals("fwushcdpkupn", model.scripts().get(0)); - Assertions.assertEquals(true, model.automated()); - Assertions.assertEquals("jfizfavkjzwfbc", model.portalLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Remediation model = - new Remediation() - .withDescription("kzykjtjk") - .withScripts(Arrays.asList("fwushcdpkupn", "rmgjfbpkuwx")) - .withAutomated(true) - .withPortalLink("jfizfavkjzwfbc"); - model = BinaryData.fromObject(model).toObject(Remediation.class); - Assertions.assertEquals("kzykjtjk", model.description()); - Assertions.assertEquals("fwushcdpkupn", model.scripts().get(0)); - Assertions.assertEquals(true, model.automated()); - Assertions.assertEquals("jfizfavkjzwfbc", model.portalLink()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceDetailsAutoGeneratedTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceDetailsAutoGeneratedTests.java deleted file mode 100644 index 8ba7719eae1f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceDetailsAutoGeneratedTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated; -import com.azure.resourcemanager.security.models.Source; -import org.junit.jupiter.api.Assertions; - -public final class ResourceDetailsAutoGeneratedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceDetailsAutoGenerated model = - BinaryData - .fromString("{\"source\":\"Azure\",\"id\":\"qr\",\"connectorId\":\"tjzcfyjzpt\"}") - .toObject(ResourceDetailsAutoGenerated.class); - Assertions.assertEquals(Source.AZURE, model.source()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceDetailsAutoGenerated model = new ResourceDetailsAutoGenerated().withSource(Source.AZURE); - model = BinaryData.fromObject(model).toObject(ResourceDetailsAutoGenerated.class); - Assertions.assertEquals(Source.AZURE, model.source()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceDetailsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceDetailsTests.java deleted file mode 100644 index 3caac7e5de92..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceDetailsTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ResourceDetails; - -public final class ResourceDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceDetails model = - BinaryData.fromString("{\"source\":\"ResourceDetails\"}").toObject(ResourceDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceDetails model = new ResourceDetails(); - model = BinaryData.fromObject(model).toObject(ResourceDetails.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceIdentifierTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceIdentifierTests.java deleted file mode 100644 index befa25b139d5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ResourceIdentifierTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ResourceIdentifier; - -public final class ResourceIdentifierTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceIdentifier model = - BinaryData.fromString("{\"type\":\"ResourceIdentifier\"}").toObject(ResourceIdentifier.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceIdentifier model = new ResourceIdentifier(); - model = BinaryData.fromObject(model).toObject(ResourceIdentifier.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsInnerTests.java deleted file mode 100644 index 6cc2011caabf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsInnerTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.models.RuleResultsProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RuleResultsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RuleResultsInner model = - BinaryData - .fromString( - "{\"properties\":{\"results\":[[\"exdnd\",\"bdweade\",\"zmwntopagt\"]]},\"id\":\"mvmmagoaqylkjz\",\"name\":\"jiuazjc\",\"type\":\"mxitpfinzcpd\"}") - .toObject(RuleResultsInner.class); - Assertions.assertEquals("exdnd", model.properties().results().get(0).get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RuleResultsInner model = - new RuleResultsInner() - .withProperties( - new RuleResultsProperties() - .withResults(Arrays.asList(Arrays.asList("exdnd", "bdweade", "zmwntopagt")))); - model = BinaryData.fromObject(model).toObject(RuleResultsInner.class); - Assertions.assertEquals("exdnd", model.properties().results().get(0).get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsInputTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsInputTests.java deleted file mode 100644 index b371a08444c0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsInputTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.RuleResultsInput; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RuleResultsInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RuleResultsInput model = - BinaryData - .fromString("{\"latestScan\":false,\"results\":[[\"gvxvatv\",\"rkdlb\",\"bqxvhcsyhzlwxae\"]]}") - .toObject(RuleResultsInput.class); - Assertions.assertEquals(false, model.latestScan()); - Assertions.assertEquals("gvxvatv", model.results().get(0).get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RuleResultsInput model = - new RuleResultsInput() - .withLatestScan(false) - .withResults(Arrays.asList(Arrays.asList("gvxvatv", "rkdlb", "bqxvhcsyhzlwxae"))); - model = BinaryData.fromObject(model).toObject(RuleResultsInput.class); - Assertions.assertEquals(false, model.latestScan()); - Assertions.assertEquals("gvxvatv", model.results().get(0).get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsPropertiesTests.java deleted file mode 100644 index 6b8e3992ee35..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleResultsPropertiesTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.RuleResultsProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RuleResultsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RuleResultsProperties model = - BinaryData - .fromString("{\"results\":[[\"lgjmtbd\",\"vcqguefzh\"],[\"p\",\"eqdurelyujlfyoum\"]]}") - .toObject(RuleResultsProperties.class); - Assertions.assertEquals("lgjmtbd", model.results().get(0).get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RuleResultsProperties model = - new RuleResultsProperties() - .withResults( - Arrays.asList(Arrays.asList("lgjmtbd", "vcqguefzh"), Arrays.asList("p", "eqdurelyujlfyoum"))); - model = BinaryData.fromObject(model).toObject(RuleResultsProperties.class); - Assertions.assertEquals("lgjmtbd", model.results().get(0).get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleTests.java deleted file mode 100644 index 3d55194c942d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RuleTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Direction; -import com.azure.resourcemanager.security.models.Rule; -import com.azure.resourcemanager.security.models.TransportProtocol; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class RuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Rule model = - BinaryData - .fromString( - "{\"name\":\"dfgsftufqobrj\",\"direction\":\"Outbound\",\"destinationPort\":1823557197,\"protocols\":[\"UDP\",\"TCP\",\"TCP\"],\"ipAddresses\":[\"kizvytn\",\"zvulj\"]}") - .toObject(Rule.class); - Assertions.assertEquals("dfgsftufqobrj", model.name()); - Assertions.assertEquals(Direction.OUTBOUND, model.direction()); - Assertions.assertEquals(1823557197, model.destinationPort()); - Assertions.assertEquals(TransportProtocol.UDP, model.protocols().get(0)); - Assertions.assertEquals("kizvytn", model.ipAddresses().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Rule model = - new Rule() - .withName("dfgsftufqobrj") - .withDirection(Direction.OUTBOUND) - .withDestinationPort(1823557197) - .withProtocols(Arrays.asList(TransportProtocol.UDP, TransportProtocol.TCP, TransportProtocol.TCP)) - .withIpAddresses(Arrays.asList("kizvytn", "zvulj")); - model = BinaryData.fromObject(model).toObject(Rule.class); - Assertions.assertEquals("dfgsftufqobrj", model.name()); - Assertions.assertEquals(Direction.OUTBOUND, model.direction()); - Assertions.assertEquals(1823557197, model.destinationPort()); - Assertions.assertEquals(TransportProtocol.UDP, model.protocols().get(0)); - Assertions.assertEquals("kizvytn", model.ipAddresses().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RulesResultsInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RulesResultsInnerTests.java deleted file mode 100644 index 495af69a18fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RulesResultsInnerTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.RuleResultsInner; -import com.azure.resourcemanager.security.fluent.models.RulesResultsInner; -import com.azure.resourcemanager.security.models.RuleResultsProperties; -import java.util.Arrays; - -public final class RulesResultsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RulesResultsInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"results\":[]},\"id\":\"clcdigptajbrzmq\",\"name\":\"ucycijo\",\"type\":\"lxiutgjcyzyzjdnr\"},{\"properties\":{\"results\":[]},\"id\":\"txjeaoqaqbzgy\",\"name\":\"fwwvuatbwbqam\",\"type\":\"e\"},{\"properties\":{\"results\":[]},\"id\":\"yslpkcvmw\",\"name\":\"auxxepmyw\",\"type\":\"ormcqmic\"}]}") - .toObject(RulesResultsInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RulesResultsInner model = - new RulesResultsInner() - .withValue( - Arrays - .asList( - new RuleResultsInner() - .withProperties(new RuleResultsProperties().withResults(Arrays.asList())), - new RuleResultsInner() - .withProperties(new RuleResultsProperties().withResults(Arrays.asList())), - new RuleResultsInner() - .withProperties(new RuleResultsProperties().withResults(Arrays.asList())))); - model = BinaryData.fromObject(model).toObject(RulesResultsInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RulesResultsInputTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RulesResultsInputTests.java deleted file mode 100644 index 5e01764d6ecc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/RulesResultsInputTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.RulesResultsInput; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class RulesResultsInputTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - RulesResultsInput model = - BinaryData - .fromString( - "{\"latestScan\":false,\"results\":{\"z\":[[\"fbojxjmcsmyqwix\",\"cp\"],[\"kwywzwofalic\",\"duoiqt\",\"mt\"],[\"sknxrwzawnvsbcf\",\"zagxnvhycvdi\",\"wrzregzgyufu\"],[\"wpwerye\"]],\"hnhjtfvpndpmi\":[[\"meottawj\",\"osxw\"]],\"yyshtuwgmevua\":[[\"nwynudq\"],[\"zsauzp\"],[\"xee\",\"uxiqhzlraymezxl\",\"kihmxrfdsajredn\"]]}}") - .toObject(RulesResultsInput.class); - Assertions.assertEquals(false, model.latestScan()); - Assertions.assertEquals("fbojxjmcsmyqwix", model.results().get("z").get(0).get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - RulesResultsInput model = - new RulesResultsInput() - .withLatestScan(false) - .withResults( - mapOf( - "z", - Arrays - .asList( - Arrays.asList("fbojxjmcsmyqwix", "cp"), - Arrays.asList("kwywzwofalic", "duoiqt", "mt"), - Arrays.asList("sknxrwzawnvsbcf", "zagxnvhycvdi", "wrzregzgyufu"), - Arrays.asList("wpwerye")), - "hnhjtfvpndpmi", - Arrays.asList(Arrays.asList("meottawj", "osxw")), - "yyshtuwgmevua", - Arrays - .asList( - Arrays.asList("nwynudq"), - Arrays.asList("zsauzp"), - Arrays.asList("xee", "uxiqhzlraymezxl", "kihmxrfdsajredn")))); - model = BinaryData.fromObject(model).toObject(RulesResultsInput.class); - Assertions.assertEquals(false, model.latestScan()); - Assertions.assertEquals("fbojxjmcsmyqwix", model.results().get("z").get(0).get(0)); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanInnerTests.java deleted file mode 100644 index f6ecb2d2df08..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanInnerTests.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ScanInner; -import com.azure.resourcemanager.security.models.ScanProperties; -import com.azure.resourcemanager.security.models.ScanState; -import com.azure.resourcemanager.security.models.ScanTriggerType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ScanInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScanInner model = - BinaryData - .fromString( - "{\"properties\":{\"triggerType\":\"OnDemand\",\"state\":\"FailedToRun\",\"server\":\"scmnlziji\",\"database\":\"ehgmvflnwyv\",\"sqlVersion\":\"xrerlniylylyf\",\"startTime\":\"2021-07-06T13:46:49Z\",\"endTime\":\"2021-10-13T07:30Z\",\"highSeverityFailedRulesCount\":940843916,\"mediumSeverityFailedRulesCount\":1491604791,\"lowSeverityFailedRulesCount\":315348665,\"totalPassedRulesCount\":2049313385,\"totalFailedRulesCount\":1986729733,\"totalRulesCount\":260996663,\"isBaselineApplied\":true,\"lastScanTime\":\"2021-06-25T10:35:09Z\"},\"id\":\"cdxa\",\"name\":\"bujftaben\",\"type\":\"bklqpxz\"}") - .toObject(ScanInner.class); - Assertions.assertEquals(ScanTriggerType.ON_DEMAND, model.properties().triggerType()); - Assertions.assertEquals(ScanState.FAILED_TO_RUN, model.properties().state()); - Assertions.assertEquals("scmnlziji", model.properties().server()); - Assertions.assertEquals("ehgmvflnwyv", model.properties().database()); - Assertions.assertEquals("xrerlniylylyf", model.properties().sqlVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T13:46:49Z"), model.properties().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-13T07:30Z"), model.properties().endTime()); - Assertions.assertEquals(940843916, model.properties().highSeverityFailedRulesCount()); - Assertions.assertEquals(1491604791, model.properties().mediumSeverityFailedRulesCount()); - Assertions.assertEquals(315348665, model.properties().lowSeverityFailedRulesCount()); - Assertions.assertEquals(2049313385, model.properties().totalPassedRulesCount()); - Assertions.assertEquals(1986729733, model.properties().totalFailedRulesCount()); - Assertions.assertEquals(260996663, model.properties().totalRulesCount()); - Assertions.assertEquals(true, model.properties().isBaselineApplied()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T10:35:09Z"), model.properties().lastScanTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScanInner model = - new ScanInner() - .withProperties( - new ScanProperties() - .withTriggerType(ScanTriggerType.ON_DEMAND) - .withState(ScanState.FAILED_TO_RUN) - .withServer("scmnlziji") - .withDatabase("ehgmvflnwyv") - .withSqlVersion("xrerlniylylyf") - .withStartTime(OffsetDateTime.parse("2021-07-06T13:46:49Z")) - .withEndTime(OffsetDateTime.parse("2021-10-13T07:30Z")) - .withHighSeverityFailedRulesCount(940843916) - .withMediumSeverityFailedRulesCount(1491604791) - .withLowSeverityFailedRulesCount(315348665) - .withTotalPassedRulesCount(2049313385) - .withTotalFailedRulesCount(1986729733) - .withTotalRulesCount(260996663) - .withIsBaselineApplied(true) - .withLastScanTime(OffsetDateTime.parse("2021-06-25T10:35:09Z"))); - model = BinaryData.fromObject(model).toObject(ScanInner.class); - Assertions.assertEquals(ScanTriggerType.ON_DEMAND, model.properties().triggerType()); - Assertions.assertEquals(ScanState.FAILED_TO_RUN, model.properties().state()); - Assertions.assertEquals("scmnlziji", model.properties().server()); - Assertions.assertEquals("ehgmvflnwyv", model.properties().database()); - Assertions.assertEquals("xrerlniylylyf", model.properties().sqlVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T13:46:49Z"), model.properties().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-13T07:30Z"), model.properties().endTime()); - Assertions.assertEquals(940843916, model.properties().highSeverityFailedRulesCount()); - Assertions.assertEquals(1491604791, model.properties().mediumSeverityFailedRulesCount()); - Assertions.assertEquals(315348665, model.properties().lowSeverityFailedRulesCount()); - Assertions.assertEquals(2049313385, model.properties().totalPassedRulesCount()); - Assertions.assertEquals(1986729733, model.properties().totalFailedRulesCount()); - Assertions.assertEquals(260996663, model.properties().totalRulesCount()); - Assertions.assertEquals(true, model.properties().isBaselineApplied()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-25T10:35:09Z"), model.properties().lastScanTime()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanPropertiesTests.java deleted file mode 100644 index 4a55b76d98a9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanPropertiesTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ScanProperties; -import com.azure.resourcemanager.security.models.ScanState; -import com.azure.resourcemanager.security.models.ScanTriggerType; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class ScanPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScanProperties model = - BinaryData - .fromString( - "{\"triggerType\":\"Recurring\",\"state\":\"Failed\",\"server\":\"dwwnl\",\"database\":\"fwxudgnhg\",\"sqlVersion\":\"krtalvn\",\"startTime\":\"2021-10-08T14:43:06Z\",\"endTime\":\"2021-07-31T12:16:21Z\",\"highSeverityFailedRulesCount\":518056276,\"mediumSeverityFailedRulesCount\":408640684,\"lowSeverityFailedRulesCount\":1742020192,\"totalPassedRulesCount\":426542999,\"totalFailedRulesCount\":1442817098,\"totalRulesCount\":1323472014,\"isBaselineApplied\":false,\"lastScanTime\":\"2021-08-28T23:34:11Z\"}") - .toObject(ScanProperties.class); - Assertions.assertEquals(ScanTriggerType.RECURRING, model.triggerType()); - Assertions.assertEquals(ScanState.FAILED, model.state()); - Assertions.assertEquals("dwwnl", model.server()); - Assertions.assertEquals("fwxudgnhg", model.database()); - Assertions.assertEquals("krtalvn", model.sqlVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-08T14:43:06Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T12:16:21Z"), model.endTime()); - Assertions.assertEquals(518056276, model.highSeverityFailedRulesCount()); - Assertions.assertEquals(408640684, model.mediumSeverityFailedRulesCount()); - Assertions.assertEquals(1742020192, model.lowSeverityFailedRulesCount()); - Assertions.assertEquals(426542999, model.totalPassedRulesCount()); - Assertions.assertEquals(1442817098, model.totalFailedRulesCount()); - Assertions.assertEquals(1323472014, model.totalRulesCount()); - Assertions.assertEquals(false, model.isBaselineApplied()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T23:34:11Z"), model.lastScanTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScanProperties model = - new ScanProperties() - .withTriggerType(ScanTriggerType.RECURRING) - .withState(ScanState.FAILED) - .withServer("dwwnl") - .withDatabase("fwxudgnhg") - .withSqlVersion("krtalvn") - .withStartTime(OffsetDateTime.parse("2021-10-08T14:43:06Z")) - .withEndTime(OffsetDateTime.parse("2021-07-31T12:16:21Z")) - .withHighSeverityFailedRulesCount(518056276) - .withMediumSeverityFailedRulesCount(408640684) - .withLowSeverityFailedRulesCount(1742020192) - .withTotalPassedRulesCount(426542999) - .withTotalFailedRulesCount(1442817098) - .withTotalRulesCount(1323472014) - .withIsBaselineApplied(false) - .withLastScanTime(OffsetDateTime.parse("2021-08-28T23:34:11Z")); - model = BinaryData.fromObject(model).toObject(ScanProperties.class); - Assertions.assertEquals(ScanTriggerType.RECURRING, model.triggerType()); - Assertions.assertEquals(ScanState.FAILED, model.state()); - Assertions.assertEquals("dwwnl", model.server()); - Assertions.assertEquals("fwxudgnhg", model.database()); - Assertions.assertEquals("krtalvn", model.sqlVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-08T14:43:06Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-31T12:16:21Z"), model.endTime()); - Assertions.assertEquals(518056276, model.highSeverityFailedRulesCount()); - Assertions.assertEquals(408640684, model.mediumSeverityFailedRulesCount()); - Assertions.assertEquals(1742020192, model.lowSeverityFailedRulesCount()); - Assertions.assertEquals(426542999, model.totalPassedRulesCount()); - Assertions.assertEquals(1442817098, model.totalFailedRulesCount()); - Assertions.assertEquals(1323472014, model.totalRulesCount()); - Assertions.assertEquals(false, model.isBaselineApplied()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T23:34:11Z"), model.lastScanTime()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultInnerTests.java deleted file mode 100644 index 37d371369217..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultInnerTests.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.models.BaselineAdjustedResult; -import com.azure.resourcemanager.security.models.Remediation; -import com.azure.resourcemanager.security.models.RuleSeverity; -import com.azure.resourcemanager.security.models.RuleStatus; -import com.azure.resourcemanager.security.models.RuleType; -import com.azure.resourcemanager.security.models.ScanResultProperties; -import com.azure.resourcemanager.security.models.VaRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScanResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScanResultInner model = - BinaryData - .fromString( - "{\"properties\":{\"ruleId\":\"drrslblxydk\",\"status\":\"InternalError\",\"isTrimmed\":true,\"queryResults\":[[\"wkgfbqljnqkh\",\"chocokulehur\",\"lrqff\"],[\"eyu\",\"kphyjdxrav\",\"uqd\"],[\"xmrgchbapxkiy\",\"jjk\",\"ajb\"]],\"remediation\":{\"description\":\"gd\",\"scripts\":[\"ioycbl\",\"vpmclujyxkyxlz\",\"sjgkzzltafh\",\"zffovwmbjl\"],\"automated\":true,\"portalLink\":\"zpgvdwnapfd\"},\"baselineAdjustedResult\":{\"status\":\"Finding\",\"resultsNotInBaseline\":[[],[],[],[]],\"resultsOnlyInBaseline\":[[]]},\"ruleMetadata\":{\"ruleId\":\"jtks\",\"severity\":\"Medium\",\"category\":\"gqy\",\"ruleType\":\"BaselineExpected\",\"title\":\"eyqrhv\",\"description\":\"ldotjvdkwisws\",\"rationale\":\"kjtasb\",\"benchmarkReferences\":[]}},\"id\":\"pkxkdtxfk\",\"name\":\"dlqvtwknvg\",\"type\":\"mb\"}") - .toObject(ScanResultInner.class); - Assertions.assertEquals("drrslblxydk", model.properties().ruleId()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, model.properties().status()); - Assertions.assertEquals(true, model.properties().isTrimmed()); - Assertions.assertEquals("wkgfbqljnqkh", model.properties().queryResults().get(0).get(0)); - Assertions.assertEquals("gd", model.properties().remediation().description()); - Assertions.assertEquals("ioycbl", model.properties().remediation().scripts().get(0)); - Assertions.assertEquals(true, model.properties().remediation().automated()); - Assertions.assertEquals("zpgvdwnapfd", model.properties().remediation().portalLink()); - Assertions.assertEquals(RuleStatus.FINDING, model.properties().baselineAdjustedResult().status()); - Assertions.assertEquals("jtks", model.properties().ruleMetadata().ruleId()); - Assertions.assertEquals(RuleSeverity.MEDIUM, model.properties().ruleMetadata().severity()); - Assertions.assertEquals("gqy", model.properties().ruleMetadata().category()); - Assertions.assertEquals(RuleType.BASELINE_EXPECTED, model.properties().ruleMetadata().ruleType()); - Assertions.assertEquals("eyqrhv", model.properties().ruleMetadata().title()); - Assertions.assertEquals("ldotjvdkwisws", model.properties().ruleMetadata().description()); - Assertions.assertEquals("kjtasb", model.properties().ruleMetadata().rationale()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScanResultInner model = - new ScanResultInner() - .withProperties( - new ScanResultProperties() - .withRuleId("drrslblxydk") - .withStatus(RuleStatus.INTERNAL_ERROR) - .withIsTrimmed(true) - .withQueryResults( - Arrays - .asList( - Arrays.asList("wkgfbqljnqkh", "chocokulehur", "lrqff"), - Arrays.asList("eyu", "kphyjdxrav", "uqd"), - Arrays.asList("xmrgchbapxkiy", "jjk", "ajb"))) - .withRemediation( - new Remediation() - .withDescription("gd") - .withScripts(Arrays.asList("ioycbl", "vpmclujyxkyxlz", "sjgkzzltafh", "zffovwmbjl")) - .withAutomated(true) - .withPortalLink("zpgvdwnapfd")) - .withBaselineAdjustedResult( - new BaselineAdjustedResult() - .withStatus(RuleStatus.FINDING) - .withResultsNotInBaseline( - Arrays.asList(Arrays.asList(), Arrays.asList(), Arrays.asList(), Arrays.asList())) - .withResultsOnlyInBaseline(Arrays.asList(Arrays.asList()))) - .withRuleMetadata( - new VaRule() - .withRuleId("jtks") - .withSeverity(RuleSeverity.MEDIUM) - .withCategory("gqy") - .withRuleType(RuleType.BASELINE_EXPECTED) - .withTitle("eyqrhv") - .withDescription("ldotjvdkwisws") - .withRationale("kjtasb") - .withBenchmarkReferences(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(ScanResultInner.class); - Assertions.assertEquals("drrslblxydk", model.properties().ruleId()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, model.properties().status()); - Assertions.assertEquals(true, model.properties().isTrimmed()); - Assertions.assertEquals("wkgfbqljnqkh", model.properties().queryResults().get(0).get(0)); - Assertions.assertEquals("gd", model.properties().remediation().description()); - Assertions.assertEquals("ioycbl", model.properties().remediation().scripts().get(0)); - Assertions.assertEquals(true, model.properties().remediation().automated()); - Assertions.assertEquals("zpgvdwnapfd", model.properties().remediation().portalLink()); - Assertions.assertEquals(RuleStatus.FINDING, model.properties().baselineAdjustedResult().status()); - Assertions.assertEquals("jtks", model.properties().ruleMetadata().ruleId()); - Assertions.assertEquals(RuleSeverity.MEDIUM, model.properties().ruleMetadata().severity()); - Assertions.assertEquals("gqy", model.properties().ruleMetadata().category()); - Assertions.assertEquals(RuleType.BASELINE_EXPECTED, model.properties().ruleMetadata().ruleType()); - Assertions.assertEquals("eyqrhv", model.properties().ruleMetadata().title()); - Assertions.assertEquals("ldotjvdkwisws", model.properties().ruleMetadata().description()); - Assertions.assertEquals("kjtasb", model.properties().ruleMetadata().rationale()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultPropertiesTests.java deleted file mode 100644 index 3995b13eb622..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultPropertiesTests.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Baseline; -import com.azure.resourcemanager.security.models.BaselineAdjustedResult; -import com.azure.resourcemanager.security.models.BenchmarkReference; -import com.azure.resourcemanager.security.models.QueryCheck; -import com.azure.resourcemanager.security.models.Remediation; -import com.azure.resourcemanager.security.models.RuleSeverity; -import com.azure.resourcemanager.security.models.RuleStatus; -import com.azure.resourcemanager.security.models.RuleType; -import com.azure.resourcemanager.security.models.ScanResultProperties; -import com.azure.resourcemanager.security.models.VaRule; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScanResultPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScanResultProperties model = - BinaryData - .fromString( - "{\"ruleId\":\"tywatmqaq\",\"status\":\"InternalError\",\"isTrimmed\":false,\"queryResults\":[[\"eshoygzcb\",\"fqxkfaoyteh\",\"puvjmvqmtd\",\"ckygroejnndljdju\"],[\"br\"],[\"qyn\"]],\"remediation\":{\"description\":\"ysfaqegplwrysh\",\"scripts\":[\"kvb\"],\"automated\":true,\"portalLink\":\"usybwptdaca\"},\"baselineAdjustedResult\":{\"baseline\":{\"expectedResults\":[[]],\"updatedTime\":\"2021-11-02T10:29:39Z\"},\"status\":\"NonFinding\",\"resultsNotInBaseline\":[[\"iwenazero\",\"zrsq\",\"lsxkd\",\"wqapfgsdp\"]],\"resultsOnlyInBaseline\":[[\"smzhhkuuipldqqct\",\"kva\",\"blhtjq\"],[\"yvwehtaemxh\"],[\"ysev\",\"sxivzrrryvei\",\"ipsk\"]]},\"ruleMetadata\":{\"ruleId\":\"atvfuzkaftj\",\"severity\":\"High\",\"category\":\"xwigsye\",\"ruleType\":\"BaselineExpected\",\"title\":\"smjtgrqgdg\",\"description\":\"ileplk\",\"rationale\":\"mknhwtbbaedor\",\"queryCheck\":{\"query\":\"qfloygbdgwum\",\"expectedResult\":[[],[],[]],\"columnNames\":[\"hpabgdexjddvjs\"]},\"benchmarkReferences\":[{\"benchmark\":\"tm\",\"reference\":\"llcolsrsxapte\"},{\"benchmark\":\"excgjokjljnhvl\",\"reference\":\"bekpeeksnbksdqhj\"},{\"benchmark\":\"klxesl\",\"reference\":\"hustcpoqmavnwqjw\"},{\"benchmark\":\"knlejjjkxybwfd\",\"reference\":\"jbzten\"}]}}") - .toObject(ScanResultProperties.class); - Assertions.assertEquals("tywatmqaq", model.ruleId()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, model.status()); - Assertions.assertEquals(false, model.isTrimmed()); - Assertions.assertEquals("eshoygzcb", model.queryResults().get(0).get(0)); - Assertions.assertEquals("ysfaqegplwrysh", model.remediation().description()); - Assertions.assertEquals("kvb", model.remediation().scripts().get(0)); - Assertions.assertEquals(true, model.remediation().automated()); - Assertions.assertEquals("usybwptdaca", model.remediation().portalLink()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-11-02T10:29:39Z"), model.baselineAdjustedResult().baseline().updatedTime()); - Assertions.assertEquals(RuleStatus.NON_FINDING, model.baselineAdjustedResult().status()); - Assertions.assertEquals("iwenazero", model.baselineAdjustedResult().resultsNotInBaseline().get(0).get(0)); - Assertions - .assertEquals("smzhhkuuipldqqct", model.baselineAdjustedResult().resultsOnlyInBaseline().get(0).get(0)); - Assertions.assertEquals("atvfuzkaftj", model.ruleMetadata().ruleId()); - Assertions.assertEquals(RuleSeverity.HIGH, model.ruleMetadata().severity()); - Assertions.assertEquals("xwigsye", model.ruleMetadata().category()); - Assertions.assertEquals(RuleType.BASELINE_EXPECTED, model.ruleMetadata().ruleType()); - Assertions.assertEquals("smjtgrqgdg", model.ruleMetadata().title()); - Assertions.assertEquals("ileplk", model.ruleMetadata().description()); - Assertions.assertEquals("mknhwtbbaedor", model.ruleMetadata().rationale()); - Assertions.assertEquals("qfloygbdgwum", model.ruleMetadata().queryCheck().query()); - Assertions.assertEquals("hpabgdexjddvjs", model.ruleMetadata().queryCheck().columnNames().get(0)); - Assertions.assertEquals("tm", model.ruleMetadata().benchmarkReferences().get(0).benchmark()); - Assertions.assertEquals("llcolsrsxapte", model.ruleMetadata().benchmarkReferences().get(0).reference()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScanResultProperties model = - new ScanResultProperties() - .withRuleId("tywatmqaq") - .withStatus(RuleStatus.INTERNAL_ERROR) - .withIsTrimmed(false) - .withQueryResults( - Arrays - .asList( - Arrays.asList("eshoygzcb", "fqxkfaoyteh", "puvjmvqmtd", "ckygroejnndljdju"), - Arrays.asList("br"), - Arrays.asList("qyn"))) - .withRemediation( - new Remediation() - .withDescription("ysfaqegplwrysh") - .withScripts(Arrays.asList("kvb")) - .withAutomated(true) - .withPortalLink("usybwptdaca")) - .withBaselineAdjustedResult( - new BaselineAdjustedResult() - .withBaseline( - new Baseline() - .withExpectedResults(Arrays.asList(Arrays.asList())) - .withUpdatedTime(OffsetDateTime.parse("2021-11-02T10:29:39Z"))) - .withStatus(RuleStatus.NON_FINDING) - .withResultsNotInBaseline( - Arrays.asList(Arrays.asList("iwenazero", "zrsq", "lsxkd", "wqapfgsdp"))) - .withResultsOnlyInBaseline( - Arrays - .asList( - Arrays.asList("smzhhkuuipldqqct", "kva", "blhtjq"), - Arrays.asList("yvwehtaemxh"), - Arrays.asList("ysev", "sxivzrrryvei", "ipsk")))) - .withRuleMetadata( - new VaRule() - .withRuleId("atvfuzkaftj") - .withSeverity(RuleSeverity.HIGH) - .withCategory("xwigsye") - .withRuleType(RuleType.BASELINE_EXPECTED) - .withTitle("smjtgrqgdg") - .withDescription("ileplk") - .withRationale("mknhwtbbaedor") - .withQueryCheck( - new QueryCheck() - .withQuery("qfloygbdgwum") - .withExpectedResult(Arrays.asList(Arrays.asList(), Arrays.asList(), Arrays.asList())) - .withColumnNames(Arrays.asList("hpabgdexjddvjs"))) - .withBenchmarkReferences( - Arrays - .asList( - new BenchmarkReference().withBenchmark("tm").withReference("llcolsrsxapte"), - new BenchmarkReference() - .withBenchmark("excgjokjljnhvl") - .withReference("bekpeeksnbksdqhj"), - new BenchmarkReference().withBenchmark("klxesl").withReference("hustcpoqmavnwqjw"), - new BenchmarkReference().withBenchmark("knlejjjkxybwfd").withReference("jbzten")))); - model = BinaryData.fromObject(model).toObject(ScanResultProperties.class); - Assertions.assertEquals("tywatmqaq", model.ruleId()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, model.status()); - Assertions.assertEquals(false, model.isTrimmed()); - Assertions.assertEquals("eshoygzcb", model.queryResults().get(0).get(0)); - Assertions.assertEquals("ysfaqegplwrysh", model.remediation().description()); - Assertions.assertEquals("kvb", model.remediation().scripts().get(0)); - Assertions.assertEquals(true, model.remediation().automated()); - Assertions.assertEquals("usybwptdaca", model.remediation().portalLink()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-11-02T10:29:39Z"), model.baselineAdjustedResult().baseline().updatedTime()); - Assertions.assertEquals(RuleStatus.NON_FINDING, model.baselineAdjustedResult().status()); - Assertions.assertEquals("iwenazero", model.baselineAdjustedResult().resultsNotInBaseline().get(0).get(0)); - Assertions - .assertEquals("smzhhkuuipldqqct", model.baselineAdjustedResult().resultsOnlyInBaseline().get(0).get(0)); - Assertions.assertEquals("atvfuzkaftj", model.ruleMetadata().ruleId()); - Assertions.assertEquals(RuleSeverity.HIGH, model.ruleMetadata().severity()); - Assertions.assertEquals("xwigsye", model.ruleMetadata().category()); - Assertions.assertEquals(RuleType.BASELINE_EXPECTED, model.ruleMetadata().ruleType()); - Assertions.assertEquals("smjtgrqgdg", model.ruleMetadata().title()); - Assertions.assertEquals("ileplk", model.ruleMetadata().description()); - Assertions.assertEquals("mknhwtbbaedor", model.ruleMetadata().rationale()); - Assertions.assertEquals("qfloygbdgwum", model.ruleMetadata().queryCheck().query()); - Assertions.assertEquals("hpabgdexjddvjs", model.ruleMetadata().queryCheck().columnNames().get(0)); - Assertions.assertEquals("tm", model.ruleMetadata().benchmarkReferences().get(0).benchmark()); - Assertions.assertEquals("llcolsrsxapte", model.ruleMetadata().benchmarkReferences().get(0).reference()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultsInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultsInnerTests.java deleted file mode 100644 index 066c735dc66f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScanResultsInnerTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ScanResultInner; -import com.azure.resourcemanager.security.fluent.models.ScanResultsInner; -import com.azure.resourcemanager.security.models.RuleStatus; -import com.azure.resourcemanager.security.models.ScanResultProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScanResultsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScanResultsInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"ruleId\":\"egthortudawl\",\"status\":\"InternalError\",\"isTrimmed\":true,\"queryResults\":[]},\"id\":\"ptcbgqnzmnh\",\"name\":\"ilialwcjgc\",\"type\":\"bbcccgz\"},{\"properties\":{\"ruleId\":\"oxnyuffatsg\",\"status\":\"InternalError\",\"isTrimmed\":true,\"queryResults\":[]},\"id\":\"ubhiqdxyur\",\"name\":\"pnuhzafccnu\",\"type\":\"iig\"}]}") - .toObject(ScanResultsInner.class); - Assertions.assertEquals("egthortudawl", model.value().get(0).properties().ruleId()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, model.value().get(0).properties().status()); - Assertions.assertEquals(true, model.value().get(0).properties().isTrimmed()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScanResultsInner model = - new ScanResultsInner() - .withValue( - Arrays - .asList( - new ScanResultInner() - .withProperties( - new ScanResultProperties() - .withRuleId("egthortudawl") - .withStatus(RuleStatus.INTERNAL_ERROR) - .withIsTrimmed(true) - .withQueryResults(Arrays.asList())), - new ScanResultInner() - .withProperties( - new ScanResultProperties() - .withRuleId("oxnyuffatsg") - .withStatus(RuleStatus.INTERNAL_ERROR) - .withIsTrimmed(true) - .withQueryResults(Arrays.asList())))); - model = BinaryData.fromObject(model).toObject(ScanResultsInner.class); - Assertions.assertEquals("egthortudawl", model.value().get(0).properties().ruleId()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, model.value().get(0).properties().status()); - Assertions.assertEquals(true, model.value().get(0).properties().isTrimmed()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScansInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScansInnerTests.java deleted file mode 100644 index ca8dd95c4abe..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScansInnerTests.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ScanInner; -import com.azure.resourcemanager.security.fluent.models.ScansInner; -import com.azure.resourcemanager.security.models.ScanProperties; -import com.azure.resourcemanager.security.models.ScanState; -import com.azure.resourcemanager.security.models.ScanTriggerType; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ScansInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScansInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"triggerType\":\"Recurring\",\"state\":\"FailedToRun\",\"server\":\"xhqf\",\"database\":\"nvzoqgyipemch\",\"sqlVersion\":\"v\",\"startTime\":\"2021-05-29T11:47:50Z\",\"endTime\":\"2021-06-19T08:23:04Z\",\"highSeverityFailedRulesCount\":734341991,\"mediumSeverityFailedRulesCount\":345092138,\"lowSeverityFailedRulesCount\":791767971,\"totalPassedRulesCount\":1804607166,\"totalFailedRulesCount\":1022480930,\"totalRulesCount\":855952943,\"isBaselineApplied\":true,\"lastScanTime\":\"2021-07-01T01:57:52Z\"},\"id\":\"jjstliuhqawmo\",\"name\":\"ia\",\"type\":\"cz\"}]}") - .toObject(ScansInner.class); - Assertions.assertEquals(ScanTriggerType.RECURRING, model.value().get(0).properties().triggerType()); - Assertions.assertEquals(ScanState.FAILED_TO_RUN, model.value().get(0).properties().state()); - Assertions.assertEquals("xhqf", model.value().get(0).properties().server()); - Assertions.assertEquals("nvzoqgyipemch", model.value().get(0).properties().database()); - Assertions.assertEquals("v", model.value().get(0).properties().sqlVersion()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-05-29T11:47:50Z"), model.value().get(0).properties().startTime()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-06-19T08:23:04Z"), model.value().get(0).properties().endTime()); - Assertions.assertEquals(734341991, model.value().get(0).properties().highSeverityFailedRulesCount()); - Assertions.assertEquals(345092138, model.value().get(0).properties().mediumSeverityFailedRulesCount()); - Assertions.assertEquals(791767971, model.value().get(0).properties().lowSeverityFailedRulesCount()); - Assertions.assertEquals(1804607166, model.value().get(0).properties().totalPassedRulesCount()); - Assertions.assertEquals(1022480930, model.value().get(0).properties().totalFailedRulesCount()); - Assertions.assertEquals(855952943, model.value().get(0).properties().totalRulesCount()); - Assertions.assertEquals(true, model.value().get(0).properties().isBaselineApplied()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-07-01T01:57:52Z"), model.value().get(0).properties().lastScanTime()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScansInner model = - new ScansInner() - .withValue( - Arrays - .asList( - new ScanInner() - .withProperties( - new ScanProperties() - .withTriggerType(ScanTriggerType.RECURRING) - .withState(ScanState.FAILED_TO_RUN) - .withServer("xhqf") - .withDatabase("nvzoqgyipemch") - .withSqlVersion("v") - .withStartTime(OffsetDateTime.parse("2021-05-29T11:47:50Z")) - .withEndTime(OffsetDateTime.parse("2021-06-19T08:23:04Z")) - .withHighSeverityFailedRulesCount(734341991) - .withMediumSeverityFailedRulesCount(345092138) - .withLowSeverityFailedRulesCount(791767971) - .withTotalPassedRulesCount(1804607166) - .withTotalFailedRulesCount(1022480930) - .withTotalRulesCount(855952943) - .withIsBaselineApplied(true) - .withLastScanTime(OffsetDateTime.parse("2021-07-01T01:57:52Z"))))); - model = BinaryData.fromObject(model).toObject(ScansInner.class); - Assertions.assertEquals(ScanTriggerType.RECURRING, model.value().get(0).properties().triggerType()); - Assertions.assertEquals(ScanState.FAILED_TO_RUN, model.value().get(0).properties().state()); - Assertions.assertEquals("xhqf", model.value().get(0).properties().server()); - Assertions.assertEquals("nvzoqgyipemch", model.value().get(0).properties().database()); - Assertions.assertEquals("v", model.value().get(0).properties().sqlVersion()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-05-29T11:47:50Z"), model.value().get(0).properties().startTime()); - Assertions - .assertEquals(OffsetDateTime.parse("2021-06-19T08:23:04Z"), model.value().get(0).properties().endTime()); - Assertions.assertEquals(734341991, model.value().get(0).properties().highSeverityFailedRulesCount()); - Assertions.assertEquals(345092138, model.value().get(0).properties().mediumSeverityFailedRulesCount()); - Assertions.assertEquals(791767971, model.value().get(0).properties().lowSeverityFailedRulesCount()); - Assertions.assertEquals(1804607166, model.value().get(0).properties().totalPassedRulesCount()); - Assertions.assertEquals(1022480930, model.value().get(0).properties().totalFailedRulesCount()); - Assertions.assertEquals(855952943, model.value().get(0).properties().totalRulesCount()); - Assertions.assertEquals(true, model.value().get(0).properties().isBaselineApplied()); - Assertions - .assertEquals( - OffsetDateTime.parse("2021-07-01T01:57:52Z"), model.value().get(0).properties().lastScanTime()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScopeElementTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScopeElementTests.java deleted file mode 100644 index 050808a32ece..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScopeElementTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ScopeElement; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ScopeElementTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScopeElement model = - BinaryData - .fromString( - "{\"field\":\"oldweyuqdu\",\"\":{\"alywjhhgdn\":\"datannrwrbiork\",\"iqndieuzaofj\":\"dataxmsivfomiloxggdu\"}}") - .toObject(ScopeElement.class); - Assertions.assertEquals("oldweyuqdu", model.field()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScopeElement model = new ScopeElement().withField("oldweyuqdu").withAdditionalProperties(mapOf()); - model = BinaryData.fromObject(model).toObject(ScopeElement.class); - Assertions.assertEquals("oldweyuqdu", model.field()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScoreDetailsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScoreDetailsTests.java deleted file mode 100644 index 96bf91b4d011..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ScoreDetailsTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ScoreDetails; - -public final class ScoreDetailsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ScoreDetails model = - BinaryData - .fromString("{\"max\":2043134547,\"current\":65.28047122812333,\"percentage\":41.58485561285469}") - .toObject(ScoreDetails.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ScoreDetails model = new ScoreDetails(); - model = BinaryData.fromObject(model).toObject(ScoreDetails.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionItemInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionItemInnerTests.java deleted file mode 100644 index 831e1f640460..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionItemInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; - -public final class SecureScoreControlDefinitionItemInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreControlDefinitionItemInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"uyturml\",\"description\":\"owolbaui\",\"maxScore\":79221925,\"source\":{\"sourceType\":\"Custom\"},\"assessmentDefinitions\":[{\"id\":\"nw\"},{\"id\":\"gajinnixjawrtmj\"},{\"id\":\"myccx\"},{\"id\":\"hcoxov\"}]},\"id\":\"ekhenl\",\"name\":\"sfnrdtjxt\",\"type\":\"r\"}") - .toObject(SecureScoreControlDefinitionItemInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreControlDefinitionItemInner model = new SecureScoreControlDefinitionItemInner(); - model = BinaryData.fromObject(model).toObject(SecureScoreControlDefinitionItemInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionItemPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionItemPropertiesTests.java deleted file mode 100644 index 7a6e97edd051..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionItemPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemProperties; - -public final class SecureScoreControlDefinitionItemPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreControlDefinitionItemProperties model = - BinaryData - .fromString( - "{\"displayName\":\"qtj\",\"description\":\"dt\",\"maxScore\":695049640,\"source\":{\"sourceType\":\"Custom\"},\"assessmentDefinitions\":[{\"id\":\"jtcvuwkasizies\"},{\"id\":\"ughtuqfecjxeygtu\"}]}") - .toObject(SecureScoreControlDefinitionItemProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreControlDefinitionItemProperties model = new SecureScoreControlDefinitionItemProperties(); - model = BinaryData.fromObject(model).toObject(SecureScoreControlDefinitionItemProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionListTests.java deleted file mode 100644 index fe64a9e8dd8d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionList; - -public final class SecureScoreControlDefinitionListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreControlDefinitionList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"sxjb\",\"description\":\"ehgpdohzjqatu\",\"maxScore\":1160823097,\"assessmentDefinitions\":[]},\"id\":\"bxncnwfepbnw\",\"name\":\"fmxjg\",\"type\":\"g\"},{\"properties\":{\"displayName\":\"gdlfgt\",\"description\":\"snaquf\",\"maxScore\":1011075581,\"assessmentDefinitions\":[]},\"id\":\"q\",\"name\":\"amz\",\"type\":\"rwd\"},{\"properties\":{\"displayName\":\"eqyj\",\"description\":\"zi\",\"maxScore\":1622963422,\"assessmentDefinitions\":[]},\"id\":\"fza\",\"name\":\"tkw\",\"type\":\"eg\"}],\"nextLink\":\"mlbnseq\"}") - .toObject(SecureScoreControlDefinitionList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreControlDefinitionList model = new SecureScoreControlDefinitionList(); - model = BinaryData.fromObject(model).toObject(SecureScoreControlDefinitionList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionSourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionSourceTests.java deleted file mode 100644 index 44bec5b576bc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionSourceTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ControlType; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionSource; -import org.junit.jupiter.api.Assertions; - -public final class SecureScoreControlDefinitionSourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreControlDefinitionSource model = - BinaryData.fromString("{\"sourceType\":\"Custom\"}").toObject(SecureScoreControlDefinitionSource.class); - Assertions.assertEquals(ControlType.CUSTOM, model.sourceType()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreControlDefinitionSource model = - new SecureScoreControlDefinitionSource().withSourceType(ControlType.CUSTOM); - model = BinaryData.fromObject(model).toObject(SecureScoreControlDefinitionSource.class); - Assertions.assertEquals(ControlType.CUSTOM, model.sourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionMockTests.java deleted file mode 100644 index 85272a9cf232..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListBySubscriptionMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionItem; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecureScoreControlDefinitionsListBySubscriptionMockTests { - @Test - public void testListBySubscription() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"ufdmxuq\",\"description\":\"qna\",\"maxScore\":1255416410,\"source\":{\"sourceType\":\"BuiltIn\"},\"assessmentDefinitions\":[]},\"id\":\"q\",\"name\":\"yopbtsixhgvb\",\"type\":\"xmndztgsqjayqmar\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.secureScoreControlDefinitions().listBySubscription(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListMockTests.java deleted file mode 100644 index f6caab929f6c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDefinitionsListMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecureScoreControlDefinitionItem; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecureScoreControlDefinitionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"faofd\",\"description\":\"htncwmhjobzrfp\",\"maxScore\":694063597,\"source\":{\"sourceType\":\"BuiltIn\"},\"assessmentDefinitions\":[]},\"id\":\"f\",\"name\":\"cvbzwgwhgkgsoa\",\"type\":\"oorssatfy\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.secureScoreControlDefinitions().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDetailsInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDetailsInnerTests.java deleted file mode 100644 index 3b84b05baf4c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlDetailsInnerTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDetailsInner; - -public final class SecureScoreControlDetailsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreControlDetailsInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"yefchnm\",\"score\":{\"max\":1660290051,\"current\":18.26434123034213,\"percentage\":71.62987207064346},\"healthyResourceCount\":1375223336,\"unhealthyResourceCount\":1523309198,\"notApplicableResourceCount\":1600818034,\"weight\":4542043090812531924,\"definition\":{\"id\":\"fifhxwrsnew\",\"name\":\"ozqvbubqmam\",\"type\":\"sycxhxzgaz\"}},\"id\":\"taboidvmf\",\"name\":\"hppubowsepdfgkmt\",\"type\":\"herngb\"}") - .toObject(SecureScoreControlDetailsInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreControlDetailsInner model = - new SecureScoreControlDetailsInner().withDefinition(new SecureScoreControlDefinitionItemInner()); - model = BinaryData.fromObject(model).toObject(SecureScoreControlDetailsInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlListTests.java deleted file mode 100644 index d90dc0823add..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecureScoreControlList; - -public final class SecureScoreControlListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreControlList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"ttgplucfotangcf\",\"healthyResourceCount\":1254839089,\"unhealthyResourceCount\":1077682035,\"notApplicableResourceCount\":809427492,\"weight\":4429427229457258180},\"id\":\"wlmzqwmvtxnjmxmc\",\"name\":\"qudtcvclx\",\"type\":\"npdkv\"},{\"properties\":{\"displayName\":\"buiyji\",\"healthyResourceCount\":874901455,\"unhealthyResourceCount\":203185987,\"notApplicableResourceCount\":1296462428,\"weight\":7170232891344779001},\"id\":\"n\",\"name\":\"gox\",\"type\":\"jiuqhibtozi\"},{\"properties\":{\"displayName\":\"jedmurrxxgewp\",\"healthyResourceCount\":1212082891,\"unhealthyResourceCount\":538601125,\"notApplicableResourceCount\":1264888765,\"weight\":1955127853962585170},\"id\":\"yhlfb\",\"name\":\"gwgcl\",\"type\":\"xoe\"},{\"properties\":{\"displayName\":\"njipnwjfujql\",\"healthyResourceCount\":1462565656,\"unhealthyResourceCount\":1454671377,\"notApplicableResourceCount\":295372470,\"weight\":5131304404617914310},\"id\":\"o\",\"name\":\"yjwpfilkmkkh\",\"type\":\"l\"}],\"nextLink\":\"ndviauogphuartvt\"}") - .toObject(SecureScoreControlList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreControlList model = new SecureScoreControlList(); - model = BinaryData.fromObject(model).toObject(SecureScoreControlList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlScoreDetailsInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlScoreDetailsInnerTests.java deleted file mode 100644 index b36dd984ddfd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlScoreDetailsInnerTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlDefinitionItemInner; -import com.azure.resourcemanager.security.fluent.models.SecureScoreControlScoreDetailsInner; - -public final class SecureScoreControlScoreDetailsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreControlScoreDetailsInner model = - BinaryData - .fromString( - "{\"displayName\":\"juahokqto\",\"score\":{\"max\":1988457044,\"current\":94.1893284512417,\"percentage\":92.7505349749972},\"healthyResourceCount\":2026561686,\"unhealthyResourceCount\":738753621,\"notApplicableResourceCount\":1258179211,\"weight\":3760605119106572940,\"definition\":{\"properties\":{\"displayName\":\"e\",\"description\":\"whslwkoj\",\"maxScore\":157420871,\"assessmentDefinitions\":[]},\"id\":\"pdwrpqafgfugsn\",\"name\":\"fhyete\",\"type\":\"ypococtfjgtixr\"}}") - .toObject(SecureScoreControlScoreDetailsInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreControlScoreDetailsInner model = - new SecureScoreControlScoreDetailsInner().withDefinition(new SecureScoreControlDefinitionItemInner()); - model = BinaryData.fromObject(model).toObject(SecureScoreControlScoreDetailsInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreMockTests.java deleted file mode 100644 index 125c42d66169..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListBySecureScoreMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ExpandControlsEnum; -import com.azure.resourcemanager.security.models.SecureScoreControlDetails; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecureScoreControlsListBySecureScoreMockTests { - @Test - public void testListBySecureScore() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"nmtsdixc\",\"score\":{\"max\":960368157,\"current\":2.0148335508080595,\"percentage\":32.94154583908292},\"healthyResourceCount\":653289494,\"unhealthyResourceCount\":623500871,\"notApplicableResourceCount\":807131676,\"weight\":7585046270567652176,\"definition\":{\"id\":\"qzoof\",\"name\":\"nqjsvepfbhtleber\",\"type\":\"yljeknfqnwjjqx\"}},\"id\":\"wkdnjrxgkrhwiehy\",\"name\":\"pnowawonoehrguql\",\"type\":\"fwafbjz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .secureScoreControls() - .listBySecureScore("lxvhhyqqegatxgrz", ExpandControlsEnum.DEFINITION, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListMockTests.java deleted file mode 100644 index 01ab051c1a6b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreControlsListMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ExpandControlsEnum; -import com.azure.resourcemanager.security.models.SecureScoreControlDetails; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecureScoreControlsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"guyfazbkocbygvt\",\"score\":{\"max\":106120688,\"current\":11.396655943253176,\"percentage\":58.146251073289655},\"healthyResourceCount\":1344169378,\"unhealthyResourceCount\":1548281648,\"notApplicableResourceCount\":341199959,\"weight\":7359298779721457095,\"definition\":{\"id\":\"boozflyacagaed\",\"name\":\"oiqclmgdtwgab\",\"type\":\"xfkuzbw\"}},\"id\":\"ecooyvhtuqbp\",\"name\":\"lniibncg\",\"type\":\"gdvcdqhftz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.secureScoreControls().list(ExpandControlsEnum.DEFINITION, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreItemInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreItemInnerTests.java deleted file mode 100644 index 7f5199ec222e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreItemInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreItemInner; - -public final class SecureScoreItemInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreItemInner model = - BinaryData - .fromString( - "{\"properties\":{\"displayName\":\"zhrgmqgjsxvpqc\",\"score\":{\"max\":1162167874,\"current\":21.586870005444514,\"percentage\":87.20432974466105},\"weight\":4486642012912512601},\"id\":\"vriibakclacjfr\",\"name\":\"xousxauzl\",\"type\":\"vsg\"}") - .toObject(SecureScoreItemInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreItemInner model = new SecureScoreItemInner(); - model = BinaryData.fromObject(model).toObject(SecureScoreItemInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreItemPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreItemPropertiesTests.java deleted file mode 100644 index 357428e2c5f3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoreItemPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecureScoreItemProperties; - -public final class SecureScoreItemPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoreItemProperties model = - BinaryData - .fromString( - "{\"displayName\":\"ohqfzizv\",\"score\":{\"max\":290394700,\"current\":79.43221808867246,\"percentage\":47.38718025336222},\"weight\":6456868144716407636}") - .toObject(SecureScoreItemProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoreItemProperties model = new SecureScoreItemProperties(); - model = BinaryData.fromObject(model).toObject(SecureScoreItemProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresGetWithResponseMockTests.java deleted file mode 100644 index 1fe1467db04d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresGetWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecureScoreItem; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecureScoresGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"trvrkpsab\",\"score\":{\"max\":690664463,\"current\":1.6527198888620198,\"percentage\":57.52426811501905},\"weight\":3311361133230112709},\"id\":\"lpyeu\",\"name\":\"kppdi\",\"type\":\"qb\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecureScoreItem response = - manager.secureScores().getWithResponse("qutibhl", com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresListMockTests.java deleted file mode 100644 index cab843af5c77..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecureScoreItem; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecureScoresListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"xezm\",\"score\":{\"max\":2036050921,\"current\":41.86944000776085,\"percentage\":66.66233527644464},\"weight\":8245136712632811415},\"id\":\"lokfpmijpdvzv\",\"name\":\"bhwbdqufvcgnrgla\",\"type\":\"rwyambhbafebzxfk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.secureScores().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresListTests.java deleted file mode 100644 index ba1e9c2e6c89..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecureScoresListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecureScoresList; - -public final class SecureScoresListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecureScoresList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"xylrjvmtygjbmz\",\"weight\":1881344816801364450},\"id\":\"p\",\"name\":\"hckfkyjpmspbps\",\"type\":\"df\"},{\"properties\":{\"displayName\":\"ogtieyujtvczkcny\",\"weight\":5566612740154232869},\"id\":\"njdxvglnkvxl\",\"name\":\"paglqivbgk\",\"type\":\"vkhpzvuqdflvo\"},{\"properties\":{\"displayName\":\"pfpubcpzgpx\",\"weight\":206022069404310786},\"id\":\"knidib\",\"name\":\"qjxgpnrhgovfgp\",\"type\":\"kqmhhaowjr\"},{\"properties\":{\"displayName\":\"uporqzdfu\",\"weight\":9046409945705320802},\"id\":\"fvxcnqmxqpswo\",\"name\":\"mvkhlggd\",\"type\":\"bemzqkzszuwi\"}],\"nextLink\":\"glxxhljfpgpic\"}") - .toObject(SecureScoresList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecureScoresList model = new SecureScoresList(); - model = BinaryData.fromObject(model).toObject(SecureScoresList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentListTests.java deleted file mode 100644 index 85b0a4cc17e7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecurityAssessmentList; - -public final class SecurityAssessmentListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityAssessmentList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"displayName\":\"clnpkci\",\"additionalData\":{}},\"id\":\"ykhyawfvjlboxqvk\",\"name\":\"lmxhomdyn\",\"type\":\"dwdigumb\"},{\"properties\":{\"displayName\":\"auzzptjazysd\",\"additionalData\":{}},\"id\":\"wva\",\"name\":\"qyuvvfonkp\",\"type\":\"hqyikvy\"},{\"properties\":{\"displayName\":\"yavluwmncstt\",\"additionalData\":{}},\"id\":\"vpo\",\"name\":\"krsgsgb\",\"type\":\"huzqgn\"},{\"properties\":{\"displayName\":\"kynscliqhzv\",\"additionalData\":{}},\"id\":\"mtk\",\"name\":\"bo\",\"type\":\"ppnvdxz\"}],\"nextLink\":\"ihfrbbcevqa\"}") - .toObject(SecurityAssessmentList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityAssessmentList model = new SecurityAssessmentList(); - model = BinaryData.fromObject(model).toObject(SecurityAssessmentList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataPropertiesResponsePublishDatesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataPropertiesResponsePublishDatesTests.java deleted file mode 100644 index e8d5fae353e2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataPropertiesResponsePublishDatesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates; -import org.junit.jupiter.api.Assertions; - -public final class SecurityAssessmentMetadataPropertiesResponsePublishDatesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityAssessmentMetadataPropertiesResponsePublishDates model = - BinaryData - .fromString("{\"GA\":\"f\",\"public\":\"ztcktyh\"}") - .toObject(SecurityAssessmentMetadataPropertiesResponsePublishDates.class); - Assertions.assertEquals("f", model.ga()); - Assertions.assertEquals("ztcktyh", model.publicProperty()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityAssessmentMetadataPropertiesResponsePublishDates model = - new SecurityAssessmentMetadataPropertiesResponsePublishDates().withGa("f").withPublicProperty("ztcktyh"); - model = BinaryData.fromObject(model).toObject(SecurityAssessmentMetadataPropertiesResponsePublishDates.class); - Assertions.assertEquals("f", model.ga()); - Assertions.assertEquals("ztcktyh", model.publicProperty()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataResponseListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataResponseListTests.java deleted file mode 100644 index 00ad2c778bc0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityAssessmentMetadataResponseListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataResponseList; - -public final class SecurityAssessmentMetadataResponseListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityAssessmentMetadataResponseList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"plannedDeprecationDate\":\"fnynszqujizdvoqy\",\"tactics\":[],\"techniques\":[],\"displayName\":\"yo\",\"policyDefinitionId\":\"blgyavutpthj\",\"description\":\"oismsksbpimlqol\",\"remediationDescription\":\"kcgxxlxsffgcvi\",\"categories\":[],\"severity\":\"Low\",\"userImpact\":\"Low\",\"implementationEffort\":\"Low\",\"threats\":[],\"preview\":true,\"assessmentType\":\"CustomPolicy\"},\"id\":\"pfgfbkjub\",\"name\":\"yhgk\",\"type\":\"minsgowzf\"},{\"properties\":{\"plannedDeprecationDate\":\"t\",\"tactics\":[],\"techniques\":[],\"displayName\":\"ahbqactxtgzuk\",\"policyDefinitionId\":\"tmmqtgqqqxhrn\",\"description\":\"xcpjuisavokqdzf\",\"remediationDescription\":\"zivj\",\"categories\":[],\"severity\":\"Medium\",\"userImpact\":\"High\",\"implementationEffort\":\"Moderate\",\"threats\":[],\"preview\":true,\"assessmentType\":\"CustomPolicy\"},\"id\":\"tnwxy\",\"name\":\"opidkqqfkuv\",\"type\":\"cxkdmligovi\"},{\"properties\":{\"plannedDeprecationDate\":\"pmloazuruoc\",\"tactics\":[],\"techniques\":[],\"displayName\":\"orbteoy\",\"policyDefinitionId\":\"hjxa\",\"description\":\"vjgsl\",\"remediationDescription\":\"dilmyww\",\"categories\":[],\"severity\":\"Medium\",\"userImpact\":\"Low\",\"implementationEffort\":\"Low\",\"threats\":[],\"preview\":false,\"assessmentType\":\"BuiltIn\"},\"id\":\"yvudtjuewbci\",\"name\":\"xuuwhcj\",\"type\":\"xccybvpa\"},{\"properties\":{\"plannedDeprecationDate\":\"udzpxgwjplmagstc\",\"tactics\":[],\"techniques\":[],\"displayName\":\"pfkyrkdbdgiogsj\",\"policyDefinitionId\":\"nwqjnoba\",\"description\":\"hdd\",\"remediationDescription\":\"acegfnmntf\",\"categories\":[],\"severity\":\"Low\",\"userImpact\":\"Low\",\"implementationEffort\":\"Low\",\"threats\":[],\"preview\":true,\"assessmentType\":\"CustomPolicy\"},\"id\":\"vvbalx\",\"name\":\"l\",\"type\":\"chp\"}],\"nextLink\":\"bzevwrd\"}") - .toObject(SecurityAssessmentMetadataResponseList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityAssessmentMetadataResponseList model = new SecurityAssessmentMetadataResponseList(); - model = BinaryData.fromObject(model).toObject(SecurityAssessmentMetadataResponseList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 6010b57722cf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.fluent.models.ApplicationInner; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorApplicationOperationsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"do\",\"description\":\"fzdgjfcycrsvloy\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"datagqkzjuqw\",\"dataajquzxpixhyoi\",\"datanfdbgsoscienezf\"]},\"id\":\"bennmfkbp\",\"name\":\"nrtekw\",\"type\":\"nthropmdudsyiu\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Application response = - manager - .securityConnectorApplicationOperations() - .createOrUpdateWithResponse( - "xplhpeva", - "yntvzjyielbq", - "vvbq", - new ApplicationInner() - .withDisplayName("mpe") - .withDescription("xgiqasifubn") - .withSourceResourceType(ApplicationSourceResourceType.ASSESSMENTS) - .withConditionSets(Arrays.asList("datatlpwqpjnxjkhtups", "datayo")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("do", response.displayName()); - Assertions.assertEquals("fzdgjfcycrsvloy", response.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, response.sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsDeleteWithResponseMockTests.java deleted file mode 100644 index 79ac1e156e35..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorApplicationOperationsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .securityConnectorApplicationOperations() - .deleteWithResponse("ztvktjhffecqko", "youergaghp", "zxkpyehhfdyld", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsGetWithResponseMockTests.java deleted file mode 100644 index 9e78bb598680..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationOperationsGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorApplicationOperationsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"displayName\":\"gtqcumecsaaqgoq\",\"description\":\"iuycsbskowk\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"datazhrbkhtmqo\",\"dataiuasfgq\",\"dataucyhfaimq\"]},\"id\":\"druozk\",\"name\":\"yfpeoehgfmqmsk\",\"type\":\"ixvlz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Application response = - manager - .securityConnectorApplicationOperations() - .getWithResponse("hydt", "aczkf", "fatgawphnski", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("gtqcumecsaaqgoq", response.displayName()); - Assertions.assertEquals("iuycsbskowk", response.description()); - Assertions.assertEquals(ApplicationSourceResourceType.ASSESSMENTS, response.sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListMockTests.java deleted file mode 100644 index 7441975744f6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorApplicationsListMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Application; -import com.azure.resourcemanager.security.models.ApplicationSourceResourceType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorApplicationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"displayName\":\"stifgufyjf\",\"description\":\"qiyv\",\"sourceResourceType\":\"Assessments\",\"conditionSets\":[\"dataokgw\",\"datasymzqhrqpf\",\"datalpe\"]},\"id\":\"tznxlu\",\"name\":\"aujqbbgsimwejlwb\",\"type\":\"bpjzobdwbcpraswk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.securityConnectorApplications().list("izzn", "uf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("stifgufyjf", response.iterator().next().displayName()); - Assertions.assertEquals("qiyv", response.iterator().next().description()); - Assertions - .assertEquals(ApplicationSourceResourceType.ASSESSMENTS, response.iterator().next().sourceResourceType()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorInnerTests.java deleted file mode 100644 index d68fa2bcb46b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorInnerTests.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.CloudOffering; -import com.azure.resourcemanager.security.models.EnvironmentData; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SecurityConnectorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityConnectorInner model = - BinaryData - .fromString( - "{\"properties\":{\"hierarchyIdentifier\":\"vbrzcdb\",\"hierarchyIdentifierTrialEndDate\":\"2021-09-14T13:57:27Z\",\"environmentName\":\"Github\",\"offerings\":[{\"offeringType\":\"CloudOffering\",\"description\":\"xmxeatkdb\"},{\"offeringType\":\"CloudOffering\",\"description\":\"nrd\"}],\"environmentData\":{\"environmentType\":\"EnvironmentData\"}},\"location\":\"ibqbnaomhjrm\",\"tags\":{\"obcancdexxqcw\":\"maxljalfihcj\",\"fgvaknokzwj\":\"a\",\"tpq\":\"zrltixldzyyf\"},\"id\":\"ixymmpujivyql\",\"name\":\"juvsmbmslzoyovw\",\"type\":\"dbpqvybefgvm\"}") - .toObject(SecurityConnectorInner.class); - Assertions.assertEquals("ibqbnaomhjrm", model.location()); - Assertions.assertEquals("maxljalfihcj", model.tags().get("obcancdexxqcw")); - Assertions.assertEquals("vbrzcdb", model.hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GITHUB, model.environmentName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityConnectorInner model = - new SecurityConnectorInner() - .withLocation("ibqbnaomhjrm") - .withTags(mapOf("obcancdexxqcw", "maxljalfihcj", "fgvaknokzwj", "a", "tpq", "zrltixldzyyf")) - .withHierarchyIdentifier("vbrzcdb") - .withEnvironmentName(CloudName.GITHUB) - .withOfferings(Arrays.asList(new CloudOffering(), new CloudOffering())) - .withEnvironmentData(new EnvironmentData()); - model = BinaryData.fromObject(model).toObject(SecurityConnectorInner.class); - Assertions.assertEquals("ibqbnaomhjrm", model.location()); - Assertions.assertEquals("maxljalfihcj", model.tags().get("obcancdexxqcw")); - Assertions.assertEquals("vbrzcdb", model.hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GITHUB, model.environmentName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorPropertiesTests.java deleted file mode 100644 index 5fdc1aa8caaa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorProperties; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.CloudOffering; -import com.azure.resourcemanager.security.models.EnvironmentData; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecurityConnectorPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityConnectorProperties model = - BinaryData - .fromString( - "{\"hierarchyIdentifier\":\"okcvtlubses\",\"hierarchyIdentifierTrialEndDate\":\"2021-01-02T05:52:53Z\",\"environmentName\":\"GCP\",\"offerings\":[{\"offeringType\":\"CloudOffering\",\"description\":\"hunlpirykycnd\"}],\"environmentData\":{\"environmentType\":\"EnvironmentData\"}}") - .toObject(SecurityConnectorProperties.class); - Assertions.assertEquals("okcvtlubses", model.hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GCP, model.environmentName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityConnectorProperties model = - new SecurityConnectorProperties() - .withHierarchyIdentifier("okcvtlubses") - .withEnvironmentName(CloudName.GCP) - .withOfferings(Arrays.asList(new CloudOffering())) - .withEnvironmentData(new EnvironmentData()); - model = BinaryData.fromObject(model).toObject(SecurityConnectorProperties.class); - Assertions.assertEquals("okcvtlubses", model.hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GCP, model.environmentName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 3712030dd800..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.EnvironmentData; -import com.azure.resourcemanager.security.models.SecurityConnector; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"hierarchyIdentifier\":\"m\",\"hierarchyIdentifierTrialEndDate\":\"2021-06-20T07:23:24Z\",\"environmentName\":\"AWS\",\"offerings\":[],\"environmentData\":{\"environmentType\":\"EnvironmentData\"}},\"location\":\"rpvsgloiovs\",\"tags\":{\"suvw\":\"v\",\"i\":\"enbg\",\"oa\":\"pkhc\"},\"id\":\"xukuicjuftekio\",\"name\":\"anduew\",\"type\":\"hvpxjhxz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityConnector response = - manager - .securityConnectors() - .define("qpqsdoctpzpuj") - .withRegion("hfwlfxzfwugeup") - .withExistingResourceGroup("krjflsgaojb") - .withTags(mapOf("sytqpdzfyxcnwawo", "ecexkgrvfpsjdmn", "bejqfbifopfjx", "cg", "q", "wdrpa")) - .withHierarchyIdentifier("cdsgxceluji") - .withEnvironmentName(CloudName.AWS) - .withOfferings(Arrays.asList()) - .withEnvironmentData(new EnvironmentData()) - .create(); - - Assertions.assertEquals("rpvsgloiovs", response.location()); - Assertions.assertEquals("v", response.tags().get("suvw")); - Assertions.assertEquals("m", response.hierarchyIdentifier()); - Assertions.assertEquals(CloudName.AWS, response.environmentName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index bab7d8838a8b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .securityConnectors() - .deleteByResourceGroupWithResponse("hoksmmculwk", "icruo", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 11366a0154c5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.SecurityConnector; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"hierarchyIdentifier\":\"j\",\"hierarchyIdentifierTrialEndDate\":\"2021-02-19T19:03:45Z\",\"environmentName\":\"GitLab\",\"offerings\":[],\"environmentData\":{\"environmentType\":\"EnvironmentData\"}},\"location\":\"fcjis\",\"tags\":{\"ampqocl\":\"dbxotfb\"},\"id\":\"nnmxynlsuqbwzstr\",\"name\":\"tgvpatr\",\"type\":\"jjktfin\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityConnector response = - manager - .securityConnectors() - .getByResourceGroupWithResponse("rrxyxwjezbfqpl", "yuekdcpvuftrsvjm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("fcjis", response.location()); - Assertions.assertEquals("dbxotfb", response.tags().get("ampqocl")); - Assertions.assertEquals("j", response.hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GIT_LAB, response.environmentName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupMockTests.java deleted file mode 100644 index ba8160f90997..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListByResourceGroupMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.SecurityConnector; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"hierarchyIdentifier\":\"ylblfsprr\",\"hierarchyIdentifierTrialEndDate\":\"2021-06-27T02:59:42Z\",\"environmentName\":\"GitLab\",\"offerings\":[],\"environmentData\":{\"environmentType\":\"EnvironmentData\"}},\"location\":\"vvfxrdytzfsl\",\"tags\":{\"mcdiiisk\":\"hqikmgobliq\",\"vtrkfkg\":\"bonxxupj\"},\"id\":\"njqnnpjwkosny\",\"name\":\"igfoujjcxgdqmr\",\"type\":\"hnzkwopswnyinxu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.securityConnectors().listByResourceGroup("qshixbc", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("vvfxrdytzfsl", response.iterator().next().location()); - Assertions.assertEquals("hqikmgobliq", response.iterator().next().tags().get("mcdiiisk")); - Assertions.assertEquals("ylblfsprr", response.iterator().next().hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GIT_LAB, response.iterator().next().environmentName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListMockTests.java deleted file mode 100644 index 071bb6609f0d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.SecurityConnector; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityConnectorsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"hierarchyIdentifier\":\"pgarpfctw\",\"hierarchyIdentifierTrialEndDate\":\"2021-09-18T04:03Z\",\"environmentName\":\"GCP\",\"offerings\":[],\"environmentData\":{\"environmentType\":\"EnvironmentData\"}},\"location\":\"qyvzesipiysnjq\",\"tags\":{\"ewkaupwhl\":\"aadcndazabundt\",\"sirxxhyr\":\"yckremgjlmsvdo\"},\"id\":\"qakofajf\",\"name\":\"epr\",\"type\":\"vmkinwtey\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.securityConnectors().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("qyvzesipiysnjq", response.iterator().next().location()); - Assertions.assertEquals("aadcndazabundt", response.iterator().next().tags().get("ewkaupwhl")); - Assertions.assertEquals("pgarpfctw", response.iterator().next().hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GCP, response.iterator().next().environmentName()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListTests.java deleted file mode 100644 index afab1e1e80a5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityConnectorsListTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityConnectorInner; -import com.azure.resourcemanager.security.models.CloudName; -import com.azure.resourcemanager.security.models.SecurityConnectorsList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SecurityConnectorsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityConnectorsList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"hierarchyIdentifier\":\"ifrkgwltxeqipx\",\"hierarchyIdentifierTrialEndDate\":\"2021-05-11T17:28:43Z\",\"environmentName\":\"GCP\",\"offerings\":[]},\"location\":\"fayorpravkjoges\",\"tags\":{\"kvwjtqpkevmy\":\"nsmjkwynqxaekqs\",\"gxannnoytzposewx\":\"tjcrspxklurccl\",\"dfaifyzyzeyuube\":\"gpxvkqmaupxvpi\",\"l\":\"ds\"},\"id\":\"ytoithgygvfl\",\"name\":\"gvdihoynkrxwetwk\",\"type\":\"rcyrucpcunnu\"},{\"properties\":{\"hierarchyIdentifier\":\"moenodnaien\",\"hierarchyIdentifierTrialEndDate\":\"2021-09-25T15:40:50Z\",\"environmentName\":\"GCP\",\"offerings\":[]},\"location\":\"nelqkaadl\",\"tags\":{\"vcnrly\":\"foanniyopetx\"},\"id\":\"nucaephblkwqpat\",\"name\":\"bqsdtcjbctvi\",\"type\":\"uzqymtuowog\"}],\"nextLink\":\"it\"}") - .toObject(SecurityConnectorsList.class); - Assertions.assertEquals("fayorpravkjoges", model.value().get(0).location()); - Assertions.assertEquals("nsmjkwynqxaekqs", model.value().get(0).tags().get("kvwjtqpkevmy")); - Assertions.assertEquals("ifrkgwltxeqipx", model.value().get(0).hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GCP, model.value().get(0).environmentName()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityConnectorsList model = - new SecurityConnectorsList() - .withValue( - Arrays - .asList( - new SecurityConnectorInner() - .withLocation("fayorpravkjoges") - .withTags( - mapOf( - "kvwjtqpkevmy", - "nsmjkwynqxaekqs", - "gxannnoytzposewx", - "tjcrspxklurccl", - "dfaifyzyzeyuube", - "gpxvkqmaupxvpi", - "l", - "ds")) - .withHierarchyIdentifier("ifrkgwltxeqipx") - .withEnvironmentName(CloudName.GCP) - .withOfferings(Arrays.asList()), - new SecurityConnectorInner() - .withLocation("nelqkaadl") - .withTags(mapOf("vcnrly", "foanniyopetx")) - .withHierarchyIdentifier("moenodnaien") - .withEnvironmentName(CloudName.GCP) - .withOfferings(Arrays.asList()))); - model = BinaryData.fromObject(model).toObject(SecurityConnectorsList.class); - Assertions.assertEquals("fayorpravkjoges", model.value().get(0).location()); - Assertions.assertEquals("nsmjkwynqxaekqs", model.value().get(0).tags().get("kvwjtqpkevmy")); - Assertions.assertEquals("ifrkgwltxeqipx", model.value().get(0).hierarchyIdentifier()); - Assertions.assertEquals(CloudName.GCP, model.value().get(0).environmentName()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactInnerTests.java deleted file mode 100644 index 4a7336f59c21..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityContactInner; -import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.Roles; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import com.azure.resourcemanager.security.models.State; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecurityContactInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityContactInner model = - BinaryData - .fromString( - "{\"properties\":{\"emails\":\"swe\",\"phone\":\"qwdxggicc\",\"alertNotifications\":{\"state\":\"Failed\",\"minimalSeverity\":\"High\"},\"notificationsByRole\":{\"state\":\"Unsupported\",\"roles\":[\"Owner\",\"Owner\",\"Contributor\",\"AccountAdmin\"]}},\"id\":\"vlz\",\"name\":\"wem\",\"type\":\"zrncsdt\"}") - .toObject(SecurityContactInner.class); - Assertions.assertEquals("swe", model.emails()); - Assertions.assertEquals("qwdxggicc", model.phone()); - Assertions.assertEquals(State.FAILED, model.alertNotifications().state()); - Assertions.assertEquals(MinimalSeverity.HIGH, model.alertNotifications().minimalSeverity()); - Assertions.assertEquals(State.UNSUPPORTED, model.notificationsByRole().state()); - Assertions.assertEquals(Roles.OWNER, model.notificationsByRole().roles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityContactInner model = - new SecurityContactInner() - .withEmails("swe") - .withPhone("qwdxggicc") - .withAlertNotifications( - new SecurityContactPropertiesAlertNotifications() - .withState(State.FAILED) - .withMinimalSeverity(MinimalSeverity.HIGH)) - .withNotificationsByRole( - new SecurityContactPropertiesNotificationsByRole() - .withState(State.UNSUPPORTED) - .withRoles(Arrays.asList(Roles.OWNER, Roles.OWNER, Roles.CONTRIBUTOR, Roles.ACCOUNT_ADMIN))); - model = BinaryData.fromObject(model).toObject(SecurityContactInner.class); - Assertions.assertEquals("swe", model.emails()); - Assertions.assertEquals("qwdxggicc", model.phone()); - Assertions.assertEquals(State.FAILED, model.alertNotifications().state()); - Assertions.assertEquals(MinimalSeverity.HIGH, model.alertNotifications().minimalSeverity()); - Assertions.assertEquals(State.UNSUPPORTED, model.notificationsByRole().state()); - Assertions.assertEquals(Roles.OWNER, model.notificationsByRole().roles().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactListTests.java deleted file mode 100644 index 9a52c5ef4a59..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecurityContactList; - -public final class SecurityContactListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityContactList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"emails\":\"ux\",\"phone\":\"q\"},\"id\":\"syuuximerq\",\"name\":\"obwyznkb\",\"type\":\"kutwpf\"},{\"properties\":{\"emails\":\"gmhrskdsnfdsdoak\",\"phone\":\"dlmkkzevdl\"},\"id\":\"pusdstt\",\"name\":\"vogvbbejdcngqqmo\",\"type\":\"kufgmj\"},{\"properties\":{\"emails\":\"rdgrtw\",\"phone\":\"nuuzkopbm\"},\"id\":\"fdwoyuhh\",\"name\":\"iuiefozbhdmsm\",\"type\":\"mzqhoftrmaequi\"},{\"properties\":{\"emails\":\"icslfaoq\",\"phone\":\"iyylhalnswhccsp\"},\"id\":\"ivwitqscywugg\",\"name\":\"oluhczbwemh\",\"type\":\"i\"}],\"nextLink\":\"brgz\"}") - .toObject(SecurityContactList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityContactList model = new SecurityContactList(); - model = BinaryData.fromObject(model).toObject(SecurityContactList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesAlertNotificationsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesAlertNotificationsTests.java deleted file mode 100644 index adc37550902f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesAlertNotificationsTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; -import com.azure.resourcemanager.security.models.State; -import org.junit.jupiter.api.Assertions; - -public final class SecurityContactPropertiesAlertNotificationsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityContactPropertiesAlertNotifications model = - BinaryData - .fromString("{\"state\":\"Passed\",\"minimalSeverity\":\"Medium\"}") - .toObject(SecurityContactPropertiesAlertNotifications.class); - Assertions.assertEquals(State.PASSED, model.state()); - Assertions.assertEquals(MinimalSeverity.MEDIUM, model.minimalSeverity()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityContactPropertiesAlertNotifications model = - new SecurityContactPropertiesAlertNotifications() - .withState(State.PASSED) - .withMinimalSeverity(MinimalSeverity.MEDIUM); - model = BinaryData.fromObject(model).toObject(SecurityContactPropertiesAlertNotifications.class); - Assertions.assertEquals(State.PASSED, model.state()); - Assertions.assertEquals(MinimalSeverity.MEDIUM, model.minimalSeverity()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesNotificationsByRoleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesNotificationsByRoleTests.java deleted file mode 100644 index a0571dec6ede..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesNotificationsByRoleTests.java +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Roles; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import com.azure.resourcemanager.security.models.State; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecurityContactPropertiesNotificationsByRoleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityContactPropertiesNotificationsByRole model = - BinaryData - .fromString("{\"state\":\"Failed\",\"roles\":[\"Contributor\"]}") - .toObject(SecurityContactPropertiesNotificationsByRole.class); - Assertions.assertEquals(State.FAILED, model.state()); - Assertions.assertEquals(Roles.CONTRIBUTOR, model.roles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityContactPropertiesNotificationsByRole model = - new SecurityContactPropertiesNotificationsByRole() - .withState(State.FAILED) - .withRoles(Arrays.asList(Roles.CONTRIBUTOR)); - model = BinaryData.fromObject(model).toObject(SecurityContactPropertiesNotificationsByRole.class); - Assertions.assertEquals(State.FAILED, model.state()); - Assertions.assertEquals(Roles.CONTRIBUTOR, model.roles().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesTests.java deleted file mode 100644 index a8a0de5f1a63..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactPropertiesTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityContactProperties; -import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.Roles; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import com.azure.resourcemanager.security.models.State; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecurityContactPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityContactProperties model = - BinaryData - .fromString( - "{\"emails\":\"u\",\"phone\":\"ypbsfgytguslfead\",\"alertNotifications\":{\"state\":\"Skipped\",\"minimalSeverity\":\"High\"},\"notificationsByRole\":{\"state\":\"Failed\",\"roles\":[\"AccountAdmin\"]}}") - .toObject(SecurityContactProperties.class); - Assertions.assertEquals("u", model.emails()); - Assertions.assertEquals("ypbsfgytguslfead", model.phone()); - Assertions.assertEquals(State.SKIPPED, model.alertNotifications().state()); - Assertions.assertEquals(MinimalSeverity.HIGH, model.alertNotifications().minimalSeverity()); - Assertions.assertEquals(State.FAILED, model.notificationsByRole().state()); - Assertions.assertEquals(Roles.ACCOUNT_ADMIN, model.notificationsByRole().roles().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityContactProperties model = - new SecurityContactProperties() - .withEmails("u") - .withPhone("ypbsfgytguslfead") - .withAlertNotifications( - new SecurityContactPropertiesAlertNotifications() - .withState(State.SKIPPED) - .withMinimalSeverity(MinimalSeverity.HIGH)) - .withNotificationsByRole( - new SecurityContactPropertiesNotificationsByRole() - .withState(State.FAILED) - .withRoles(Arrays.asList(Roles.ACCOUNT_ADMIN))); - model = BinaryData.fromObject(model).toObject(SecurityContactProperties.class); - Assertions.assertEquals("u", model.emails()); - Assertions.assertEquals("ypbsfgytguslfead", model.phone()); - Assertions.assertEquals(State.SKIPPED, model.alertNotifications().state()); - Assertions.assertEquals(MinimalSeverity.HIGH, model.alertNotifications().minimalSeverity()); - Assertions.assertEquals(State.FAILED, model.notificationsByRole().state()); - Assertions.assertEquals(Roles.ACCOUNT_ADMIN, model.notificationsByRole().roles().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateWithResponseMockTests.java deleted file mode 100644 index 99fb2a74c579..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsCreateWithResponseMockTests.java +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.SecurityContact; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesAlertNotifications; -import com.azure.resourcemanager.security.models.SecurityContactPropertiesNotificationsByRole; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityContactsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"emails\":\"ezacfpztga\",\"phone\":\"yqejga\",\"alertNotifications\":{\"state\":\"Unsupported\",\"minimalSeverity\":\"High\"},\"notificationsByRole\":{\"state\":\"Unsupported\",\"roles\":[]}},\"id\":\"kqzkcyzmff\",\"name\":\"gdyfcixrhlcqvhoe\",\"type\":\"goiutgw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityContact response = - manager - .securityContacts() - .define("nzsieuscplh") - .withEmails("gxlyzkxitdshezs") - .withPhone("olrupjovm") - .withAlertNotifications( - new SecurityContactPropertiesAlertNotifications() - .withState(State.PASSED) - .withMinimalSeverity(MinimalSeverity.MEDIUM)) - .withNotificationsByRole( - new SecurityContactPropertiesNotificationsByRole() - .withState(State.UNSUPPORTED) - .withRoles(Arrays.asList())) - .create(); - - Assertions.assertEquals("ezacfpztga", response.emails()); - Assertions.assertEquals("yqejga", response.phone()); - Assertions.assertEquals(State.UNSUPPORTED, response.alertNotifications().state()); - Assertions.assertEquals(MinimalSeverity.HIGH, response.alertNotifications().minimalSeverity()); - Assertions.assertEquals(State.UNSUPPORTED, response.notificationsByRole().state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteWithResponseMockTests.java deleted file mode 100644 index 5f39e5a1eb1f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityContactsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.securityContacts().deleteWithResponse("jsczivfqbqnasdsy", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsGetWithResponseMockTests.java deleted file mode 100644 index a222f10ee0bf..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsGetWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.SecurityContact; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityContactsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"emails\":\"glhrfo\",\"phone\":\"wecr\",\"alertNotifications\":{\"state\":\"Passed\",\"minimalSeverity\":\"Medium\"},\"notificationsByRole\":{\"state\":\"Skipped\",\"roles\":[]}},\"id\":\"ovppqibukklvzrlr\",\"name\":\"l\",\"type\":\"cme\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityContact response = - manager.securityContacts().getWithResponse("xl", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("glhrfo", response.emails()); - Assertions.assertEquals("wecr", response.phone()); - Assertions.assertEquals(State.PASSED, response.alertNotifications().state()); - Assertions.assertEquals(MinimalSeverity.MEDIUM, response.alertNotifications().minimalSeverity()); - Assertions.assertEquals(State.SKIPPED, response.notificationsByRole().state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsListMockTests.java deleted file mode 100644 index 130d3bfc5427..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityContactsListMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.MinimalSeverity; -import com.azure.resourcemanager.security.models.SecurityContact; -import com.azure.resourcemanager.security.models.State; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityContactsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"emails\":\"tresr\",\"phone\":\"tshuvftwaivm\",\"alertNotifications\":{\"state\":\"Skipped\",\"minimalSeverity\":\"High\"},\"notificationsByRole\":{\"state\":\"Unsupported\",\"roles\":[]}},\"id\":\"anhx\",\"name\":\"pdxxzetwwz\",\"type\":\"wot\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.securityContacts().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("tresr", response.iterator().next().emails()); - Assertions.assertEquals("tshuvftwaivm", response.iterator().next().phone()); - Assertions.assertEquals(State.SKIPPED, response.iterator().next().alertNotifications().state()); - Assertions - .assertEquals(MinimalSeverity.HIGH, response.iterator().next().alertNotifications().minimalSeverity()); - Assertions.assertEquals(State.UNSUPPORTED, response.iterator().next().notificationsByRole().state()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorInnerTests.java deleted file mode 100644 index adfd19898c50..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorInnerTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.models.Identity; -import com.azure.resourcemanager.security.models.ResourceIdentityType; -import org.junit.jupiter.api.Assertions; - -public final class SecurityOperatorInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityOperatorInner model = - BinaryData - .fromString( - "{\"identity\":{\"principalId\":\"qcs\",\"tenantId\":\"chkhufm\",\"type\":\"SystemAssigned\"},\"id\":\"mqyjgy\",\"name\":\"zulo\",\"type\":\"saeuzanhsfnhsenw\"}") - .toObject(SecurityOperatorInner.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityOperatorInner model = - new SecurityOperatorInner().withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)); - model = BinaryData.fromObject(model).toObject(SecurityOperatorInner.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorListInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorListInnerTests.java deleted file mode 100644 index 0a20fb58fb2c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorListInnerTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorInner; -import com.azure.resourcemanager.security.fluent.models.SecurityOperatorListInner; -import com.azure.resourcemanager.security.models.Identity; -import com.azure.resourcemanager.security.models.ResourceIdentityType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecurityOperatorListInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityOperatorListInner model = - BinaryData - .fromString( - "{\"value\":[{\"identity\":{\"principalId\":\"wagltbxoeeonqlnf\",\"tenantId\":\"y\",\"type\":\"SystemAssigned\"},\"id\":\"qdbpbhfckdvezc\",\"name\":\"cssbzhddu\",\"type\":\"bnqfblhk\"},{\"identity\":{\"principalId\":\"hpavawu\",\"tenantId\":\"qjtiogqgdm\",\"type\":\"SystemAssigned\"},\"id\":\"ctteajohi\",\"name\":\"gspnbonhpczykm\",\"type\":\"tp\"}]}") - .toObject(SecurityOperatorListInner.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityOperatorListInner model = - new SecurityOperatorListInner() - .withValue( - Arrays - .asList( - new SecurityOperatorInner() - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)), - new SecurityOperatorInner() - .withIdentity(new Identity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)))); - model = BinaryData.fromObject(model).toObject(SecurityOperatorListInner.class); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 921164c93c41..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ResourceIdentityType; -import com.azure.resourcemanager.security.models.SecurityOperator; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityOperatorsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"identity\":{\"principalId\":\"bdveywetkrhl\",\"tenantId\":\"mcnwep\",\"type\":\"SystemAssigned\"},\"id\":\"vbbvaqdljnpetl\",\"name\":\"n\",\"type\":\"detawevxehue\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityOperator response = - manager - .securityOperators() - .createOrUpdateWithResponse("micjixxfsf", "crtnuguefxxi", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsDeleteByResourceGroupWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index ed4a4d8ad1fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityOperatorsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .securityOperators() - .deleteByResourceGroupWithResponse("dxljzvdovbrble", "lprdaqccddcbnygd", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsGetWithResponseMockTests.java deleted file mode 100644 index 738f40a84517..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsGetWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ResourceIdentityType; -import com.azure.resourcemanager.security.models.SecurityOperator; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityOperatorsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"identity\":{\"principalId\":\"hyogzmsimeht\",\"tenantId\":\"uwdhtq\",\"type\":\"SystemAssigned\"},\"id\":\"hnimx\",\"name\":\"nsugisn\",\"type\":\"mwnwnghojovkey\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityOperator response = - manager.securityOperators().getWithResponse("ezs", "zaymld", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsListWithResponseMockTests.java deleted file mode 100644 index 48ca22b201ec..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityOperatorsListWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecurityOperatorList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecurityOperatorsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"kixsps\",\"name\":\"igavk\",\"type\":\"vyxzer\"},{\"id\":\"rkpzjbyetjxryop\",\"name\":\"ae\",\"type\":\"twhlbecgih\"},{\"id\":\"pemnrrabo\",\"name\":\"rwwxywpj\",\"type\":\"spboxhifp\"},{\"id\":\"kpeswyhhmifj\",\"name\":\"ajxwwvcmmpegl\",\"type\":\"uqvcmlaexbzbqufp\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityOperatorList response = - manager - .securityOperators() - .listWithResponse("bfjzabbwzgvzuaix", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionInnerTests.java deleted file mode 100644 index 26a4ccb5f9d3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionInnerTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import org.junit.jupiter.api.Assertions; - -public final class SecuritySolutionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySolutionInner model = - BinaryData - .fromString( - "{\"properties\":{\"securityFamily\":\"Ngfw\",\"provisioningState\":\"Failed\",\"template\":\"rxhtvso\",\"protectionStatus\":\"hlwntsjgq\"},\"location\":\"xypruuuy\",\"id\":\"nchrszizoyu\",\"name\":\"lyetndnbfqygg\",\"type\":\"g\"}") - .toObject(SecuritySolutionInner.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.securityFamily()); - Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); - Assertions.assertEquals("rxhtvso", model.template()); - Assertions.assertEquals("hlwntsjgq", model.protectionStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySolutionInner model = - new SecuritySolutionInner() - .withSecurityFamily(SecurityFamily.NGFW) - .withProvisioningState(ProvisioningState.FAILED) - .withTemplate("rxhtvso") - .withProtectionStatus("hlwntsjgq"); - model = BinaryData.fromObject(model).toObject(SecuritySolutionInner.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.securityFamily()); - Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); - Assertions.assertEquals("rxhtvso", model.template()); - Assertions.assertEquals("hlwntsjgq", model.protectionStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionListTests.java deleted file mode 100644 index 3156ea8030c7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionListTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionInner; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.azure.resourcemanager.security.models.SecuritySolutionList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecuritySolutionListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySolutionList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"securityFamily\":\"Ngfw\",\"provisioningState\":\"Updating\",\"template\":\"ilguooqjagmditg\",\"protectionStatus\":\"eiookjbsah\"},\"location\":\"dt\",\"id\":\"delqacslmoto\",\"name\":\"bnfxofvc\",\"type\":\"k\"},{\"properties\":{\"securityFamily\":\"Va\",\"provisioningState\":\"Failed\",\"template\":\"azftxejwabmdujtm\",\"protectionStatus\":\"cope\"},\"location\":\"m\",\"id\":\"urbuhhlkyqltq\",\"name\":\"rogtuwkf\",\"type\":\"djk\"},{\"properties\":{\"securityFamily\":\"SaasWaf\",\"provisioningState\":\"Failed\",\"template\":\"idfv\",\"protectionStatus\":\"lglxnfui\"},\"location\":\"kbusqo\",\"id\":\"sfikayiansharuj\",\"name\":\"ji\",\"type\":\"xfz\"},{\"properties\":{\"securityFamily\":\"Waf\",\"provisioningState\":\"Failed\",\"template\":\"tvwkpqhjpenu\",\"protectionStatus\":\"gbqe\"},\"location\":\"ekewvnqvcdlguauc\",\"id\":\"f\",\"name\":\"jwnlax\",\"type\":\"un\"}],\"nextLink\":\"ikczvvitacgxmf\"}") - .toObject(SecuritySolutionList.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.value().get(0).securityFamily()); - Assertions.assertEquals(ProvisioningState.UPDATING, model.value().get(0).provisioningState()); - Assertions.assertEquals("ilguooqjagmditg", model.value().get(0).template()); - Assertions.assertEquals("eiookjbsah", model.value().get(0).protectionStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySolutionList model = - new SecuritySolutionList() - .withValue( - Arrays - .asList( - new SecuritySolutionInner() - .withSecurityFamily(SecurityFamily.NGFW) - .withProvisioningState(ProvisioningState.UPDATING) - .withTemplate("ilguooqjagmditg") - .withProtectionStatus("eiookjbsah"), - new SecuritySolutionInner() - .withSecurityFamily(SecurityFamily.VA) - .withProvisioningState(ProvisioningState.FAILED) - .withTemplate("azftxejwabmdujtm") - .withProtectionStatus("cope"), - new SecuritySolutionInner() - .withSecurityFamily(SecurityFamily.SAAS_WAF) - .withProvisioningState(ProvisioningState.FAILED) - .withTemplate("idfv") - .withProtectionStatus("lglxnfui"), - new SecuritySolutionInner() - .withSecurityFamily(SecurityFamily.WAF) - .withProvisioningState(ProvisioningState.FAILED) - .withTemplate("tvwkpqhjpenu") - .withProtectionStatus("gbqe"))); - model = BinaryData.fromObject(model).toObject(SecuritySolutionList.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.value().get(0).securityFamily()); - Assertions.assertEquals(ProvisioningState.UPDATING, model.value().get(0).provisioningState()); - Assertions.assertEquals("ilguooqjagmditg", model.value().get(0).template()); - Assertions.assertEquals("eiookjbsah", model.value().get(0).protectionStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionPropertiesTests.java deleted file mode 100644 index 05b7764a19cb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionPropertiesTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionProperties; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import org.junit.jupiter.api.Assertions; - -public final class SecuritySolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySolutionProperties model = - BinaryData - .fromString( - "{\"securityFamily\":\"Waf\",\"provisioningState\":\"Failed\",\"template\":\"lgmtrwahzjmucf\",\"protectionStatus\":\"byrplrohkpig\"}") - .toObject(SecuritySolutionProperties.class); - Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily()); - Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); - Assertions.assertEquals("lgmtrwahzjmucf", model.template()); - Assertions.assertEquals("byrplrohkpig", model.protectionStatus()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySolutionProperties model = - new SecuritySolutionProperties() - .withSecurityFamily(SecurityFamily.WAF) - .withProvisioningState(ProvisioningState.FAILED) - .withTemplate("lgmtrwahzjmucf") - .withProtectionStatus("byrplrohkpig"); - model = BinaryData.fromObject(model).toObject(SecuritySolutionProperties.class); - Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily()); - Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); - Assertions.assertEquals("lgmtrwahzjmucf", model.template()); - Assertions.assertEquals("byrplrohkpig", model.protectionStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetWithResponseMockTests.java deleted file mode 100644 index f7a76de5bcf9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsGetWithResponseMockTests.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.azure.resourcemanager.security.models.SecuritySolution; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecuritySolutionsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"securityFamily\":\"Ngfw\",\"provisioningState\":\"Updating\",\"template\":\"bzkuastaxklpr\",\"protectionStatus\":\"ulhgltoiz\"},\"location\":\"vscksgfyys\",\"id\":\"yekgafxc\",\"name\":\"vfcck\",\"type\":\"rtwletyves\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecuritySolution response = - manager - .securitySolutions() - .getWithResponse("ucumlddauqml", "feothxu", "rigrjdljlkq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(SecurityFamily.NGFW, response.securityFamily()); - Assertions.assertEquals(ProvisioningState.UPDATING, response.provisioningState()); - Assertions.assertEquals("bzkuastaxklpr", response.template()); - Assertions.assertEquals("ulhgltoiz", response.protectionStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListMockTests.java deleted file mode 100644 index 160b71db2ea3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsListMockTests.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ProvisioningState; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.azure.resourcemanager.security.models.SecuritySolution; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecuritySolutionsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"securityFamily\":\"Va\",\"provisioningState\":\"Failed\",\"template\":\"bpgb\",\"protectionStatus\":\"hbjdqknhqnmotpu\"},\"location\":\"nohmmzngocfrj\",\"id\":\"ypwyiulayno\",\"name\":\"ugkfhaxttpfsm\",\"type\":\"gsgh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.securitySolutions().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals(SecurityFamily.VA, response.iterator().next().securityFamily()); - Assertions.assertEquals(ProvisioningState.FAILED, response.iterator().next().provisioningState()); - Assertions.assertEquals("bpgb", response.iterator().next().template()); - Assertions.assertEquals("hbjdqknhqnmotpu", response.iterator().next().protectionStatus()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListInnerTests.java deleted file mode 100644 index 692cbbc733e9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataListInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataListInner; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceData; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SecuritySolutionsReferenceDataListInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySolutionsReferenceDataListInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"securityFamily\":\"Va\",\"alertVendorName\":\"znnbsoqeqalarvl\",\"packageInfoUrl\":\"gunbtgfebwlnbm\",\"productName\":\"yreeudz\",\"publisher\":\"av\",\"publisherDisplayName\":\"pdqmjxlyyzglgouw\",\"template\":\"lmjjyuo\"},\"location\":\"tob\",\"id\":\"xkjeytunlbfj\",\"name\":\"wrus\",\"type\":\"kqbh\"}]}") - .toObject(SecuritySolutionsReferenceDataListInner.class); - Assertions.assertEquals(SecurityFamily.VA, model.value().get(0).securityFamily()); - Assertions.assertEquals("znnbsoqeqalarvl", model.value().get(0).alertVendorName()); - Assertions.assertEquals("gunbtgfebwlnbm", model.value().get(0).packageInfoUrl()); - Assertions.assertEquals("yreeudz", model.value().get(0).productName()); - Assertions.assertEquals("av", model.value().get(0).publisher()); - Assertions.assertEquals("pdqmjxlyyzglgouw", model.value().get(0).publisherDisplayName()); - Assertions.assertEquals("lmjjyuo", model.value().get(0).template()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySolutionsReferenceDataListInner model = - new SecuritySolutionsReferenceDataListInner() - .withValue( - Arrays - .asList( - new SecuritySolutionsReferenceData() - .withSecurityFamily(SecurityFamily.VA) - .withAlertVendorName("znnbsoqeqalarvl") - .withPackageInfoUrl("gunbtgfebwlnbm") - .withProductName("yreeudz") - .withPublisher("av") - .withPublisherDisplayName("pdqmjxlyyzglgouw") - .withTemplate("lmjjyuo"))); - model = BinaryData.fromObject(model).toObject(SecuritySolutionsReferenceDataListInner.class); - Assertions.assertEquals(SecurityFamily.VA, model.value().get(0).securityFamily()); - Assertions.assertEquals("znnbsoqeqalarvl", model.value().get(0).alertVendorName()); - Assertions.assertEquals("gunbtgfebwlnbm", model.value().get(0).packageInfoUrl()); - Assertions.assertEquals("yreeudz", model.value().get(0).productName()); - Assertions.assertEquals("av", model.value().get(0).publisher()); - Assertions.assertEquals("pdqmjxlyyzglgouw", model.value().get(0).publisherDisplayName()); - Assertions.assertEquals("lmjjyuo", model.value().get(0).template()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataPropertiesTests.java deleted file mode 100644 index a13c6be9d0b0..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataPropertiesTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecuritySolutionsReferenceDataProperties; -import com.azure.resourcemanager.security.models.SecurityFamily; -import org.junit.jupiter.api.Assertions; - -public final class SecuritySolutionsReferenceDataPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySolutionsReferenceDataProperties model = - BinaryData - .fromString( - "{\"securityFamily\":\"Ngfw\",\"alertVendorName\":\"ixtmkzjvkviirhgf\",\"packageInfoUrl\":\"rwsdp\",\"productName\":\"ra\",\"publisher\":\"zvzbglbyv\",\"publisherDisplayName\":\"ctctbrxkjz\",\"template\":\"rgxffmshkw\"}") - .toObject(SecuritySolutionsReferenceDataProperties.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.securityFamily()); - Assertions.assertEquals("ixtmkzjvkviirhgf", model.alertVendorName()); - Assertions.assertEquals("rwsdp", model.packageInfoUrl()); - Assertions.assertEquals("ra", model.productName()); - Assertions.assertEquals("zvzbglbyv", model.publisher()); - Assertions.assertEquals("ctctbrxkjz", model.publisherDisplayName()); - Assertions.assertEquals("rgxffmshkw", model.template()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySolutionsReferenceDataProperties model = - new SecuritySolutionsReferenceDataProperties() - .withSecurityFamily(SecurityFamily.NGFW) - .withAlertVendorName("ixtmkzjvkviirhgf") - .withPackageInfoUrl("rwsdp") - .withProductName("ra") - .withPublisher("zvzbglbyv") - .withPublisherDisplayName("ctctbrxkjz") - .withTemplate("rgxffmshkw"); - model = BinaryData.fromObject(model).toObject(SecuritySolutionsReferenceDataProperties.class); - Assertions.assertEquals(SecurityFamily.NGFW, model.securityFamily()); - Assertions.assertEquals("ixtmkzjvkviirhgf", model.alertVendorName()); - Assertions.assertEquals("rwsdp", model.packageInfoUrl()); - Assertions.assertEquals("ra", model.productName()); - Assertions.assertEquals("zvzbglbyv", model.publisher()); - Assertions.assertEquals("ctctbrxkjz", model.publisherDisplayName()); - Assertions.assertEquals("rgxffmshkw", model.template()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataTests.java deleted file mode 100644 index 925233362b40..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDataTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecurityFamily; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceData; -import org.junit.jupiter.api.Assertions; - -public final class SecuritySolutionsReferenceDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySolutionsReferenceData model = - BinaryData - .fromString( - "{\"properties\":{\"securityFamily\":\"Waf\",\"alertVendorName\":\"rqunjq\",\"packageInfoUrl\":\"denxau\",\"productName\":\"kpak\",\"publisher\":\"kifmjn\",\"publisherDisplayName\":\"awtqabpxuckpgg\",\"template\":\"oweyirdhlis\"},\"location\":\"wfl\",\"id\":\"qmp\",\"name\":\"zruwn\",\"type\":\"qxpxiwfcngjsaa\"}") - .toObject(SecuritySolutionsReferenceData.class); - Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily()); - Assertions.assertEquals("rqunjq", model.alertVendorName()); - Assertions.assertEquals("denxau", model.packageInfoUrl()); - Assertions.assertEquals("kpak", model.productName()); - Assertions.assertEquals("kifmjn", model.publisher()); - Assertions.assertEquals("awtqabpxuckpgg", model.publisherDisplayName()); - Assertions.assertEquals("oweyirdhlis", model.template()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySolutionsReferenceData model = - new SecuritySolutionsReferenceData() - .withSecurityFamily(SecurityFamily.WAF) - .withAlertVendorName("rqunjq") - .withPackageInfoUrl("denxau") - .withProductName("kpak") - .withPublisher("kifmjn") - .withPublisherDisplayName("awtqabpxuckpgg") - .withTemplate("oweyirdhlis"); - model = BinaryData.fromObject(model).toObject(SecuritySolutionsReferenceData.class); - Assertions.assertEquals(SecurityFamily.WAF, model.securityFamily()); - Assertions.assertEquals("rqunjq", model.alertVendorName()); - Assertions.assertEquals("denxau", model.packageInfoUrl()); - Assertions.assertEquals("kpak", model.productName()); - Assertions.assertEquals("kifmjn", model.publisher()); - Assertions.assertEquals("awtqabpxuckpgg", model.publisherDisplayName()); - Assertions.assertEquals("oweyirdhlis", model.template()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDatasListByHomeRegionWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDatasListByHomeRegionWithResponseMockTests.java deleted file mode 100644 index 26fcf5ec13dd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDatasListByHomeRegionWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDataList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecuritySolutionsReferenceDatasListByHomeRegionWithResponseMockTests { - @Test - public void testListByHomeRegionWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"ablqgpwbmwhria\",\"id\":\"iwrycgnwplrrb\",\"name\":\"hctsbbibti\",\"type\":\"uhqvums\"},{\"location\":\"fsfeqbbe\",\"id\":\"f\",\"name\":\"uqfpyyxmzrmtm\",\"type\":\"wi\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecuritySolutionsReferenceDataList response = - manager - .securitySolutionsReferenceDatas() - .listByHomeRegionWithResponse("cm", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDatasListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDatasListWithResponseMockTests.java deleted file mode 100644 index de9e41dd19db..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySolutionsReferenceDatasListWithResponseMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDataList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SecuritySolutionsReferenceDatasListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"iljpibk\",\"id\":\"xyxyaux\",\"name\":\"eddobmcnltm\",\"type\":\"ytkujsq\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecuritySolutionsReferenceDataList response = - manager.securitySolutionsReferenceDatas().listWithResponse(com.azure.core.util.Context.NONE).getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySubAssessmentListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySubAssessmentListTests.java deleted file mode 100644 index 42478af785bb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecuritySubAssessmentListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecuritySubAssessmentList; - -public final class SecuritySubAssessmentListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecuritySubAssessmentList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"id\":\"vgbmhr\",\"displayName\":\"kw\",\"remediation\":\"jejveg\",\"impact\":\"bpnaixexccbdre\",\"category\":\"hcexdrrvqa\",\"description\":\"kghtpwijnh\",\"timeGenerated\":\"2021-01-19T12:23:33Z\"},\"id\":\"ycxzbfvoo\",\"name\":\"vrvmtgjqppyost\",\"type\":\"on\"},{\"properties\":{\"id\":\"hgfipnsxkmcw\",\"displayName\":\"krrjrea\",\"remediation\":\"sgumhjglikkxwsl\",\"impact\":\"bq\",\"category\":\"uzlm\",\"description\":\"elfk\",\"timeGenerated\":\"2021-02-21T20:32:58Z\"},\"id\":\"rpw\",\"name\":\"xeznoi\",\"type\":\"brnjwmw\"}],\"nextLink\":\"nbsazejjoqkag\"}") - .toObject(SecuritySubAssessmentList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecuritySubAssessmentList model = new SecuritySubAssessmentList(); - model = BinaryData.fromObject(model).toObject(SecuritySubAssessmentList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskInnerTests.java deleted file mode 100644 index 26d89e7606fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskInnerTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityTaskInner; -import com.azure.resourcemanager.security.models.SecurityTaskParameters; -import java.util.HashMap; -import java.util.Map; - -public final class SecurityTaskInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityTaskInner model = - BinaryData - .fromString( - "{\"properties\":{\"state\":\"mabiknsorgjhxb\",\"creationTimeUtc\":\"2021-05-03T07:32:41Z\",\"securityTaskParameters\":{\"name\":\"wrlkdmtn\",\"\":{\"xdy\":\"datakotl\"}},\"lastStateChangeTimeUtc\":\"2021-07-08T09:31:36Z\",\"subState\":\"ocogj\"},\"id\":\"tdtbnnhadooc\",\"name\":\"kvci\",\"type\":\"hnvpamqgxq\"}") - .toObject(SecurityTaskInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityTaskInner model = - new SecurityTaskInner() - .withSecurityTaskParameters( - new SecurityTaskParameters().withAdditionalProperties(mapOf("name", "wrlkdmtn"))); - model = BinaryData.fromObject(model).toObject(SecurityTaskInner.class); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskListTests.java deleted file mode 100644 index 36ba851f6c8a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecurityTaskList; - -public final class SecurityTaskListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityTaskList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"state\":\"mslyzrpzbchckqqz\",\"creationTimeUtc\":\"2021-07-29T22:35:12Z\",\"lastStateChangeTimeUtc\":\"2021-09-28T16:07:34Z\",\"subState\":\"uiizynke\"},\"id\":\"yatrwy\",\"name\":\"q\",\"type\":\"ibzyhwitsmyp\"}],\"nextLink\":\"npcdpumnzgm\"}") - .toObject(SecurityTaskList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityTaskList model = new SecurityTaskList(); - model = BinaryData.fromObject(model).toObject(SecurityTaskList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskParametersTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskParametersTests.java deleted file mode 100644 index 20fc96fa43d2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskParametersTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SecurityTaskParameters; -import java.util.HashMap; -import java.util.Map; - -public final class SecurityTaskParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityTaskParameters model = - BinaryData - .fromString( - "{\"name\":\"npkukghimdblx\",\"\":{\"j\":\"datamfnjh\",\"oqreyfkzikfjawn\":\"datawmszkk\",\"vxwc\":\"dataa\"}}") - .toObject(SecurityTaskParameters.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityTaskParameters model = - new SecurityTaskParameters().withAdditionalProperties(mapOf("name", "npkukghimdblx")); - model = BinaryData.fromObject(model).toObject(SecurityTaskParameters.class); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskPropertiesTests.java deleted file mode 100644 index ab0162085e57..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SecurityTaskPropertiesTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SecurityTaskProperties; -import com.azure.resourcemanager.security.models.SecurityTaskParameters; -import java.util.HashMap; -import java.util.Map; - -public final class SecurityTaskPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SecurityTaskProperties model = - BinaryData - .fromString( - "{\"state\":\"ezikywggxkal\",\"creationTimeUtc\":\"2021-08-12T08:34:22Z\",\"securityTaskParameters\":{\"name\":\"lwuip\",\"\":{\"gvvcnayrhyr\":\"datajzkzi\",\"rdvstkwqqtch\":\"dataxxmueedn\",\"mtdaa\":\"dataalm\",\"vgpiohgwxrt\":\"datagdv\"}},\"lastStateChangeTimeUtc\":\"2021-04-12T14:57:26Z\",\"subState\":\"epxgyqagvr\"}") - .toObject(SecurityTaskProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SecurityTaskProperties model = - new SecurityTaskProperties() - .withSecurityTaskParameters( - new SecurityTaskParameters().withAdditionalProperties(mapOf("name", "lwuip"))); - model = BinaryData.fromObject(model).toObject(SecurityTaskProperties.class); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SensitivityLabelTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SensitivityLabelTests.java deleted file mode 100644 index 43464cb1dae2..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SensitivityLabelTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Rank; -import com.azure.resourcemanager.security.models.SensitivityLabel; -import org.junit.jupiter.api.Assertions; - -public final class SensitivityLabelTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SensitivityLabel model = - BinaryData - .fromString( - "{\"displayName\":\"ncormrlxqtvcof\",\"description\":\"f\",\"rank\":\"Low\",\"order\":585875953,\"enabled\":false}") - .toObject(SensitivityLabel.class); - Assertions.assertEquals("ncormrlxqtvcof", model.displayName()); - Assertions.assertEquals("f", model.description()); - Assertions.assertEquals(Rank.LOW, model.rank()); - Assertions.assertEquals(585875953, model.order()); - Assertions.assertEquals(false, model.enabled()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SensitivityLabel model = - new SensitivityLabel() - .withDisplayName("ncormrlxqtvcof") - .withDescription("f") - .withRank(Rank.LOW) - .withOrder(585875953) - .withEnabled(false); - model = BinaryData.fromObject(model).toObject(SensitivityLabel.class); - Assertions.assertEquals("ncormrlxqtvcof", model.displayName()); - Assertions.assertEquals("f", model.description()); - Assertions.assertEquals(Rank.LOW, model.rank()); - Assertions.assertEquals(585875953, model.order()); - Assertions.assertEquals(false, model.enabled()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentInnerTests.java deleted file mode 100644 index 5b2c5441d614..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner; - -public final class ServerVulnerabilityAssessmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerVulnerabilityAssessmentInner model = - BinaryData - .fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\"},\"id\":\"cimpevfg\",\"name\":\"b\",\"type\":\"rrilbywdxsmic\"}") - .toObject(ServerVulnerabilityAssessmentInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVulnerabilityAssessmentInner model = new ServerVulnerabilityAssessmentInner(); - model = BinaryData.fromObject(model).toObject(ServerVulnerabilityAssessmentInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentPropertiesTests.java deleted file mode 100644 index 536881f97f6a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentPropertiesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentProperties; - -public final class ServerVulnerabilityAssessmentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerVulnerabilityAssessmentProperties model = - BinaryData - .fromString("{\"provisioningState\":\"Failed\"}") - .toObject(ServerVulnerabilityAssessmentProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVulnerabilityAssessmentProperties model = new ServerVulnerabilityAssessmentProperties(); - model = BinaryData.fromObject(model).toObject(ServerVulnerabilityAssessmentProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index c4fdd2117d74..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServerVulnerabilityAssessmentsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"kg\",\"name\":\"sdgzyy\",\"type\":\"zoxlvoc\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(202); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerVulnerabilityAssessment response = - manager - .serverVulnerabilityAssessments() - .createOrUpdateWithResponse( - "wgpterdiuw", "i", "kskw", "tsdetjygowifcq", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsDeleteMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsDeleteMockTests.java deleted file mode 100644 index 2ab04b526e40..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsDeleteMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServerVulnerabilityAssessmentsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .serverVulnerabilityAssessments() - .delete("tvdxxhe", "gmlilwzghjhjvmab", "zbwaybfmdafbgym", "tn", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsGetWithResponseMockTests.java deleted file mode 100644 index 5c6e0d5cb329..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsGetWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServerVulnerabilityAssessmentsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"provisioningState\":\"Failed\"},\"id\":\"qsdb\",\"name\":\"oksz\",\"type\":\"nm\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerVulnerabilityAssessment response = - manager - .serverVulnerabilityAssessments() - .getWithResponse( - "dabalfdxaglzfytl", "tlqh", "pxouvmr", "iflikyypzkgxfx", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsListByExtendedResourceWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsListByExtendedResourceWithResponseMockTests.java deleted file mode 100644 index 481fd65f1106..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsListByExtendedResourceWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessmentsList; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ServerVulnerabilityAssessmentsListByExtendedResourceWithResponseMockTests { - @Test - public void testListByExtendedResourceWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"trdxri\",\"name\":\"agbbgia\",\"type\":\"ksykpgdqxwabzrw\"},{\"id\":\"rxhaclcdosqkp\",\"name\":\"jqgkifmmainwhe\",\"type\":\"xkpbqwun\"},{\"id\":\"buizazzelwg\",\"name\":\"ydjufbnklbl\",\"type\":\"xpegj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ServerVulnerabilityAssessmentsList response = - manager - .serverVulnerabilityAssessments() - .listByExtendedResourceWithResponse( - "iichgjsysmvxodgw", "f", "zsifcuvbdujgcwx", "ec", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsListInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsListInnerTests.java deleted file mode 100644 index 31961ebd5ca4..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityAssessmentsListInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentInner; -import com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsListInner; -import java.util.Arrays; - -public final class ServerVulnerabilityAssessmentsListInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerVulnerabilityAssessmentsListInner model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Deprovisioning\"},\"id\":\"ys\",\"name\":\"gdotcubiipuipwo\",\"type\":\"onmacjekniz\"}]}") - .toObject(ServerVulnerabilityAssessmentsListInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVulnerabilityAssessmentsListInner model = - new ServerVulnerabilityAssessmentsListInner() - .withValue(Arrays.asList(new ServerVulnerabilityAssessmentInner())); - model = BinaryData.fromObject(model).toObject(ServerVulnerabilityAssessmentsListInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityPropertiesTests.java deleted file mode 100644 index 455357802825..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ServerVulnerabilityPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ServerVulnerabilityProperties; - -public final class ServerVulnerabilityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ServerVulnerabilityProperties model = - BinaryData - .fromString( - "{\"assessedResourceType\":\"ServerVulnerabilityAssessment\",\"type\":\"q\",\"cvss\":{\"rgmqso\":{\"base\":67.92354},\"ekxgn\":{\"base\":47.863705},\"mxcpwzvmdoks\":{\"base\":9.420771}},\"patchable\":true,\"cve\":[{\"title\":\"wxlboncqbazqicq\",\"link\":\"ygtvxbyjanepub\"},{\"title\":\"kxyqvgxiaodetv\",\"link\":\"kxdxuwsaifmcwn\"},{\"title\":\"bzlehgc\",\"link\":\"bcknjolgj\"},{\"title\":\"xpvelszerqzevxo\",\"link\":\"intxwa\"}],\"threat\":\"glzoblqwa\",\"publishedTime\":\"2021-06-14T23:06:53Z\",\"vendorReferences\":[{\"title\":\"hmzyqbhdvafjrqpj\",\"link\":\"r\"},{\"title\":\"crgaxwmzwdf\",\"link\":\"nrzorpd\"}]}") - .toObject(ServerVulnerabilityProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ServerVulnerabilityProperties model = new ServerVulnerabilityProperties(); - model = BinaryData.fromObject(model).toObject(ServerVulnerabilityProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingInnerTests.java deleted file mode 100644 index 274dc0faefc1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SettingInner; - -public final class SettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SettingInner model = - BinaryData - .fromString("{\"kind\":\"Setting\",\"id\":\"gddpq\",\"name\":\"hehnmnaoya\",\"type\":\"kcoeqswank\"}") - .toObject(SettingInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SettingInner model = new SettingInner(); - model = BinaryData.fromObject(model).toObject(SettingInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsGetWithResponseMockTests.java deleted file mode 100644 index 0aba89c50575..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Setting; -import com.azure.resourcemanager.security.models.SettingName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SettingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"kind\":\"Setting\",\"id\":\"oykdno\",\"name\":\"aaxwmgzr\",\"type\":\"jlqcwny\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Setting response = - manager - .settings() - .getWithResponse(SettingName.WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW, com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsListMockTests.java deleted file mode 100644 index 1018c003ebc9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Setting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SettingsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"kind\":\"Setting\",\"id\":\"i\",\"name\":\"zbkuckgkdsksw\",\"type\":\"iiqqcqikclsmalns\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.settings().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsListTests.java deleted file mode 100644 index 8f367ef1368f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsListTests.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.azure.resourcemanager.security.models.SettingsList; -import java.util.Arrays; - -public final class SettingsListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SettingsList model = - BinaryData - .fromString( - "{\"value\":[{\"kind\":\"Setting\",\"id\":\"sqowxwc\",\"name\":\"mlikytw\",\"type\":\"czcswka\"}],\"nextLink\":\"ejyfdvlvhbwrnfx\"}") - .toObject(SettingsList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SettingsList model = new SettingsList().withValue(Arrays.asList(new SettingInner())); - model = BinaryData.fromObject(model).toObject(SettingsList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsUpdateWithResponseMockTests.java deleted file mode 100644 index 4e2bfc09b885..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SettingsUpdateWithResponseMockTests.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.fluent.models.SettingInner; -import com.azure.resourcemanager.security.models.Setting; -import com.azure.resourcemanager.security.models.SettingName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SettingsUpdateWithResponseMockTests { - @Test - public void testUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"kind\":\"Setting\",\"id\":\"hxuvjhxm\",\"name\":\"rqstjcme\",\"type\":\"wmlgicvnpv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Setting response = - manager - .settings() - .updateWithResponse( - SettingName.WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW, - new SettingInner(), - com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInnerTests.java deleted file mode 100644 index ffbdd98a417e..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInnerTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SoftwareInner; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import org.junit.jupiter.api.Assertions; - -public final class SoftwareInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SoftwareInner model = - BinaryData - .fromString( - "{\"properties\":{\"deviceId\":\"gm\",\"osPlatform\":\"fjlrxwtoauk\",\"vendor\":\"kvci\",\"softwareName\":\"zmoaeds\",\"version\":\"wuived\",\"endOfSupportStatus\":\"noLongerSupported\",\"endOfSupportDate\":\"eewxeiqbpsmg\",\"numberOfKnownVulnerabilities\":1437777352,\"firstSeenAt\":\"amljdlrgmsplzgau\"},\"id\":\"cshhv\",\"name\":\"ewgnxkympqanxrj\",\"type\":\"ixt\"}") - .toObject(SoftwareInner.class); - Assertions.assertEquals("gm", model.deviceId()); - Assertions.assertEquals("fjlrxwtoauk", model.osPlatform()); - Assertions.assertEquals("kvci", model.vendor()); - Assertions.assertEquals("zmoaeds", model.softwareName()); - Assertions.assertEquals("wuived", model.version()); - Assertions.assertEquals(EndOfSupportStatus.NO_LONGER_SUPPORTED, model.endOfSupportStatus()); - Assertions.assertEquals("eewxeiqbpsmg", model.endOfSupportDate()); - Assertions.assertEquals(1437777352, model.numberOfKnownVulnerabilities()); - Assertions.assertEquals("amljdlrgmsplzgau", model.firstSeenAt()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SoftwareInner model = - new SoftwareInner() - .withDeviceId("gm") - .withOsPlatform("fjlrxwtoauk") - .withVendor("kvci") - .withSoftwareName("zmoaeds") - .withVersion("wuived") - .withEndOfSupportStatus(EndOfSupportStatus.NO_LONGER_SUPPORTED) - .withEndOfSupportDate("eewxeiqbpsmg") - .withNumberOfKnownVulnerabilities(1437777352) - .withFirstSeenAt("amljdlrgmsplzgau"); - model = BinaryData.fromObject(model).toObject(SoftwareInner.class); - Assertions.assertEquals("gm", model.deviceId()); - Assertions.assertEquals("fjlrxwtoauk", model.osPlatform()); - Assertions.assertEquals("kvci", model.vendor()); - Assertions.assertEquals("zmoaeds", model.softwareName()); - Assertions.assertEquals("wuived", model.version()); - Assertions.assertEquals(EndOfSupportStatus.NO_LONGER_SUPPORTED, model.endOfSupportStatus()); - Assertions.assertEquals("eewxeiqbpsmg", model.endOfSupportDate()); - Assertions.assertEquals(1437777352, model.numberOfKnownVulnerabilities()); - Assertions.assertEquals("amljdlrgmsplzgau", model.firstSeenAt()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetWithResponseMockTests.java deleted file mode 100644 index fe3f0f527438..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesGetWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import com.azure.resourcemanager.security.models.Software; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SoftwareInventoriesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"deviceId\":\"dtlri\",\"osPlatform\":\"ooy\",\"vendor\":\"uxdtzcq\",\"softwareName\":\"sdudgcoz\",\"version\":\"meh\",\"endOfSupportStatus\":\"None\",\"endOfSupportDate\":\"tolamlbijuxkq\",\"numberOfKnownVulnerabilities\":769039646,\"firstSeenAt\":\"i\"},\"id\":\"vwdtgckzdqiqdl\",\"name\":\"atrkwxoauwxs\",\"type\":\"ykznhrfgslglhp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Software response = - manager - .softwareInventories() - .getWithResponse( - "wahoyiyaxqvjw", "i", "tcz", "ddnvovbooqbmdq", "xyglaetscflw", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("dtlri", response.deviceId()); - Assertions.assertEquals("ooy", response.osPlatform()); - Assertions.assertEquals("uxdtzcq", response.vendor()); - Assertions.assertEquals("sdudgcoz", response.softwareName()); - Assertions.assertEquals("meh", response.version()); - Assertions.assertEquals(EndOfSupportStatus.NONE, response.endOfSupportStatus()); - Assertions.assertEquals("tolamlbijuxkq", response.endOfSupportDate()); - Assertions.assertEquals(769039646, response.numberOfKnownVulnerabilities()); - Assertions.assertEquals("i", response.firstSeenAt()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceMockTests.java deleted file mode 100644 index 002a0109fba1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListByExtendedResourceMockTests.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import com.azure.resourcemanager.security.models.Software; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SoftwareInventoriesListByExtendedResourceMockTests { - @Test - public void testListByExtendedResource() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"deviceId\":\"movsfbpbvz\",\"osPlatform\":\"axmfmvsmcwoxfa\",\"vendor\":\"tnq\",\"softwareName\":\"bsat\",\"version\":\"iauesugmocpcjy\",\"endOfSupportStatus\":\"noLongerSupported\",\"endOfSupportDate\":\"lrgttwfldsiuor\",\"numberOfKnownVulnerabilities\":1814755827,\"firstSeenAt\":\"cedpksriwmmtmqrx\"},\"id\":\"zqv\",\"name\":\"yczyayubtgm\",\"type\":\"xiqahr\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager - .softwareInventories() - .listByExtendedResource( - "ovanyrva", "rtgelg", "ewikfyaqandmym", "qoq", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("movsfbpbvz", response.iterator().next().deviceId()); - Assertions.assertEquals("axmfmvsmcwoxfa", response.iterator().next().osPlatform()); - Assertions.assertEquals("tnq", response.iterator().next().vendor()); - Assertions.assertEquals("bsat", response.iterator().next().softwareName()); - Assertions.assertEquals("iauesugmocpcjy", response.iterator().next().version()); - Assertions - .assertEquals(EndOfSupportStatus.NO_LONGER_SUPPORTED, response.iterator().next().endOfSupportStatus()); - Assertions.assertEquals("lrgttwfldsiuor", response.iterator().next().endOfSupportDate()); - Assertions.assertEquals(1814755827, response.iterator().next().numberOfKnownVulnerabilities()); - Assertions.assertEquals("cedpksriwmmtmqrx", response.iterator().next().firstSeenAt()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListMockTests.java deleted file mode 100644 index 6e5334067749..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwareInventoriesListMockTests.java +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import com.azure.resourcemanager.security.models.Software; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SoftwareInventoriesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"deviceId\":\"pxmib\",\"osPlatform\":\"nupoyryefqmwovyz\",\"vendor\":\"lnomfpb\",\"softwareName\":\"eegvyieztkutnj\",\"version\":\"l\",\"endOfSupportStatus\":\"noLongerSupported\",\"endOfSupportDate\":\"ehyh\",\"numberOfKnownVulnerabilities\":1937548392,\"firstSeenAt\":\"dui\"},\"id\":\"vulxfar\",\"name\":\"rvjlgd\",\"type\":\"zvj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.softwareInventories().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("pxmib", response.iterator().next().deviceId()); - Assertions.assertEquals("nupoyryefqmwovyz", response.iterator().next().osPlatform()); - Assertions.assertEquals("lnomfpb", response.iterator().next().vendor()); - Assertions.assertEquals("eegvyieztkutnj", response.iterator().next().softwareName()); - Assertions.assertEquals("l", response.iterator().next().version()); - Assertions - .assertEquals(EndOfSupportStatus.NO_LONGER_SUPPORTED, response.iterator().next().endOfSupportStatus()); - Assertions.assertEquals("ehyh", response.iterator().next().endOfSupportDate()); - Assertions.assertEquals(1937548392, response.iterator().next().numberOfKnownVulnerabilities()); - Assertions.assertEquals("dui", response.iterator().next().firstSeenAt()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwarePropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwarePropertiesTests.java deleted file mode 100644 index 54a412a8401b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwarePropertiesTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SoftwareProperties; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import org.junit.jupiter.api.Assertions; - -public final class SoftwarePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SoftwareProperties model = - BinaryData - .fromString( - "{\"deviceId\":\"taoypnyghshxc\",\"osPlatform\":\"hkgmnsg\",\"vendor\":\"xycphdrwjjkh\",\"softwareName\":\"omacluzvxnqmhr\",\"version\":\"pd\",\"endOfSupportStatus\":\"upcomingVersionNoLongerSupported\",\"endOfSupportDate\":\"oi\",\"numberOfKnownVulnerabilities\":785692524,\"firstSeenAt\":\"sffxui\"}") - .toObject(SoftwareProperties.class); - Assertions.assertEquals("taoypnyghshxc", model.deviceId()); - Assertions.assertEquals("hkgmnsg", model.osPlatform()); - Assertions.assertEquals("xycphdrwjjkh", model.vendor()); - Assertions.assertEquals("omacluzvxnqmhr", model.softwareName()); - Assertions.assertEquals("pd", model.version()); - Assertions.assertEquals(EndOfSupportStatus.UPCOMING_VERSION_NO_LONGER_SUPPORTED, model.endOfSupportStatus()); - Assertions.assertEquals("oi", model.endOfSupportDate()); - Assertions.assertEquals(785692524, model.numberOfKnownVulnerabilities()); - Assertions.assertEquals("sffxui", model.firstSeenAt()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SoftwareProperties model = - new SoftwareProperties() - .withDeviceId("taoypnyghshxc") - .withOsPlatform("hkgmnsg") - .withVendor("xycphdrwjjkh") - .withSoftwareName("omacluzvxnqmhr") - .withVersion("pd") - .withEndOfSupportStatus(EndOfSupportStatus.UPCOMING_VERSION_NO_LONGER_SUPPORTED) - .withEndOfSupportDate("oi") - .withNumberOfKnownVulnerabilities(785692524) - .withFirstSeenAt("sffxui"); - model = BinaryData.fromObject(model).toObject(SoftwareProperties.class); - Assertions.assertEquals("taoypnyghshxc", model.deviceId()); - Assertions.assertEquals("hkgmnsg", model.osPlatform()); - Assertions.assertEquals("xycphdrwjjkh", model.vendor()); - Assertions.assertEquals("omacluzvxnqmhr", model.softwareName()); - Assertions.assertEquals("pd", model.version()); - Assertions.assertEquals(EndOfSupportStatus.UPCOMING_VERSION_NO_LONGER_SUPPORTED, model.endOfSupportStatus()); - Assertions.assertEquals("oi", model.endOfSupportDate()); - Assertions.assertEquals(785692524, model.numberOfKnownVulnerabilities()); - Assertions.assertEquals("sffxui", model.firstSeenAt()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwaresListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwaresListTests.java deleted file mode 100644 index 0f39ca4eab08..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SoftwaresListTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.SoftwareInner; -import com.azure.resourcemanager.security.models.EndOfSupportStatus; -import com.azure.resourcemanager.security.models.SoftwaresList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SoftwaresListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SoftwaresList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"deviceId\":\"ubkmifo\",\"osPlatform\":\"ku\",\"vendor\":\"phavpmhbrb\",\"softwareName\":\"vgovpbbttefjokn\",\"version\":\"qyzqedikdfrdb\",\"endOfSupportStatus\":\"upcomingNoLongerSupported\",\"endOfSupportDate\":\"jgeihfqlggwfi\",\"numberOfKnownVulnerabilities\":864537987,\"firstSeenAt\":\"mjpb\"},\"id\":\"ephmgtvljvrcmyfq\",\"name\":\"pgxh\",\"type\":\"pomyqwcabvnuile\"}],\"nextLink\":\"aswlp\"}") - .toObject(SoftwaresList.class); - Assertions.assertEquals("ubkmifo", model.value().get(0).deviceId()); - Assertions.assertEquals("ku", model.value().get(0).osPlatform()); - Assertions.assertEquals("phavpmhbrb", model.value().get(0).vendor()); - Assertions.assertEquals("vgovpbbttefjokn", model.value().get(0).softwareName()); - Assertions.assertEquals("qyzqedikdfrdb", model.value().get(0).version()); - Assertions - .assertEquals(EndOfSupportStatus.UPCOMING_NO_LONGER_SUPPORTED, model.value().get(0).endOfSupportStatus()); - Assertions.assertEquals("jgeihfqlggwfi", model.value().get(0).endOfSupportDate()); - Assertions.assertEquals(864537987, model.value().get(0).numberOfKnownVulnerabilities()); - Assertions.assertEquals("mjpb", model.value().get(0).firstSeenAt()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SoftwaresList model = - new SoftwaresList() - .withValue( - Arrays - .asList( - new SoftwareInner() - .withDeviceId("ubkmifo") - .withOsPlatform("ku") - .withVendor("phavpmhbrb") - .withSoftwareName("vgovpbbttefjokn") - .withVersion("qyzqedikdfrdb") - .withEndOfSupportStatus(EndOfSupportStatus.UPCOMING_NO_LONGER_SUPPORTED) - .withEndOfSupportDate("jgeihfqlggwfi") - .withNumberOfKnownVulnerabilities(864537987) - .withFirstSeenAt("mjpb"))); - model = BinaryData.fromObject(model).toObject(SoftwaresList.class); - Assertions.assertEquals("ubkmifo", model.value().get(0).deviceId()); - Assertions.assertEquals("ku", model.value().get(0).osPlatform()); - Assertions.assertEquals("phavpmhbrb", model.value().get(0).vendor()); - Assertions.assertEquals("vgovpbbttefjokn", model.value().get(0).softwareName()); - Assertions.assertEquals("qyzqedikdfrdb", model.value().get(0).version()); - Assertions - .assertEquals(EndOfSupportStatus.UPCOMING_NO_LONGER_SUPPORTED, model.value().get(0).endOfSupportStatus()); - Assertions.assertEquals("jgeihfqlggwfi", model.value().get(0).endOfSupportDate()); - Assertions.assertEquals(864537987, model.value().get(0).numberOfKnownVulnerabilities()); - Assertions.assertEquals("mjpb", model.value().get(0).firstSeenAt()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlServerVulnerabilityPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlServerVulnerabilityPropertiesTests.java deleted file mode 100644 index 5b7dccfffcf8..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlServerVulnerabilityPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.SqlServerVulnerabilityProperties; - -public final class SqlServerVulnerabilityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SqlServerVulnerabilityProperties model = - BinaryData - .fromString( - "{\"assessedResourceType\":\"SqlServerVulnerability\",\"type\":\"r\",\"query\":\"uuatvlmbjwcol\"}") - .toObject(SqlServerVulnerabilityProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SqlServerVulnerabilityProperties model = new SqlServerVulnerabilityProperties(); - model = BinaryData.fromObject(model).toObject(SqlServerVulnerabilityProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddWithResponseMockTests.java deleted file mode 100644 index fdd1ddad84be..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesAddWithResponseMockTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RulesResults; -import com.azure.resourcemanager.security.models.RulesResultsInput; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentBaselineRulesAddWithResponseMockTests { - @Test - public void testAddWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"re\",\"name\":\"sfepgckncjmg\",\"type\":\"snvbtqdxfm\"},{\"id\":\"mjnhjlu\",\"name\":\"llbsupubdxc\",\"type\":\"dlhzwhcu\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RulesResults response = - manager - .sqlVulnerabilityAssessmentBaselineRules() - .addWithResponse( - "jeufj", - "flpd", - new RulesResultsInput() - .withLatestScan(true) - .withResults( - mapOf( - "uninttlnrjdszd", - Arrays - .asList(Arrays.asList("iyuxlvrh"), Arrays.asList("rvbwonleq", "lvtlrvbst", "huy")), - "oxuo", - Arrays.asList(Arrays.asList("iciqppo", "vgp", "e", "uhwfwj")))), - com.azure.core.util.Context.NONE) - .getValue(); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 3ad1d857c8eb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RuleResults; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentBaselineRulesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"results\":[[\"yrudmahswtvd\"],[\"bqssgfen\",\"fdxbvwfqjchiv\",\"r\",\"j\"]]},\"id\":\"nxndmuvardlmzjo\",\"name\":\"p\",\"type\":\"rmuhcuhtuzlx\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RuleResults response = - manager - .sqlVulnerabilityAssessmentBaselineRules() - .define("vbosjj") - .withExistingResourceId("kcgn") - .withLatestScan(true) - .withResults( - Arrays - .asList( - Arrays.asList("jiwgsxfaio", "wd", "ujjgnfgrzxbarc"), - Arrays.asList("aefzqsy", "jwenjcytesmf"), - Arrays.asList("r", "fodqhuauzmzi", "rtrfzh", "ezvhj"))) - .withWorkspaceId("dizhrjqfyaytvsly") - .create(); - - Assertions.assertEquals("yrudmahswtvd", response.properties().results().get(0).get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteWithResponseMockTests.java deleted file mode 100644 index 31076ada85b1..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentBaselineRulesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .sqlVulnerabilityAssessmentBaselineRules() - .deleteWithResponse("qzssl", "mgw", "nivrxpfduio", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetWithResponseMockTests.java deleted file mode 100644 index dc1d8ef44b64..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RuleResults; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentBaselineRulesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"results\":[[\"lobha\",\"qmomfe\"],[\"rkfrocgbmxldj\"],[\"ezb\",\"esylslur\"],[\"fygpnyhgd\",\"uqs\"]]},\"id\":\"a\",\"name\":\"qyvoupr\",\"type\":\"y\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RuleResults response = - manager - .sqlVulnerabilityAssessmentBaselineRules() - .getWithResponse("rtux", "prhfcaeo", "ifq", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("lobha", response.properties().results().get(0).get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListWithResponseMockTests.java deleted file mode 100644 index 527d1fff55d6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentBaselineRulesListWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RulesResults; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentBaselineRulesListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"ormvh\",\"name\":\"zielbprnq\",\"type\":\"jywzcqyg\"},{\"id\":\"nwsvhbngqiwye\",\"name\":\"tobdrrpnre\",\"type\":\"kunsbfjhhlwtpkv\"},{\"id\":\"eattbzkgtzqnw\",\"name\":\"s\",\"type\":\"tewuvcy\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - RulesResults response = - manager - .sqlVulnerabilityAssessmentBaselineRules() - .listWithResponse("hgyqvpbfj", "oqzucfzluczdq", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetWithResponseMockTests.java deleted file mode 100644 index 853d0773c5fa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsGetWithResponseMockTests.java +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.RuleSeverity; -import com.azure.resourcemanager.security.models.RuleStatus; -import com.azure.resourcemanager.security.models.RuleType; -import com.azure.resourcemanager.security.models.ScanResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentScanResultsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"ruleId\":\"scle\",\"status\":\"InternalError\",\"isTrimmed\":true,\"queryResults\":[[\"qlmfdg\",\"n\",\"buypwovvv\"],[\"leev\",\"oqayrehjuqwv\"],[\"xrlzhpziha\"],[\"nqqz\",\"xnq\",\"ubfonfdbgmkf\"]],\"remediation\":{\"description\":\"cwtewfhxwyrkb\",\"scripts\":[],\"automated\":false,\"portalLink\":\"rynjpc\"},\"baselineAdjustedResult\":{\"status\":\"InternalError\",\"resultsNotInBaseline\":[],\"resultsOnlyInBaseline\":[]},\"ruleMetadata\":{\"ruleId\":\"ajubo\",\"severity\":\"Low\",\"category\":\"e\",\"ruleType\":\"BaselineExpected\",\"title\":\"ieikmwlaoklfnis\",\"description\":\"gucbmt\",\"rationale\":\"dscnns\",\"benchmarkReferences\":[]}},\"id\":\"yyuvtzrxzhclec\",\"name\":\"wtzqzcloyhy\",\"type\":\"pgidhzgyresgzsdt\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ScanResult response = - manager - .sqlVulnerabilityAssessmentScanResults() - .getWithResponse("akmhz", "hwahfbw", "hbnnxemv", "nuqqkotauratnicp", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("scle", response.properties().ruleId()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, response.properties().status()); - Assertions.assertEquals(true, response.properties().isTrimmed()); - Assertions.assertEquals("qlmfdg", response.properties().queryResults().get(0).get(0)); - Assertions.assertEquals("cwtewfhxwyrkb", response.properties().remediation().description()); - Assertions.assertEquals(false, response.properties().remediation().automated()); - Assertions.assertEquals("rynjpc", response.properties().remediation().portalLink()); - Assertions.assertEquals(RuleStatus.INTERNAL_ERROR, response.properties().baselineAdjustedResult().status()); - Assertions.assertEquals("ajubo", response.properties().ruleMetadata().ruleId()); - Assertions.assertEquals(RuleSeverity.LOW, response.properties().ruleMetadata().severity()); - Assertions.assertEquals("e", response.properties().ruleMetadata().category()); - Assertions.assertEquals(RuleType.BASELINE_EXPECTED, response.properties().ruleMetadata().ruleType()); - Assertions.assertEquals("ieikmwlaoklfnis", response.properties().ruleMetadata().title()); - Assertions.assertEquals("gucbmt", response.properties().ruleMetadata().description()); - Assertions.assertEquals("dscnns", response.properties().ruleMetadata().rationale()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListWithResponseMockTests.java deleted file mode 100644 index f2797e4b665f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScanResultsListWithResponseMockTests.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.ScanResults; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentScanResultsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"value\":[{\"id\":\"pmaxfnzlpqmpf\",\"name\":\"xef\",\"type\":\"ulbl\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ScanResults response = - manager - .sqlVulnerabilityAssessmentScanResults() - .listWithResponse("wbyorjplbchych", "kvy", "fbqvumkxqj", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetWithResponseMockTests.java deleted file mode 100644 index 603ffbe7c33f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansGetWithResponseMockTests.java +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Scan; -import com.azure.resourcemanager.security.models.ScanState; -import com.azure.resourcemanager.security.models.ScanTriggerType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentScansGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"triggerType\":\"OnDemand\",\"state\":\"InProgress\",\"server\":\"us\",\"database\":\"gqrnt\",\"sqlVersion\":\"mdrcjlvkrkegtyc\",\"startTime\":\"2021-08-13T12:29:36Z\",\"endTime\":\"2021-01-04T09:23:29Z\",\"highSeverityFailedRulesCount\":405343249,\"mediumSeverityFailedRulesCount\":659260002,\"lowSeverityFailedRulesCount\":1028016104,\"totalPassedRulesCount\":791044616,\"totalFailedRulesCount\":156375863,\"totalRulesCount\":882589849,\"isBaselineApplied\":true,\"lastScanTime\":\"2021-09-21T16:49:09Z\"},\"id\":\"bm\",\"name\":\"vsexduetb\",\"type\":\"pfczewxtrl\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Scan response = - manager - .sqlVulnerabilityAssessmentScans() - .getWithResponse("mkuuyiuy", "afixlxicwgpthd", "fmfzcfasfodropa", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals(ScanTriggerType.ON_DEMAND, response.properties().triggerType()); - Assertions.assertEquals(ScanState.IN_PROGRESS, response.properties().state()); - Assertions.assertEquals("us", response.properties().server()); - Assertions.assertEquals("gqrnt", response.properties().database()); - Assertions.assertEquals("mdrcjlvkrkegtyc", response.properties().sqlVersion()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-13T12:29:36Z"), response.properties().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-04T09:23:29Z"), response.properties().endTime()); - Assertions.assertEquals(405343249, response.properties().highSeverityFailedRulesCount()); - Assertions.assertEquals(659260002, response.properties().mediumSeverityFailedRulesCount()); - Assertions.assertEquals(1028016104, response.properties().lowSeverityFailedRulesCount()); - Assertions.assertEquals(791044616, response.properties().totalPassedRulesCount()); - Assertions.assertEquals(156375863, response.properties().totalFailedRulesCount()); - Assertions.assertEquals(882589849, response.properties().totalRulesCount()); - Assertions.assertEquals(true, response.properties().isBaselineApplied()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T16:49:09Z"), response.properties().lastScanTime()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListWithResponseMockTests.java deleted file mode 100644 index 5edd68000c75..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SqlVulnerabilityAssessmentScansListWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.Scans; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class SqlVulnerabilityAssessmentScansListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"id\":\"bthmsritj\",\"name\":\"uiggruno\",\"type\":\"fvua\"},{\"id\":\"thoivsdwsngk\",\"name\":\"f\",\"type\":\"hscj\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Scans response = - manager - .sqlVulnerabilityAssessmentScans() - .listWithResponse("bpxya", "kjpirgzxvbczw", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SuppressionAlertsScopeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SuppressionAlertsScopeTests.java deleted file mode 100644 index 0a6103a002fd..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/SuppressionAlertsScopeTests.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ScopeElement; -import com.azure.resourcemanager.security.models.SuppressionAlertsScope; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SuppressionAlertsScopeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SuppressionAlertsScope model = - BinaryData - .fromString( - "{\"allOf\":[{\"field\":\"pnnbjc\",\"\":{\"orsukokwbqp\":\"dataibbdaxconfoza\",\"hw\":\"datahlvnuuepzlr\"}}]}") - .toObject(SuppressionAlertsScope.class); - Assertions.assertEquals("pnnbjc", model.allOf().get(0).field()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SuppressionAlertsScope model = - new SuppressionAlertsScope() - .withAllOf(Arrays.asList(new ScopeElement().withField("pnnbjc").withAdditionalProperties(mapOf()))); - model = BinaryData.fromObject(model).toObject(SuppressionAlertsScope.class); - Assertions.assertEquals("pnnbjc", model.allOf().get(0).field()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TagsResourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TagsResourceTests.java deleted file mode 100644 index 714e9f1a31f6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TagsResourceTests.java +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TagsResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TagsResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TagsResource model = - BinaryData - .fromString("{\"tags\":{\"yoxgvcltbgsnc\":\"dokgjl\",\"htxfvgxbfsmxnehm\":\"hkjeszzhbi\"}}") - .toObject(TagsResource.class); - Assertions.assertEquals("dokgjl", model.tags().get("yoxgvcltbgsnc")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TagsResource model = - new TagsResource().withTags(mapOf("yoxgvcltbgsnc", "dokgjl", "htxfvgxbfsmxnehm", "hkjeszzhbi")); - model = BinaryData.fromObject(model).toObject(TagsResource.class); - Assertions.assertEquals("dokgjl", model.tags().get("yoxgvcltbgsnc")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TagsTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TagsTests.java deleted file mode 100644 index 0c1961837789..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TagsTests.java +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.Tags; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TagsTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Tags model = - BinaryData.fromString("{\"tags\":{\"vpkjpr\":\"qioknssxmojm\",\"ql\":\"kwcf\"}}").toObject(Tags.class); - Assertions.assertEquals("qioknssxmojm", model.tags().get("vpkjpr")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Tags model = new Tags().withTags(mapOf("vpkjpr", "qioknssxmojm", "ql", "kwcf")); - model = BinaryData.fromObject(model).toObject(Tags.class); - Assertions.assertEquals("qioknssxmojm", model.tags().get("vpkjpr")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskWithResponseMockTests.java deleted file mode 100644 index 0529913c20fb..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksGetResourceGroupLevelTaskWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecurityTask; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TasksGetResourceGroupLevelTaskWithResponseMockTests { - @Test - public void testGetResourceGroupLevelTaskWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"state\":\"disnuepywyjln\",\"creationTimeUtc\":\"2021-05-30T04:46:23Z\",\"securityTaskParameters\":{\"name\":\"ttdiia\",\"\":{}},\"lastStateChangeTimeUtc\":\"2021-04-13T20:18:06Z\",\"subState\":\"zjihweebiphr\"},\"id\":\"vcjwqwoqsratj\",\"name\":\"dhzybsp\",\"type\":\"jhfrzgdkkagv\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityTask response = - manager - .tasks() - .getResourceGroupLevelTaskWithResponse( - "yvliq", "ipsejbsvsia", "eswhd", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskWithResponseMockTests.java deleted file mode 100644 index be090fd559ea..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksGetSubscriptionLevelTaskWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecurityTask; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TasksGetSubscriptionLevelTaskWithResponseMockTests { - @Test - public void testGetSubscriptionLevelTaskWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"state\":\"uxweyslandkd\",\"creationTimeUtc\":\"2021-04-27T10:17:51Z\",\"securityTaskParameters\":{\"name\":\"nhghcga\",\"\":{}},\"lastStateChangeTimeUtc\":\"2021-10-31T20:43:11Z\",\"subState\":\"quox\"},\"id\":\"otire\",\"name\":\"mseobfsxstcyilbv\",\"type\":\"m\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - SecurityTask response = - manager - .tasks() - .getSubscriptionLevelTaskWithResponse("fm", "fgvqcpdw", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionMockTests.java deleted file mode 100644 index b34da88b652c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListByHomeRegionMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecurityTask; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TasksListByHomeRegionMockTests { - @Test - public void testListByHomeRegion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"state\":\"f\",\"creationTimeUtc\":\"2021-08-20T00:28:15Z\",\"securityTaskParameters\":{\"name\":\"pmomihz\",\"\":{}},\"lastStateChangeTimeUtc\":\"2021-03-14T23:39:17Z\",\"subState\":\"pkcdpreyxely\"},\"id\":\"cghf\",\"name\":\"rufssjyg\",\"type\":\"sfxrkbhammgm\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.tasks().listByHomeRegion("cdgzseznux", "euairaabmdlqjb", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupMockTests.java deleted file mode 100644 index 2430bfaaed61..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListByResourceGroupMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecurityTask; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TasksListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"state\":\"aqidoyzltgiomqo\",\"creationTimeUtc\":\"2021-08-16T07:59:27Z\",\"securityTaskParameters\":{\"name\":\"aeapfsergd\",\"\":{}},\"lastStateChangeTimeUtc\":\"2021-04-15T19:12:02Z\",\"subState\":\"acyh\"},\"id\":\"qwbp\",\"name\":\"qncjubkhjozfymcw\",\"type\":\"bupyv\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.tasks().listByResourceGroup("n", "abwmvogljsv", "pgidnw", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListMockTests.java deleted file mode 100644 index 032957052d88..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.SecurityTask; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TasksListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"state\":\"ewuyqa\",\"creationTimeUtc\":\"2021-07-02T03:18:38Z\",\"securityTaskParameters\":{\"name\":\"hgejkbvhhdaurgh\",\"\":{}},\"lastStateChangeTimeUtc\":\"2021-10-08T07:27:35Z\",\"subState\":\"xb\"},\"id\":\"hxjxjoezlqxrkdkn\",\"name\":\"obektmbozo\",\"type\":\"tzamicbig\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.tasks().list("ycqsxr", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateWithResponseMockTests.java deleted file mode 100644 index 7244dcfdbd3f..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksUpdateResourceGroupLevelTaskStateWithResponseMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.TaskUpdateActionType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TasksUpdateResourceGroupLevelTaskStateWithResponseMockTests { - @Test - public void testUpdateResourceGroupLevelTaskStateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .tasks() - .updateResourceGroupLevelTaskStateWithResponse( - "ukhsusmmorf", "zhwilzzh", "ijmri", TaskUpdateActionType.ACTIVATE, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateWithResponseMockTests.java deleted file mode 100644 index 624767ae25a9..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TasksUpdateSubscriptionLevelTaskStateWithResponseMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.TaskUpdateActionType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TasksUpdateSubscriptionLevelTaskStateWithResponseMockTests { - @Test - public void testUpdateSubscriptionLevelTaskStateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .tasks() - .updateSubscriptionLevelTaskStateWithResponse( - "xcjzlquze", "okjxebjvb", TaskUpdateActionType.START, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ThresholdCustomAlertRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ThresholdCustomAlertRuleTests.java deleted file mode 100644 index 62d6d2eb3584..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/ThresholdCustomAlertRuleTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ThresholdCustomAlertRule; -import org.junit.jupiter.api.Assertions; - -public final class ThresholdCustomAlertRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ThresholdCustomAlertRule model = - BinaryData - .fromString( - "{\"ruleType\":\"ThresholdCustomAlertRule\",\"minThreshold\":1382683860,\"maxThreshold\":1200482188,\"displayName\":\"yktz\",\"description\":\"u\",\"isEnabled\":false}") - .toObject(ThresholdCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1382683860, model.minThreshold()); - Assertions.assertEquals(1200482188, model.maxThreshold()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ThresholdCustomAlertRule model = - new ThresholdCustomAlertRule() - .withIsEnabled(false) - .withMinThreshold(1382683860) - .withMaxThreshold(1200482188); - model = BinaryData.fromObject(model).toObject(ThresholdCustomAlertRule.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(1382683860, model.minThreshold()); - Assertions.assertEquals(1200482188, model.maxThreshold()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TimeWindowCustomAlertRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TimeWindowCustomAlertRuleTests.java deleted file mode 100644 index ccde4814428a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TimeWindowCustomAlertRuleTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TimeWindowCustomAlertRule; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TimeWindowCustomAlertRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TimeWindowCustomAlertRule model = - BinaryData - .fromString( - "{\"ruleType\":\"TimeWindowCustomAlertRule\",\"timeWindowSize\":\"PT137H35S\",\"minThreshold\":80244831,\"maxThreshold\":925016585,\"displayName\":\"oo\",\"description\":\"xlzevgbmqjqabcy\",\"isEnabled\":true}") - .toObject(TimeWindowCustomAlertRule.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(80244831, model.minThreshold()); - Assertions.assertEquals(925016585, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT137H35S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TimeWindowCustomAlertRule model = - new TimeWindowCustomAlertRule() - .withIsEnabled(true) - .withMinThreshold(80244831) - .withMaxThreshold(925016585) - .withTimeWindowSize(Duration.parse("PT137H35S")); - model = BinaryData.fromObject(model).toObject(TimeWindowCustomAlertRule.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(80244831, model.minThreshold()); - Assertions.assertEquals(925016585, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT137H35S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesGetWithResponseMockTests.java deleted file mode 100644 index 35d234d6d6d7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesGetWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.TopologyResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TopologiesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"calculatedDateTime\":\"2021-08-30T18:57:53Z\",\"topologyResources\":[]},\"location\":\"dclacroczfmun\",\"id\":\"rkeluxzshxzezbzu\",\"name\":\"udl\",\"type\":\"vzske\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - TopologyResource response = - manager - .topologies() - .getWithResponse("vmuw", "xlniwmcpm", "rdlhvdvmiphbe", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesListByHomeRegionMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesListByHomeRegionMockTests.java deleted file mode 100644 index 4b6459828c6c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesListByHomeRegionMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.TopologyResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TopologiesListByHomeRegionMockTests { - @Test - public void testListByHomeRegion() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"calculatedDateTime\":\"2021-07-06T20:42:46Z\",\"topologyResources\":[]},\"location\":\"henigbeqngubab\",\"id\":\"jdeayscse\",\"name\":\"d\",\"type\":\"jemexmnv\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = - manager.topologies().listByHomeRegion("ptgongruat", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesListMockTests.java deleted file mode 100644 index 1287368ad914..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologiesListMockTests.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.TopologyResource; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TopologiesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"calculatedDateTime\":\"2021-05-08T00:20:23Z\",\"topologyResources\":[]},\"location\":\"hpqvcts\",\"id\":\"aeuhwwsknstvz\",\"name\":\"zhasupmlppdpgzvz\",\"type\":\"azvbkar\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.topologies().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyListTests.java deleted file mode 100644 index 25e1bcf5bbb7..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyListTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TopologyList; - -public final class TopologyListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopologyList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"calculatedDateTime\":\"2021-03-01T23:44:24Z\",\"topologyResources\":[]},\"location\":\"tuodxeszabbelaw\",\"id\":\"muaslzkw\",\"name\":\"rwoycqucwyh\",\"type\":\"hnomdrkywuh\"},{\"properties\":{\"calculatedDateTime\":\"2021-05-02T07:59:23Z\",\"topologyResources\":[]},\"location\":\"rutlwexxwlalniex\",\"id\":\"srzpgepqtybbww\",\"name\":\"gdakchz\",\"type\":\"vl\"},{\"properties\":{\"calculatedDateTime\":\"2021-05-06T06:22:36Z\",\"topologyResources\":[]},\"location\":\"cxkjibnxmysuxswq\",\"id\":\"ntvlwijpsttexo\",\"name\":\"qpwcyyufmh\",\"type\":\"uncuw\"},{\"properties\":{\"calculatedDateTime\":\"2021-11-18T23:48:24Z\",\"topologyResources\":[]},\"location\":\"dqzh\",\"id\":\"ctddun\",\"name\":\"ndy\",\"type\":\"pchrqbn\"}],\"nextLink\":\"rcgegydcwboxjum\"}") - .toObject(TopologyList.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopologyList model = new TopologyList(); - model = BinaryData.fromObject(model).toObject(TopologyList.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyResourceInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyResourceInnerTests.java deleted file mode 100644 index ed749716283b..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyResourceInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.TopologyResourceInner; - -public final class TopologyResourceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopologyResourceInner model = - BinaryData - .fromString( - "{\"properties\":{\"calculatedDateTime\":\"2021-09-17T20:28:14Z\",\"topologyResources\":[{\"resourceId\":\"r\",\"severity\":\"iouaubrjt\",\"recommendationsExist\":true,\"networkZones\":\"fuojrngif\",\"topologyScore\":193344927,\"location\":\"asccbiui\",\"parents\":[],\"children\":[]},{\"resourceId\":\"yjdfqwmky\",\"severity\":\"ufdvruz\",\"recommendationsExist\":true,\"networkZones\":\"j\",\"topologyScore\":617076882,\"location\":\"fnmdxotn\",\"parents\":[],\"children\":[]},{\"resourceId\":\"ugeyzihgrkyuiza\",\"severity\":\"nmfpp\",\"recommendationsExist\":false,\"networkZones\":\"evy\",\"topologyScore\":1052982888,\"location\":\"gzfc\",\"parents\":[],\"children\":[]}]},\"location\":\"mfg\",\"id\":\"eglqgleohibetn\",\"name\":\"uankrrfxeeeb\",\"type\":\"ij\"}") - .toObject(TopologyResourceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopologyResourceInner model = new TopologyResourceInner(); - model = BinaryData.fromObject(model).toObject(TopologyResourceInner.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyResourcePropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyResourcePropertiesTests.java deleted file mode 100644 index 84c62b3758b6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologyResourcePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.TopologyResourceProperties; - -public final class TopologyResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopologyResourceProperties model = - BinaryData - .fromString( - "{\"calculatedDateTime\":\"2020-12-30T06:35:30Z\",\"topologyResources\":[{\"resourceId\":\"qzbqqxlajrnwxa\",\"severity\":\"veh\",\"recommendationsExist\":false,\"networkZones\":\"xoafgaoqltfae\",\"topologyScore\":420432271,\"location\":\"mfgvxirpghriypo\",\"parents\":[],\"children\":[]},{\"resourceId\":\"h\",\"severity\":\"prlpy\",\"recommendationsExist\":false,\"networkZones\":\"iq\",\"topologyScore\":593641633,\"location\":\"xiitdfuxt\",\"parents\":[],\"children\":[]},{\"resourceId\":\"miybnn\",\"severity\":\"tgnljhnmgixhcmav\",\"recommendationsExist\":false,\"networkZones\":\"udorh\",\"topologyScore\":256597525,\"location\":\"prot\",\"parents\":[],\"children\":[]},{\"resourceId\":\"mbxhugcmjkav\",\"severity\":\"or\",\"recommendationsExist\":true,\"networkZones\":\"pmdtz\",\"topologyScore\":1527890487,\"location\":\"fvnz\",\"parents\":[],\"children\":[]}]}") - .toObject(TopologyResourceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopologyResourceProperties model = new TopologyResourceProperties(); - model = BinaryData.fromObject(model).toObject(TopologyResourceProperties.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceChildTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceChildTests.java deleted file mode 100644 index 3d4f4a528773..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceChildTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TopologySingleResourceChild; - -public final class TopologySingleResourceChildTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopologySingleResourceChild model = - BinaryData.fromString("{\"resourceId\":\"wxeqocljmygvkzqk\"}").toObject(TopologySingleResourceChild.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopologySingleResourceChild model = new TopologySingleResourceChild(); - model = BinaryData.fromObject(model).toObject(TopologySingleResourceChild.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceParentTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceParentTests.java deleted file mode 100644 index dae0912a3db5..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceParentTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TopologySingleResourceParent; - -public final class TopologySingleResourceParentTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopologySingleResourceParent model = - BinaryData.fromString("{\"resourceId\":\"inkfkbgbz\"}").toObject(TopologySingleResourceParent.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopologySingleResourceParent model = new TopologySingleResourceParent(); - model = BinaryData.fromObject(model).toObject(TopologySingleResourceParent.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceTests.java deleted file mode 100644 index 143697e2f7fa..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TopologySingleResourceTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TopologySingleResource; - -public final class TopologySingleResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TopologySingleResource model = - BinaryData - .fromString( - "{\"resourceId\":\"p\",\"severity\":\"pvpbdbzqgqqiheds\",\"recommendationsExist\":false,\"networkZones\":\"hmkyibc\",\"topologyScore\":1158410329,\"location\":\"sgqcwdho\",\"parents\":[{\"resourceId\":\"mcdzsufcohdxbz\"},{\"resourceId\":\"cmuapcvhd\"}],\"children\":[{\"resourceId\":\"qqxeyskon\"}]}") - .toObject(TopologySingleResource.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TopologySingleResource model = new TopologySingleResource(); - model = BinaryData.fromObject(model).toObject(TopologySingleResource.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TrackedResourceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TrackedResourceTests.java deleted file mode 100644 index 8cffc9562c84..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TrackedResourceTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TrackedResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TrackedResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TrackedResource model = - BinaryData - .fromString( - "{\"location\":\"rykqgaifmvikl\",\"kind\":\"dvk\",\"etag\":\"ejd\",\"tags\":{\"volvtn\":\"cvdsrhnj\"},\"id\":\"v\",\"name\":\"fzg\",\"type\":\"mjdftu\"}") - .toObject(TrackedResource.class); - Assertions.assertEquals("rykqgaifmvikl", model.location()); - Assertions.assertEquals("dvk", model.kind()); - Assertions.assertEquals("ejd", model.etag()); - Assertions.assertEquals("cvdsrhnj", model.tags().get("volvtn")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TrackedResource model = - new TrackedResource() - .withLocation("rykqgaifmvikl") - .withKind("dvk") - .withEtag("ejd") - .withTags(mapOf("volvtn", "cvdsrhnj")); - model = BinaryData.fromObject(model).toObject(TrackedResource.class); - Assertions.assertEquals("rykqgaifmvikl", model.location()); - Assertions.assertEquals("dvk", model.kind()); - Assertions.assertEquals("ejd", model.etag()); - Assertions.assertEquals("cvdsrhnj", model.tags().get("volvtn")); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TwinUpdatesNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TwinUpdatesNotInAllowedRangeTests.java deleted file mode 100644 index 08890053d5e6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/TwinUpdatesNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.TwinUpdatesNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class TwinUpdatesNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TwinUpdatesNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"TwinUpdatesNotInAllowedRange\",\"timeWindowSize\":\"PT111H16M9S\",\"minThreshold\":2122337466,\"maxThreshold\":634264746,\"displayName\":\"ntrpcaqkiof\",\"description\":\"tfmhklbnldpvcb\",\"isEnabled\":false}") - .toObject(TwinUpdatesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(2122337466, model.minThreshold()); - Assertions.assertEquals(634264746, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT111H16M9S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TwinUpdatesNotInAllowedRange model = - new TwinUpdatesNotInAllowedRange() - .withIsEnabled(false) - .withMinThreshold(2122337466) - .withMaxThreshold(634264746) - .withTimeWindowSize(Duration.parse("PT111H16M9S")); - model = BinaryData.fromObject(model).toObject(TwinUpdatesNotInAllowedRange.class); - Assertions.assertEquals(false, model.isEnabled()); - Assertions.assertEquals(2122337466, model.minThreshold()); - Assertions.assertEquals(634264746, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT111H16M9S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UnauthorizedOperationsNotInAllowedRangeTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UnauthorizedOperationsNotInAllowedRangeTests.java deleted file mode 100644 index bababf25f422..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UnauthorizedOperationsNotInAllowedRangeTests.java +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.UnauthorizedOperationsNotInAllowedRange; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class UnauthorizedOperationsNotInAllowedRangeTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UnauthorizedOperationsNotInAllowedRange model = - BinaryData - .fromString( - "{\"ruleType\":\"UnauthorizedOperationsNotInAllowedRange\",\"timeWindowSize\":\"PT231H33M53S\",\"minThreshold\":1033707853,\"maxThreshold\":395818123,\"displayName\":\"u\",\"description\":\"sqxutr\",\"isEnabled\":true}") - .toObject(UnauthorizedOperationsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1033707853, model.minThreshold()); - Assertions.assertEquals(395818123, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT231H33M53S"), model.timeWindowSize()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UnauthorizedOperationsNotInAllowedRange model = - new UnauthorizedOperationsNotInAllowedRange() - .withIsEnabled(true) - .withMinThreshold(1033707853) - .withMaxThreshold(395818123) - .withTimeWindowSize(Duration.parse("PT231H33M53S")); - model = BinaryData.fromObject(model).toObject(UnauthorizedOperationsNotInAllowedRange.class); - Assertions.assertEquals(true, model.isEnabled()); - Assertions.assertEquals(1033707853, model.minThreshold()); - Assertions.assertEquals(395818123, model.maxThreshold()); - Assertions.assertEquals(Duration.parse("PT231H33M53S"), model.timeWindowSize()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateIoTSecuritySolutionPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateIoTSecuritySolutionPropertiesTests.java deleted file mode 100644 index 57d80398cf96..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateIoTSecuritySolutionPropertiesTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.UpdateIoTSecuritySolutionProperties; -import com.azure.resourcemanager.security.models.RecommendationConfigStatus; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UpdateIoTSecuritySolutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateIoTSecuritySolutionProperties model = - BinaryData - .fromString( - "{\"userDefinedResources\":{\"query\":\"xdbabphlwr\",\"querySubscriptions\":[\"fkts\",\"hsucoc\"]},\"recommendationsConfiguration\":[{\"recommendationType\":\"IoT_PrivilegedDockerOptions\",\"name\":\"zt\",\"status\":\"Disabled\"},{\"recommendationType\":\"IoT_InconsistentModuleSettings\",\"name\":\"wrqpue\",\"status\":\"Enabled\"}]}") - .toObject(UpdateIoTSecuritySolutionProperties.class); - Assertions.assertEquals("xdbabphlwr", model.userDefinedResources().query()); - Assertions.assertEquals("fkts", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_PRIVILEGED_DOCKER_OPTIONS, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.DISABLED, model.recommendationsConfiguration().get(0).status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateIoTSecuritySolutionProperties model = - new UpdateIoTSecuritySolutionProperties() - .withUserDefinedResources( - new UserDefinedResourcesProperties() - .withQuery("xdbabphlwr") - .withQuerySubscriptions(Arrays.asList("fkts", "hsucoc"))) - .withRecommendationsConfiguration( - Arrays - .asList( - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_PRIVILEGED_DOCKER_OPTIONS) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_INCONSISTENT_MODULE_SETTINGS) - .withStatus(RecommendationConfigStatus.ENABLED))); - model = BinaryData.fromObject(model).toObject(UpdateIoTSecuritySolutionProperties.class); - Assertions.assertEquals("xdbabphlwr", model.userDefinedResources().query()); - Assertions.assertEquals("fkts", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_PRIVILEGED_DOCKER_OPTIONS, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.DISABLED, model.recommendationsConfiguration().get(0).status()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateIotSecuritySolutionDataTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateIotSecuritySolutionDataTests.java deleted file mode 100644 index 75a581c136e3..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UpdateIotSecuritySolutionDataTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.RecommendationConfigStatus; -import com.azure.resourcemanager.security.models.RecommendationConfigurationProperties; -import com.azure.resourcemanager.security.models.RecommendationType; -import com.azure.resourcemanager.security.models.UpdateIotSecuritySolutionData; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class UpdateIotSecuritySolutionDataTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UpdateIotSecuritySolutionData model = - BinaryData - .fromString( - "{\"properties\":{\"userDefinedResources\":{\"query\":\"cxgod\",\"querySubscriptions\":[\"fqkkr\",\"mpukgriw\"]},\"recommendationsConfiguration\":[{\"recommendationType\":\"IoT_PermissiveOutputFirewallRules\",\"name\":\"bxzpuzycisp\",\"status\":\"Enabled\"},{\"recommendationType\":\"IoT_VulnerableTLSCipherSuite\",\"name\":\"hmgkbrpyy\",\"status\":\"Enabled\"},{\"recommendationType\":\"IoT_OpenPorts\",\"name\":\"nuqqkpikadrgvt\",\"status\":\"Disabled\"},{\"recommendationType\":\"IoT_EdgeLoggingOptions\",\"name\":\"buynhijggm\",\"status\":\"Disabled\"}]},\"tags\":{\"zmhjrunmp\":\"iarbutrcvpna\",\"nkxmyskpbhenbtk\":\"ttdbhrbnl\",\"yxczfclh\":\"xywnytnrsynlqidy\"}}") - .toObject(UpdateIotSecuritySolutionData.class); - Assertions.assertEquals("iarbutrcvpna", model.tags().get("zmhjrunmp")); - Assertions.assertEquals("cxgod", model.userDefinedResources().query()); - Assertions.assertEquals("fqkkr", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_PERMISSIVE_OUTPUT_FIREWALL_RULES, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.ENABLED, model.recommendationsConfiguration().get(0).status()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UpdateIotSecuritySolutionData model = - new UpdateIotSecuritySolutionData() - .withTags( - mapOf("zmhjrunmp", "iarbutrcvpna", "nkxmyskpbhenbtk", "ttdbhrbnl", "yxczfclh", "xywnytnrsynlqidy")) - .withUserDefinedResources( - new UserDefinedResourcesProperties() - .withQuery("cxgod") - .withQuerySubscriptions(Arrays.asList("fqkkr", "mpukgriw"))) - .withRecommendationsConfiguration( - Arrays - .asList( - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_PERMISSIVE_OUTPUT_FIREWALL_RULES) - .withStatus(RecommendationConfigStatus.ENABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_VULNERABLE_TLSCIPHER_SUITE) - .withStatus(RecommendationConfigStatus.ENABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_OPEN_PORTS) - .withStatus(RecommendationConfigStatus.DISABLED), - new RecommendationConfigurationProperties() - .withRecommendationType(RecommendationType.IO_T_EDGE_LOGGING_OPTIONS) - .withStatus(RecommendationConfigStatus.DISABLED))); - model = BinaryData.fromObject(model).toObject(UpdateIotSecuritySolutionData.class); - Assertions.assertEquals("iarbutrcvpna", model.tags().get("zmhjrunmp")); - Assertions.assertEquals("cxgod", model.userDefinedResources().query()); - Assertions.assertEquals("fqkkr", model.userDefinedResources().querySubscriptions().get(0)); - Assertions - .assertEquals( - RecommendationType.IO_T_PERMISSIVE_OUTPUT_FIREWALL_RULES, - model.recommendationsConfiguration().get(0).recommendationType()); - Assertions - .assertEquals(RecommendationConfigStatus.ENABLED, model.recommendationsConfiguration().get(0).status()); - } - - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UserDefinedResourcesPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UserDefinedResourcesPropertiesTests.java deleted file mode 100644 index 46cdd8de9e60..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UserDefinedResourcesPropertiesTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.UserDefinedResourcesProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class UserDefinedResourcesPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserDefinedResourcesProperties model = - BinaryData - .fromString( - "{\"query\":\"lqdqgbiqylihka\",\"querySubscriptions\":[\"cktvfcivfsnkymuc\",\"qhjfbebr\",\"cxerf\",\"wutttxfvjrbi\"]}") - .toObject(UserDefinedResourcesProperties.class); - Assertions.assertEquals("lqdqgbiqylihka", model.query()); - Assertions.assertEquals("cktvfcivfsnkymuc", model.querySubscriptions().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserDefinedResourcesProperties model = - new UserDefinedResourcesProperties() - .withQuery("lqdqgbiqylihka") - .withQuerySubscriptions(Arrays.asList("cktvfcivfsnkymuc", "qhjfbebr", "cxerf", "wutttxfvjrbi")); - model = BinaryData.fromObject(model).toObject(UserDefinedResourcesProperties.class); - Assertions.assertEquals("lqdqgbiqylihka", model.query()); - Assertions.assertEquals("cktvfcivfsnkymuc", model.querySubscriptions().get(0)); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UserRecommendationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UserRecommendationTests.java deleted file mode 100644 index abb76e3d819a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/UserRecommendationTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.RecommendationAction; -import com.azure.resourcemanager.security.models.UserRecommendation; -import org.junit.jupiter.api.Assertions; - -public final class UserRecommendationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserRecommendation model = - BinaryData - .fromString("{\"username\":\"iv\",\"recommendationAction\":\"Remove\"}") - .toObject(UserRecommendation.class); - Assertions.assertEquals("iv", model.username()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.recommendationAction()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserRecommendation model = - new UserRecommendation().withUsername("iv").withRecommendationAction(RecommendationAction.REMOVE); - model = BinaryData.fromObject(model).toObject(UserRecommendation.class); - Assertions.assertEquals("iv", model.username()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.recommendationAction()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VaRuleTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VaRuleTests.java deleted file mode 100644 index 0421aa4e967c..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VaRuleTests.java +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.BenchmarkReference; -import com.azure.resourcemanager.security.models.QueryCheck; -import com.azure.resourcemanager.security.models.RuleSeverity; -import com.azure.resourcemanager.security.models.RuleType; -import com.azure.resourcemanager.security.models.VaRule; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class VaRuleTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VaRule model = - BinaryData - .fromString( - "{\"ruleId\":\"knaqlnuwig\",\"severity\":\"Low\",\"category\":\"ykwphvxzcwxhmpe\",\"ruleType\":\"NegativeList\",\"title\":\"exaonwivkcq\",\"description\":\"xhxknlc\",\"rationale\":\"mmkyu\",\"queryCheck\":{\"query\":\"ubyqj\",\"expectedResult\":[[\"fqfrkemyildudxja\"],[\"owvfdjkpdxph\",\"kk\",\"nmgzvyfijdkzuqnw\"],[\"thuqolyahluq\"],[\"ulsutrjbhxy\",\"fhyqezvqqugdrft\",\"cvexreuqu\",\"wtl\"]],\"columnNames\":[\"whreagkhyxvrq\",\"vbczsulmdg\",\"lmepjpf\"]},\"benchmarkReferences\":[{\"benchmark\":\"g\",\"reference\":\"ngpszngafpg\"},{\"benchmark\":\"kvec\",\"reference\":\"jcngoadyed\"},{\"benchmark\":\"rgjfoknubnoi\",\"reference\":\"kpztrgd\"}]}") - .toObject(VaRule.class); - Assertions.assertEquals("knaqlnuwig", model.ruleId()); - Assertions.assertEquals(RuleSeverity.LOW, model.severity()); - Assertions.assertEquals("ykwphvxzcwxhmpe", model.category()); - Assertions.assertEquals(RuleType.NEGATIVE_LIST, model.ruleType()); - Assertions.assertEquals("exaonwivkcq", model.title()); - Assertions.assertEquals("xhxknlc", model.description()); - Assertions.assertEquals("mmkyu", model.rationale()); - Assertions.assertEquals("ubyqj", model.queryCheck().query()); - Assertions.assertEquals("fqfrkemyildudxja", model.queryCheck().expectedResult().get(0).get(0)); - Assertions.assertEquals("whreagkhyxvrq", model.queryCheck().columnNames().get(0)); - Assertions.assertEquals("g", model.benchmarkReferences().get(0).benchmark()); - Assertions.assertEquals("ngpszngafpg", model.benchmarkReferences().get(0).reference()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VaRule model = - new VaRule() - .withRuleId("knaqlnuwig") - .withSeverity(RuleSeverity.LOW) - .withCategory("ykwphvxzcwxhmpe") - .withRuleType(RuleType.NEGATIVE_LIST) - .withTitle("exaonwivkcq") - .withDescription("xhxknlc") - .withRationale("mmkyu") - .withQueryCheck( - new QueryCheck() - .withQuery("ubyqj") - .withExpectedResult( - Arrays - .asList( - Arrays.asList("fqfrkemyildudxja"), - Arrays.asList("owvfdjkpdxph", "kk", "nmgzvyfijdkzuqnw"), - Arrays.asList("thuqolyahluq"), - Arrays.asList("ulsutrjbhxy", "fhyqezvqqugdrft", "cvexreuqu", "wtl"))) - .withColumnNames(Arrays.asList("whreagkhyxvrq", "vbczsulmdg", "lmepjpf"))) - .withBenchmarkReferences( - Arrays - .asList( - new BenchmarkReference().withBenchmark("g").withReference("ngpszngafpg"), - new BenchmarkReference().withBenchmark("kvec").withReference("jcngoadyed"), - new BenchmarkReference().withBenchmark("rgjfoknubnoi").withReference("kpztrgd"))); - model = BinaryData.fromObject(model).toObject(VaRule.class); - Assertions.assertEquals("knaqlnuwig", model.ruleId()); - Assertions.assertEquals(RuleSeverity.LOW, model.severity()); - Assertions.assertEquals("ykwphvxzcwxhmpe", model.category()); - Assertions.assertEquals(RuleType.NEGATIVE_LIST, model.ruleType()); - Assertions.assertEquals("exaonwivkcq", model.title()); - Assertions.assertEquals("xhxknlc", model.description()); - Assertions.assertEquals("mmkyu", model.rationale()); - Assertions.assertEquals("ubyqj", model.queryCheck().query()); - Assertions.assertEquals("fqfrkemyildudxja", model.queryCheck().expectedResult().get(0).get(0)); - Assertions.assertEquals("whreagkhyxvrq", model.queryCheck().columnNames().get(0)); - Assertions.assertEquals("g", model.benchmarkReferences().get(0).benchmark()); - Assertions.assertEquals("ngpszngafpg", model.benchmarkReferences().get(0).reference()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VendorReferenceTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VendorReferenceTests.java deleted file mode 100644 index 94a4ee055518..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VendorReferenceTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.VendorReference; - -public final class VendorReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VendorReference model = - BinaryData.fromString("{\"title\":\"vgjcodkkg\",\"link\":\"iytssikizbc\"}").toObject(VendorReference.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VendorReference model = new VendorReference(); - model = BinaryData.fromObject(model).toObject(VendorReference.class); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VmRecommendationTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VmRecommendationTests.java deleted file mode 100644 index d4bec69cb11a..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/VmRecommendationTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.models.ConfigurationStatus; -import com.azure.resourcemanager.security.models.EnforcementSupport; -import com.azure.resourcemanager.security.models.RecommendationAction; -import com.azure.resourcemanager.security.models.VmRecommendation; -import org.junit.jupiter.api.Assertions; - -public final class VmRecommendationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - VmRecommendation model = - BinaryData - .fromString( - "{\"configurationStatus\":\"Configured\",\"recommendationAction\":\"Remove\",\"resourceId\":\"euvyinzqodfvpgs\",\"enforcementSupport\":\"NotSupported\"}") - .toObject(VmRecommendation.class); - Assertions.assertEquals(ConfigurationStatus.CONFIGURED, model.configurationStatus()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.recommendationAction()); - Assertions.assertEquals("euvyinzqodfvpgs", model.resourceId()); - Assertions.assertEquals(EnforcementSupport.NOT_SUPPORTED, model.enforcementSupport()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - VmRecommendation model = - new VmRecommendation() - .withConfigurationStatus(ConfigurationStatus.CONFIGURED) - .withRecommendationAction(RecommendationAction.REMOVE) - .withResourceId("euvyinzqodfvpgs") - .withEnforcementSupport(EnforcementSupport.NOT_SUPPORTED); - model = BinaryData.fromObject(model).toObject(VmRecommendation.class); - Assertions.assertEquals(ConfigurationStatus.CONFIGURED, model.configurationStatus()); - Assertions.assertEquals(RecommendationAction.REMOVE, model.recommendationAction()); - Assertions.assertEquals("euvyinzqodfvpgs", model.resourceId()); - Assertions.assertEquals(EnforcementSupport.NOT_SUPPORTED, model.enforcementSupport()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingInnerTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingInnerTests.java deleted file mode 100644 index 6ca716b83905..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingInnerTests.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceSettingInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceSettingInner model = - BinaryData - .fromString( - "{\"properties\":{\"workspaceId\":\"fgbvfvpdbo\",\"scope\":\"acizsjqlhkrr\"},\"id\":\"bdeibqipqk\",\"name\":\"hvxndzwmkrefajpj\",\"type\":\"rwkq\"}") - .toObject(WorkspaceSettingInner.class); - Assertions.assertEquals("fgbvfvpdbo", model.workspaceId()); - Assertions.assertEquals("acizsjqlhkrr", model.scope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceSettingInner model = - new WorkspaceSettingInner().withWorkspaceId("fgbvfvpdbo").withScope("acizsjqlhkrr"); - model = BinaryData.fromObject(model).toObject(WorkspaceSettingInner.class); - Assertions.assertEquals("fgbvfvpdbo", model.workspaceId()); - Assertions.assertEquals("acizsjqlhkrr", model.scope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingListTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingListTests.java deleted file mode 100644 index b7a826ba15b6..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingListTests.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingInner; -import com.azure.resourcemanager.security.models.WorkspaceSettingList; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceSettingListTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceSettingList model = - BinaryData - .fromString( - "{\"value\":[{\"properties\":{\"workspaceId\":\"pv\",\"scope\":\"srp\"},\"id\":\"vu\",\"name\":\"zraehtwd\",\"type\":\"r\"},{\"properties\":{\"workspaceId\":\"swibyr\",\"scope\":\"dl\"},\"id\":\"h\",\"name\":\"hfwpracstwit\",\"type\":\"khevxccedc\"},{\"properties\":{\"workspaceId\":\"md\",\"scope\":\"odn\"},\"id\":\"zxltjcvn\",\"name\":\"ltiugcxnavv\",\"type\":\"xqi\"}],\"nextLink\":\"qunyowxwlmdjr\"}") - .toObject(WorkspaceSettingList.class); - Assertions.assertEquals("pv", model.value().get(0).workspaceId()); - Assertions.assertEquals("srp", model.value().get(0).scope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceSettingList model = - new WorkspaceSettingList() - .withValue( - Arrays - .asList( - new WorkspaceSettingInner().withWorkspaceId("pv").withScope("srp"), - new WorkspaceSettingInner().withWorkspaceId("swibyr").withScope("dl"), - new WorkspaceSettingInner().withWorkspaceId("md").withScope("odn"))); - model = BinaryData.fromObject(model).toObject(WorkspaceSettingList.class); - Assertions.assertEquals("pv", model.value().get(0).workspaceId()); - Assertions.assertEquals("srp", model.value().get(0).scope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingPropertiesTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingPropertiesTests.java deleted file mode 100644 index 25a68a0b242d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingPropertiesTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.security.fluent.models.WorkspaceSettingProperties; -import org.junit.jupiter.api.Assertions; - -public final class WorkspaceSettingPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - WorkspaceSettingProperties model = - BinaryData - .fromString("{\"workspaceId\":\"yhgbijtjivfx\",\"scope\":\"sjabibs\"}") - .toObject(WorkspaceSettingProperties.class); - Assertions.assertEquals("yhgbijtjivfx", model.workspaceId()); - Assertions.assertEquals("sjabibs", model.scope()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - WorkspaceSettingProperties model = - new WorkspaceSettingProperties().withWorkspaceId("yhgbijtjivfx").withScope("sjabibs"); - model = BinaryData.fromObject(model).toObject(WorkspaceSettingProperties.class); - Assertions.assertEquals("yhgbijtjivfx", model.workspaceId()); - Assertions.assertEquals("sjabibs", model.scope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateWithResponseMockTests.java deleted file mode 100644 index 129bd2d29e50..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsCreateWithResponseMockTests.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.WorkspaceSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceSettingsCreateWithResponseMockTests { - @Test - public void testCreateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"workspaceId\":\"pu\",\"scope\":\"zfe\"},\"id\":\"zjljmphfk\",\"name\":\"ezolgjzm\",\"type\":\"cuydoccnxshanz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - WorkspaceSetting response = - manager - .workspaceSettings() - .define("aciq") - .withWorkspaceId("jrlhiqlwixvtboug") - .withScope("xtndopgjttbasua") - .create(); - - Assertions.assertEquals("pu", response.workspaceId()); - Assertions.assertEquals("zfe", response.scope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteWithResponseMockTests.java deleted file mode 100644 index a7e527344cbc..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceSettingsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(204); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.workspaceSettings().deleteWithResponse("zvdajfwnncf", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetWithResponseMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetWithResponseMockTests.java deleted file mode 100644 index 54afbfaa0002..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsGetWithResponseMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.WorkspaceSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceSettingsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"workspaceId\":\"dfj\",\"scope\":\"i\"},\"id\":\"socwiqbuout\",\"name\":\"py\",\"type\":\"gleofjsbgbw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - WorkspaceSetting response = - manager.workspaceSettings().getWithResponse("eaqgrvgpomxpupd", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("dfj", response.workspaceId()); - Assertions.assertEquals("i", response.scope()); - } -} diff --git a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListMockTests.java b/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListMockTests.java deleted file mode 100644 index 63dac69d660d..000000000000 --- a/sdk/security/azure-resourcemanager-security/src/test/java/com/azure/resourcemanager/security/generated/WorkspaceSettingsListMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.security.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.security.SecurityManager; -import com.azure.resourcemanager.security.models.WorkspaceSetting; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class WorkspaceSettingsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"workspaceId\":\"kahpqhazynta\",\"scope\":\"ihnco\"},\"id\":\"mip\",\"name\":\"mliqmvlb\",\"type\":\"i\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - SecurityManager manager = - SecurityManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.workspaceSettings().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kahpqhazynta", response.iterator().next().workspaceId()); - Assertions.assertEquals("ihnco", response.iterator().next().scope()); - } -}