diff --git a/sdk/security/azure-resourcemanager-security/CHANGELOG.md b/sdk/security/azure-resourcemanager-security/CHANGELOG.md index bd1644944ed74..4d0c0cfb88fee 100644 --- a/sdk/security/azure-resourcemanager-security/CHANGELOG.md +++ b/sdk/security/azure-resourcemanager-security/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.6 (Unreleased) +## 1.0.0-beta.1 (2023-04-18) + +- Azure Resource Manager Security client library for Java. This package contains Microsoft Azure SDK for Security Management SDK. API spec for Microsoft.Security (Azure Security Center) resource provider. Package tag package-composite-v3. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/security/azure-resourcemanager-security/README.md b/sdk/security/azure-resourcemanager-security/README.md index 960b33cd33f3f..014cf669049aa 100644 --- a/sdk/security/azure-resourcemanager-security/README.md +++ b/sdk/security/azure-resourcemanager-security/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-security - 1.0.0-beta.5 + 1.0.0-beta.6 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/security/azure-resourcemanager-security/SAMPLE.md b/sdk/security/azure-resourcemanager-security/SAMPLE.md index 3972495626d94..a875a743b16fa 100644 --- a/sdk/security/azure-resourcemanager-security/SAMPLE.md +++ b/sdk/security/azure-resourcemanager-security/SAMPLE.md @@ -262,6 +262,11 @@ - [Get](#regulatorycompliancestandards_get) - [List](#regulatorycompliancestandards_list) +## ResourceProvider + +- [GetSensitivitySettings](#resourceprovider_getsensitivitysettings) +- [UpdateSensitivitySettings](#resourceprovider_updatesensitivitysettings) + ## SecureScoreControlDefinitions - [List](#securescorecontroldefinitions_list) @@ -320,6 +325,10 @@ - [List](#securitysolutionsreferencedata_list) - [ListByHomeRegion](#securitysolutionsreferencedata_listbyhomeregion) +## SensitivitySettings + +- [List](#sensitivitysettings_list) + ## ServerVulnerabilityAssessment - [CreateOrUpdate](#servervulnerabilityassessment_createorupdate) @@ -4784,6 +4793,60 @@ public final class RegulatoryComplianceStandardsListSamples { } ``` +### ResourceProvider_GetSensitivitySettings + +```java +/** Samples for ResourceProvider GetSensitivitySettings. */ +public final class ResourceProviderGetSensitivitySettingsSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/SensitivitySettings/GetSensitivitySettings_example.json + */ + /** + * Sample code: Get sensitivity settings. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSensitivitySettings(com.azure.resourcemanager.security.SecurityManager manager) { + manager.resourceProviders().getSensitivitySettingsWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + +### ResourceProvider_UpdateSensitivitySettings + +```java +import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; +import java.util.Arrays; +import java.util.UUID; + +/** Samples for ResourceProvider UpdateSensitivitySettings. */ +public final class ResourceProviderUpdateSensitivitySettingsSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/SensitivitySettings/PutSensitivitySettings_example.json + */ + /** + * Sample code: Update sensitivity settings. + * + * @param manager Entry point to SecurityManager. + */ + public static void updateSensitivitySettings(com.azure.resourcemanager.security.SecurityManager manager) { + manager + .resourceProviders() + .updateSensitivitySettingsWithResponse( + new UpdateSensitivitySettingsRequest() + .withSensitiveInfoTypesIds( + Arrays + .asList( + UUID.fromString("f2f8a7a1-28c0-404b-9ab4-30a0a7af18cb"), + UUID.fromString("b452f22b-f87d-4f48-8490-ecf0873325b5"), + UUID.fromString("d59ee8b6-2618-404b-a5e7-aa377cd67543"))) + .withSensitivityThresholdLabelOrder(2.0F) + .withSensitivityThresholdLabelId(UUID.fromString("f2f8a7a1-28c0-404b-9ab4-30a0a7af18cb")), + com.azure.core.util.Context.NONE); + } +} +``` + ### SecureScoreControlDefinitions_List ```java @@ -5497,6 +5560,25 @@ public final class SecuritySolutionsReferenceDataListByHomeRegionSamples { } ``` +### SensitivitySettings_List + +```java +/** Samples for SensitivitySettings List. */ +public final class SensitivitySettingsListSamples { + /* + * x-ms-original-file: specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/SensitivitySettings/GetSensitivitySettingsList_example.json + */ + /** + * Sample code: Get sensitivity settings list. + * + * @param manager Entry point to SecurityManager. + */ + public static void getSensitivitySettingsList(com.azure.resourcemanager.security.SecurityManager manager) { + manager.sensitivitySettings().listWithResponse(com.azure.core.util.Context.NONE); + } +} +``` + ### ServerVulnerabilityAssessment_CreateOrUpdate ```java diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java index 80fd7da717a70..28710a6690923 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/SecurityManager.java @@ -65,6 +65,7 @@ import com.azure.resourcemanager.security.implementation.RegulatoryComplianceAssessmentsImpl; import com.azure.resourcemanager.security.implementation.RegulatoryComplianceControlsImpl; import com.azure.resourcemanager.security.implementation.RegulatoryComplianceStandardsImpl; +import com.azure.resourcemanager.security.implementation.ResourceProvidersImpl; import com.azure.resourcemanager.security.implementation.SecureScoreControlDefinitionsImpl; import com.azure.resourcemanager.security.implementation.SecureScoreControlsImpl; import com.azure.resourcemanager.security.implementation.SecureScoresImpl; @@ -76,6 +77,7 @@ import com.azure.resourcemanager.security.implementation.SecurityOperatorsImpl; import com.azure.resourcemanager.security.implementation.SecuritySolutionsImpl; import com.azure.resourcemanager.security.implementation.SecuritySolutionsReferenceDatasImpl; +import com.azure.resourcemanager.security.implementation.SensitivitySettingsImpl; import com.azure.resourcemanager.security.implementation.ServerVulnerabilityAssessmentsImpl; import com.azure.resourcemanager.security.implementation.SettingsImpl; import com.azure.resourcemanager.security.implementation.SoftwareInventoriesImpl; @@ -127,6 +129,7 @@ import com.azure.resourcemanager.security.models.RegulatoryComplianceAssessments; import com.azure.resourcemanager.security.models.RegulatoryComplianceControls; import com.azure.resourcemanager.security.models.RegulatoryComplianceStandards; +import com.azure.resourcemanager.security.models.ResourceProviders; import com.azure.resourcemanager.security.models.SecureScoreControlDefinitions; import com.azure.resourcemanager.security.models.SecureScoreControls; import com.azure.resourcemanager.security.models.SecureScores; @@ -137,6 +140,7 @@ import com.azure.resourcemanager.security.models.SecurityOperators; import com.azure.resourcemanager.security.models.SecuritySolutions; import com.azure.resourcemanager.security.models.SecuritySolutionsReferenceDatas; +import com.azure.resourcemanager.security.models.SensitivitySettings; import com.azure.resourcemanager.security.models.ServerVulnerabilityAssessments; import com.azure.resourcemanager.security.models.Settings; import com.azure.resourcemanager.security.models.SoftwareInventories; @@ -238,6 +242,10 @@ public final class SecurityManager { private Connectors connectors; + private ResourceProviders resourceProviders; + + private SensitivitySettings sensitivitySettings; + private Alerts alerts; private Settings settings; @@ -443,7 +451,7 @@ public SecurityManager authenticate(TokenCredential credential, AzureProfile pro .append("-") .append("com.azure.resourcemanager.security") .append("/") - .append("1.0.0-beta.5"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -1014,6 +1022,30 @@ public Connectors connectors() { return connectors; } + /** + * Gets the resource collection API of ResourceProviders. + * + * @return Resource collection API of ResourceProviders. + */ + public ResourceProviders resourceProviders() { + if (this.resourceProviders == null) { + this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this); + } + return resourceProviders; + } + + /** + * Gets the resource collection API of SensitivitySettings. + * + * @return Resource collection API of SensitivitySettings. + */ + public SensitivitySettings sensitivitySettings() { + if (this.sensitivitySettings == null) { + this.sensitivitySettings = new SensitivitySettingsImpl(clientObject.getSensitivitySettings(), this); + } + return sensitivitySettings; + } + /** * Gets the resource collection API of Alerts. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ResourceProvidersClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ResourceProvidersClient.java new file mode 100644 index 0000000000000..099992cef0fa5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/ResourceProvidersClient.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; +import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public interface ResourceProvidersClient { + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateSensitivitySettingsWithResponse( + UpdateSensitivitySettingsRequest sensitivitySettings, Context context); + + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetSensitivitySettingsResponseInner updateSensitivitySettings(UpdateSensitivitySettingsRequest sensitivitySettings); + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getSensitivitySettingsWithResponse(Context context); + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetSensitivitySettingsResponseInner getSensitivitySettings(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java index 3632a9b918151..e7f30beda23eb 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SecurityCenter.java @@ -324,6 +324,20 @@ public interface SecurityCenter { */ ConnectorsClient getConnectors(); + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + ResourceProvidersClient getResourceProviders(); + + /** + * Gets the SensitivitySettingsClient object to access its operations. + * + * @return the SensitivitySettingsClient object. + */ + SensitivitySettingsClient getSensitivitySettings(); + /** * Gets the AlertsClient object to access its operations. * diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java new file mode 100644 index 0000000000000..600866a35bde5 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/SensitivitySettingsClient.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; + +/** An instance of this class provides access to all the operations defined in SensitivitySettingsClient. */ +public interface SensitivitySettingsClient { + /** + * Gets a list with a single sensitivity settings resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list with a single sensitivity settings resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse(Context context); + + /** + * Gets a list with a single sensitivity settings resource. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list with a single sensitivity settings resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetSensitivitySettingsListResponseInner list(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java new file mode 100644 index 0000000000000..0e2bf79a0bd50 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsListResponseInner.java @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** A list with a single sensitivity settings resource. */ +@Fluent +public final class GetSensitivitySettingsListResponseInner { + /* + * The value property. + */ + @JsonProperty(value = "value") + private List value; + + /** Creates an instance of GetSensitivitySettingsListResponseInner class. */ + public GetSensitivitySettingsListResponseInner() { + } + + /** + * Get the value property: The value property. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The value property. + * + * @param value the value value to set. + * @return the GetSensitivitySettingsListResponseInner object itself. + */ + public GetSensitivitySettingsListResponseInner withValue(List value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java new file mode 100644 index 0000000000000..b1418837f06b8 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/fluent/models/GetSensitivitySettingsResponseInner.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponseProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Data sensitivity settings for sensitive data discovery. */ +@Fluent +public final class GetSensitivitySettingsResponseInner extends ProxyResource { + /* + * The sensitivity settings properties + */ + @JsonProperty(value = "properties") + private GetSensitivitySettingsResponseProperties properties; + + /** Creates an instance of GetSensitivitySettingsResponseInner class. */ + public GetSensitivitySettingsResponseInner() { + } + + /** + * Get the properties property: The sensitivity settings properties. + * + * @return the properties value. + */ + public GetSensitivitySettingsResponseProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The sensitivity settings properties. + * + * @param properties the properties value to set. + * @return the GetSensitivitySettingsResponseInner object itself. + */ + public GetSensitivitySettingsResponseInner withProperties(GetSensitivitySettingsResponseProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.java new file mode 100644 index 0000000000000..cf452cee7ba56 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsListResponseImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsListResponse; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponse; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class GetSensitivitySettingsListResponseImpl implements GetSensitivitySettingsListResponse { + private GetSensitivitySettingsListResponseInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + GetSensitivitySettingsListResponseImpl( + GetSensitivitySettingsListResponseInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public List value() { + List inner = this.innerModel().value(); + if (inner != null) { + return Collections + .unmodifiableList( + inner + .stream() + .map(inner1 -> new GetSensitivitySettingsResponseImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public GetSensitivitySettingsListResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java new file mode 100644 index 0000000000000..b0a80f10452ad --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/GetSensitivitySettingsResponseImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponse; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponseProperties; + +public final class GetSensitivitySettingsResponseImpl implements GetSensitivitySettingsResponse { + private GetSensitivitySettingsResponseInner innerObject; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + GetSensitivitySettingsResponseImpl( + GetSensitivitySettingsResponseInner innerObject, + com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public GetSensitivitySettingsResponseProperties properties() { + return this.innerModel().properties(); + } + + public GetSensitivitySettingsResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersClientImpl.java new file mode 100644 index 0000000000000..9b600fe64146a --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersClientImpl.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.security.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; +import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */ +public final class ResourceProvidersClientImpl implements ResourceProvidersClient { + /** The proxy service used to perform REST calls. */ + private final ResourceProvidersService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of ResourceProvidersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ResourceProvidersClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy.create(ResourceProvidersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterResourceProviders to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterResour") + public interface ResourceProvidersService { + @Headers({"Content-Type: application/json"}) + @Put("/providers/Microsoft.Security/sensitivitySettings/current") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> updateSensitivitySettings( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") UpdateSensitivitySettingsRequest sensitivitySettings, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Security/sensitivitySettings/current") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getSensitivitySettings( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateSensitivitySettingsWithResponseAsync( + UpdateSensitivitySettingsRequest sensitivitySettings) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (sensitivitySettings == null) { + return Mono + .error(new IllegalArgumentException("Parameter sensitivitySettings is required and cannot be null.")); + } else { + sensitivitySettings.validate(); + } + final String apiVersion = "2023-02-15-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .updateSensitivitySettings( + this.client.getEndpoint(), apiVersion, sensitivitySettings, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateSensitivitySettingsWithResponseAsync( + UpdateSensitivitySettingsRequest sensitivitySettings, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (sensitivitySettings == null) { + return Mono + .error(new IllegalArgumentException("Parameter sensitivitySettings is required and cannot be null.")); + } else { + sensitivitySettings.validate(); + } + final String apiVersion = "2023-02-15-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .updateSensitivitySettings(this.client.getEndpoint(), apiVersion, sensitivitySettings, accept, context); + } + + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateSensitivitySettingsAsync( + UpdateSensitivitySettingsRequest sensitivitySettings) { + return updateSensitivitySettingsWithResponseAsync(sensitivitySettings) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateSensitivitySettingsWithResponse( + UpdateSensitivitySettingsRequest sensitivitySettings, Context context) { + return updateSensitivitySettingsWithResponseAsync(sensitivitySettings, context).block(); + } + + /** + * Updates data sensitivity settings for sensitive data discovery. + * + * @param sensitivitySettings The data sensitivity settings to update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetSensitivitySettingsResponseInner updateSensitivitySettings( + UpdateSensitivitySettingsRequest sensitivitySettings) { + return updateSensitivitySettingsWithResponse(sensitivitySettings, Context.NONE).getValue(); + } + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSensitivitySettingsWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2023-02-15-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getSensitivitySettings(this.client.getEndpoint(), apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getSensitivitySettingsWithResponseAsync( + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2023-02-15-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getSensitivitySettings(this.client.getEndpoint(), apiVersion, accept, context); + } + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getSensitivitySettingsAsync() { + return getSensitivitySettingsWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSensitivitySettingsWithResponse(Context context) { + return getSensitivitySettingsWithResponseAsync(context).block(); + } + + /** + * Gets data sensitivity settings for sensitive data discovery. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data sensitivity settings for sensitive data discovery. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetSensitivitySettingsResponseInner getSensitivitySettings() { + return getSensitivitySettingsWithResponse(Context.NONE).getValue(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersImpl.java new file mode 100644 index 0000000000000..ea74d0b57fd07 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/ResourceProvidersImpl.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.ResourceProvidersClient; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsResponse; +import com.azure.resourcemanager.security.models.ResourceProviders; +import com.azure.resourcemanager.security.models.UpdateSensitivitySettingsRequest; + +public final class ResourceProvidersImpl implements ResourceProviders { + private static final ClientLogger LOGGER = new ClientLogger(ResourceProvidersImpl.class); + + private final ResourceProvidersClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public ResourceProvidersImpl( + ResourceProvidersClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response updateSensitivitySettingsWithResponse( + UpdateSensitivitySettingsRequest sensitivitySettings, Context context) { + Response inner = + this.serviceClient().updateSensitivitySettingsWithResponse(sensitivitySettings, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GetSensitivitySettingsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetSensitivitySettingsResponse updateSensitivitySettings( + UpdateSensitivitySettingsRequest sensitivitySettings) { + GetSensitivitySettingsResponseInner inner = this.serviceClient().updateSensitivitySettings(sensitivitySettings); + if (inner != null) { + return new GetSensitivitySettingsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getSensitivitySettingsWithResponse(Context context) { + Response inner = + this.serviceClient().getSensitivitySettingsWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GetSensitivitySettingsResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetSensitivitySettingsResponse getSensitivitySettings() { + GetSensitivitySettingsResponseInner inner = this.serviceClient().getSensitivitySettings(); + if (inner != null) { + return new GetSensitivitySettingsResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private ResourceProvidersClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java index 2f43f2f9a5532..7b368af77b2ca 100644 --- a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SecurityCenterImpl.java @@ -63,6 +63,7 @@ import com.azure.resourcemanager.security.fluent.RegulatoryComplianceAssessmentsClient; import com.azure.resourcemanager.security.fluent.RegulatoryComplianceControlsClient; import com.azure.resourcemanager.security.fluent.RegulatoryComplianceStandardsClient; +import com.azure.resourcemanager.security.fluent.ResourceProvidersClient; import com.azure.resourcemanager.security.fluent.SecureScoreControlDefinitionsClient; import com.azure.resourcemanager.security.fluent.SecureScoreControlsClient; import com.azure.resourcemanager.security.fluent.SecureScoresClient; @@ -74,6 +75,7 @@ import com.azure.resourcemanager.security.fluent.SecurityOperatorsClient; import com.azure.resourcemanager.security.fluent.SecuritySolutionsClient; import com.azure.resourcemanager.security.fluent.SecuritySolutionsReferenceDatasClient; +import com.azure.resourcemanager.security.fluent.SensitivitySettingsClient; import com.azure.resourcemanager.security.fluent.ServerVulnerabilityAssessmentsClient; import com.azure.resourcemanager.security.fluent.SettingsClient; import com.azure.resourcemanager.security.fluent.SoftwareInventoriesClient; @@ -648,6 +650,30 @@ public ConnectorsClient getConnectors() { return this.connectors; } + /** The ResourceProvidersClient object to access its operations. */ + private final ResourceProvidersClient resourceProviders; + + /** + * Gets the ResourceProvidersClient object to access its operations. + * + * @return the ResourceProvidersClient object. + */ + public ResourceProvidersClient getResourceProviders() { + return this.resourceProviders; + } + + /** The SensitivitySettingsClient object to access its operations. */ + private final SensitivitySettingsClient sensitivitySettings; + + /** + * Gets the SensitivitySettingsClient object to access its operations. + * + * @return the SensitivitySettingsClient object. + */ + public SensitivitySettingsClient getSensitivitySettings() { + return this.sensitivitySettings; + } + /** The AlertsClient object to access its operations. */ private final AlertsClient alerts; @@ -953,6 +979,8 @@ public SecurityOperatorsClient getSecurityOperators() { this.secureScoreControlDefinitions = new SecureScoreControlDefinitionsClientImpl(this); this.securitySolutions = new SecuritySolutionsClientImpl(this); this.connectors = new ConnectorsClientImpl(this); + this.resourceProviders = new ResourceProvidersClientImpl(this); + this.sensitivitySettings = new SensitivitySettingsClientImpl(this); this.alerts = new AlertsClientImpl(this); this.settings = new SettingsClientImpl(this); this.ingestionSettings = new IngestionSettingsClientImpl(this); diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java new file mode 100644 index 0000000000000..c771f61b3a11e --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsClientImpl.java @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.security.fluent.SensitivitySettingsClient; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in SensitivitySettingsClient. */ +public final class SensitivitySettingsClientImpl implements SensitivitySettingsClient { + /** The proxy service used to perform REST calls. */ + private final SensitivitySettingsService service; + + /** The service client containing this operation class. */ + private final SecurityCenterImpl client; + + /** + * Initializes an instance of SensitivitySettingsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SensitivitySettingsClientImpl(SecurityCenterImpl client) { + this.service = + RestProxy.create(SensitivitySettingsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SecurityCenterSensitivitySettings to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SecurityCenterSensit") + public interface SensitivitySettingsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Security/sensitivitySettings") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Gets a list with a single sensitivity settings resource. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list with a single sensitivity settings resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2023-02-15-preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a list with a single sensitivity settings resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list with a single sensitivity settings resource along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String apiVersion = "2023-02-15-preview"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.list(this.client.getEndpoint(), apiVersion, accept, context); + } + + /** + * Gets a list with a single sensitivity settings resource. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list with a single sensitivity settings resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync() { + return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a list with a single sensitivity settings resource. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list with a single sensitivity settings resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse(Context context) { + return listWithResponseAsync(context).block(); + } + + /** + * Gets a list with a single sensitivity settings resource. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a list with a single sensitivity settings resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetSensitivitySettingsListResponseInner list() { + return listWithResponse(Context.NONE).getValue(); + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java new file mode 100644 index 0000000000000..209d1528fb419 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/implementation/SensitivitySettingsImpl.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.security.fluent.SensitivitySettingsClient; +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; +import com.azure.resourcemanager.security.models.GetSensitivitySettingsListResponse; +import com.azure.resourcemanager.security.models.SensitivitySettings; + +public final class SensitivitySettingsImpl implements SensitivitySettings { + private static final ClientLogger LOGGER = new ClientLogger(SensitivitySettingsImpl.class); + + private final SensitivitySettingsClient innerClient; + + private final com.azure.resourcemanager.security.SecurityManager serviceManager; + + public SensitivitySettingsImpl( + SensitivitySettingsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new GetSensitivitySettingsListResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetSensitivitySettingsListResponse list() { + GetSensitivitySettingsListResponseInner inner = this.serviceClient().list(); + if (inner != null) { + return new GetSensitivitySettingsListResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private SensitivitySettingsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.security.SecurityManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java new file mode 100644 index 0000000000000..bf091ee530586 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/BuiltInInfoType.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.UUID; + +/** Pre-configured sensitive information type. */ +@Fluent +public final class BuiltInInfoType { + /* + * Display name of the info type + */ + @JsonProperty(value = "name") + private String name; + + /* + * Id of the info type + */ + @JsonProperty(value = "id") + private UUID id; + + /* + * Category of the built-in info type + */ + @JsonProperty(value = "type") + private String type; + + /** Creates an instance of BuiltInInfoType class. */ + public BuiltInInfoType() { + } + + /** + * Get the name property: Display name of the info type. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Display name of the info type. + * + * @param name the name value to set. + * @return the BuiltInInfoType object itself. + */ + public BuiltInInfoType withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id property: Id of the info type. + * + * @return the id value. + */ + public UUID id() { + return this.id; + } + + /** + * Set the id property: Id of the info type. + * + * @param id the id value to set. + * @return the BuiltInInfoType object itself. + */ + public BuiltInInfoType withId(UUID id) { + this.id = id; + return this; + } + + /** + * Get the type property: Category of the built-in info type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Category of the built-in info type. + * + * @param type the type value to set. + * @return the BuiltInInfoType object itself. + */ + public BuiltInInfoType withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java new file mode 100644 index 0000000000000..31d08ba42210b --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsListResponse.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner; +import java.util.List; + +/** An immutable client-side representation of GetSensitivitySettingsListResponse. */ +public interface GetSensitivitySettingsListResponse { + /** + * Gets the value property: The value property. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsListResponseInner object. + * + * @return the inner object. + */ + GetSensitivitySettingsListResponseInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java new file mode 100644 index 0000000000000..32e2c0f60f398 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponse.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner; + +/** An immutable client-side representation of GetSensitivitySettingsResponse. */ +public interface GetSensitivitySettingsResponse { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The sensitivity settings properties. + * + * @return the properties value. + */ + GetSensitivitySettingsResponseProperties properties(); + + /** + * Gets the inner com.azure.resourcemanager.security.fluent.models.GetSensitivitySettingsResponseInner object. + * + * @return the inner object. + */ + GetSensitivitySettingsResponseInner innerModel(); +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java new file mode 100644 index 0000000000000..3e261692951f2 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponseProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.UUID; + +/** The sensitivity settings properties. */ +@Fluent +public final class GetSensitivitySettingsResponseProperties { + /* + * List of selected sensitive info types' IDs. + */ + @JsonProperty(value = "sensitiveInfoTypesIds") + private List sensitiveInfoTypesIds; + + /* + * The order of the sensitivity threshold label. Any label at or above this order will be considered sensitive. If + * set to -1, sensitivity by labels is turned off + */ + @JsonProperty(value = "sensitivityThresholdLabelOrder") + private Float sensitivityThresholdLabelOrder; + + /* + * The id of the sensitivity threshold label. Any label at or above this rank will be considered sensitive. + */ + @JsonProperty(value = "sensitivityThresholdLabelId") + private UUID sensitivityThresholdLabelId; + + /* + * Microsoft information protection built-in and custom information types, labels, and integration status. + */ + @JsonProperty(value = "mipInformation") + private GetSensitivitySettingsResponsePropertiesMipInformation mipInformation; + + /** Creates an instance of GetSensitivitySettingsResponseProperties class. */ + public GetSensitivitySettingsResponseProperties() { + } + + /** + * Get the sensitiveInfoTypesIds property: List of selected sensitive info types' IDs. + * + * @return the sensitiveInfoTypesIds value. + */ + public List sensitiveInfoTypesIds() { + return this.sensitiveInfoTypesIds; + } + + /** + * Set the sensitiveInfoTypesIds property: List of selected sensitive info types' IDs. + * + * @param sensitiveInfoTypesIds the sensitiveInfoTypesIds value to set. + * @return the GetSensitivitySettingsResponseProperties object itself. + */ + public GetSensitivitySettingsResponseProperties withSensitiveInfoTypesIds(List sensitiveInfoTypesIds) { + this.sensitiveInfoTypesIds = sensitiveInfoTypesIds; + return this; + } + + /** + * Get the sensitivityThresholdLabelOrder property: The order of the sensitivity threshold label. Any label at or + * above this order will be considered sensitive. If set to -1, sensitivity by labels is turned off. + * + * @return the sensitivityThresholdLabelOrder value. + */ + public Float sensitivityThresholdLabelOrder() { + return this.sensitivityThresholdLabelOrder; + } + + /** + * Set the sensitivityThresholdLabelOrder property: The order of the sensitivity threshold label. Any label at or + * above this order will be considered sensitive. If set to -1, sensitivity by labels is turned off. + * + * @param sensitivityThresholdLabelOrder the sensitivityThresholdLabelOrder value to set. + * @return the GetSensitivitySettingsResponseProperties object itself. + */ + public GetSensitivitySettingsResponseProperties withSensitivityThresholdLabelOrder( + Float sensitivityThresholdLabelOrder) { + this.sensitivityThresholdLabelOrder = sensitivityThresholdLabelOrder; + return this; + } + + /** + * Get the sensitivityThresholdLabelId property: The id of the sensitivity threshold label. Any label at or above + * this rank will be considered sensitive. + * + * @return the sensitivityThresholdLabelId value. + */ + public UUID sensitivityThresholdLabelId() { + return this.sensitivityThresholdLabelId; + } + + /** + * Set the sensitivityThresholdLabelId property: The id of the sensitivity threshold label. Any label at or above + * this rank will be considered sensitive. + * + * @param sensitivityThresholdLabelId the sensitivityThresholdLabelId value to set. + * @return the GetSensitivitySettingsResponseProperties object itself. + */ + public GetSensitivitySettingsResponseProperties withSensitivityThresholdLabelId(UUID sensitivityThresholdLabelId) { + this.sensitivityThresholdLabelId = sensitivityThresholdLabelId; + return this; + } + + /** + * Get the mipInformation property: Microsoft information protection built-in and custom information types, labels, + * and integration status. + * + * @return the mipInformation value. + */ + public GetSensitivitySettingsResponsePropertiesMipInformation mipInformation() { + return this.mipInformation; + } + + /** + * Set the mipInformation property: Microsoft information protection built-in and custom information types, labels, + * and integration status. + * + * @param mipInformation the mipInformation value to set. + * @return the GetSensitivitySettingsResponseProperties object itself. + */ + public GetSensitivitySettingsResponseProperties withMipInformation( + GetSensitivitySettingsResponsePropertiesMipInformation mipInformation) { + this.mipInformation = mipInformation; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (mipInformation() != null) { + mipInformation().validate(); + } + } +} diff --git a/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java new file mode 100644 index 0000000000000..3f853cadea939 --- /dev/null +++ b/sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/GetSensitivitySettingsResponsePropertiesMipInformation.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.security.models; + +import com.azure.core.annotation.Fluent; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Microsoft information protection built-in and custom information types, labels, and integration status. */ +@Fluent +public final class GetSensitivitySettingsResponsePropertiesMipInformation { + /* + * Microsoft information protection integration status + */ + @JsonProperty(value = "mipIntegrationStatus") + private MipIntegrationStatus mipIntegrationStatus; + + /* + * List of Microsoft information protection sensitivity labels + */ + @JsonProperty(value = "labels") + private List