From 0cecccb564f603b5df7d7ba6f69be0ec7c0e2f2a Mon Sep 17 00:00:00 2001 From: Ihab Zhaika <139862870+Ihab-Zhaika@users.noreply.github.com> Date: Sun, 17 Sep 2023 16:54:13 +0300 Subject: [PATCH] Azure Security Center: update pricings to 2023/01/01 (#38480) --- .../CHANGELOG.md | 15 +- ...ceManager.SecurityCenter.netstandard2.0.cs | 56 +++- .../Sample_SecurityCenterPricingCollection.cs | 305 +++++++++++++++++- .../Sample_SecurityCenterPricingResource.cs | 166 +++++++++- .../ArmSecurityCenterModelFactory.cs | 37 ++- .../ExtensionOperationStatus.Serialization.cs | 43 +++ .../Models/ExtensionOperationStatus.cs | 32 ++ .../Models/ExtensionOperationStatusCode.cs | 51 +++ .../Generated/Models/IsExtensionEnabled.cs | 51 +++ .../Models/PlanExtension.Serialization.cs | 103 ++++++ .../src/Generated/Models/PlanExtension.cs | 99 ++++++ ...SecurityCenterPricingData.Serialization.cs | 37 ++- .../Models/SecurityCenterPricingTier.cs | 2 +- .../RestOperations/PricingsRestOperations.cs | 2 +- .../Generated/SecurityCenterPricingData.cs | 17 +- .../src/autorest.md | 11 +- 16 files changed, 992 insertions(+), 35 deletions(-) create mode 100644 sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExtensionOperationStatus.Serialization.cs create mode 100644 sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExtensionOperationStatus.cs create mode 100644 sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExtensionOperationStatusCode.cs create mode 100644 sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IsExtensionEnabled.cs create mode 100644 sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PlanExtension.Serialization.cs create mode 100644 sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PlanExtension.cs diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/CHANGELOG.md b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/CHANGELOG.md index 4effba7acccb2..000722fabda23 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/CHANGELOG.md +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/CHANGELOG.md @@ -1,21 +1,22 @@ # Release History -## 1.2.0-beta.3 (Unreleased) +## 1.2.0-beta.3 (2023-09-18) ### Features Added -### Breaking Changes - -### Bugs Fixed +- Bump api-version of `Pricings` to `2023-03-01`. ### Other Changes +- Upgraded Azure.Core from 1.32.0 to 1.35.0 +- Upgraded Azure.ResourceManager from 1.6.0 to 1.7.0 + ## 1.2.0-beta.2 (2023-06-02) -### Other Changes +### Features Added - Bump api-version of `SqlVulnerabilityAssessmentsScanOperations` to `2023-02-01-preview`. -- Bump api-version of `sqlVulnerabilityAssessmentsScanResultsOperations` to `2023-02-01-preview`. +- Bump api-version of `SqlVulnerabilityAssessmentsScanResultsOperations` to `2023-02-01-preview`. - Bump api-version of `SqlVulnerabilityAssessmentsBaselineRuleOperations` to `2023-02-01-preview`. ## 1.2.0-beta.1 (2023-05-31) @@ -84,4 +85,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, please refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). \ No newline at end of file diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/api/Azure.ResourceManager.SecurityCenter.netstandard2.0.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/api/Azure.ResourceManager.SecurityCenter.netstandard2.0.cs index 35189e39f1fad..09b357cfab6dd 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/api/Azure.ResourceManager.SecurityCenter.netstandard2.0.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/api/Azure.ResourceManager.SecurityCenter.netstandard2.0.cs @@ -1254,6 +1254,8 @@ protected SecurityCenterPricingCollection() { } public partial class SecurityCenterPricingData : Azure.ResourceManager.Models.ResourceData { public SecurityCenterPricingData() { } + public System.DateTimeOffset? EnabledOn { get { throw null; } } + public System.Collections.Generic.IList Extensions { get { throw null; } } public System.TimeSpan? FreeTrialRemainingTime { get { throw null; } } public bool? IsDeprecated { get { throw null; } } public Azure.ResourceManager.SecurityCenter.Models.SecurityCenterPricingTier? PricingTier { get { throw null; } set { } } @@ -2158,6 +2160,7 @@ public static partial class ArmSecurityCenterModelFactory public static Azure.ResourceManager.SecurityCenter.DeviceSecurityGroupData DeviceSecurityGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IEnumerable thresholdRules = null, System.Collections.Generic.IEnumerable timeWindowRules = null, System.Collections.Generic.IEnumerable allowlistRules = null, System.Collections.Generic.IEnumerable denylistRules = null) { throw null; } public static Azure.ResourceManager.SecurityCenter.Models.DirectMethodInvokesNotInAllowedRange DirectMethodInvokesNotInAllowedRange(string displayName = null, string description = null, bool isEnabled = false, int minThreshold = 0, int maxThreshold = 0, System.TimeSpan timeWindowSize = default(System.TimeSpan)) { throw null; } public static Azure.ResourceManager.SecurityCenter.Models.DiscoveredSecuritySolution DiscoveredSecuritySolution(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.SecurityCenter.Models.SecurityFamily securityFamily = default(Azure.ResourceManager.SecurityCenter.Models.SecurityFamily), string offer = null, string publisher = null, string sku = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } + public static Azure.ResourceManager.SecurityCenter.Models.ExtensionOperationStatus ExtensionOperationStatus(Azure.ResourceManager.SecurityCenter.Models.ExtensionOperationStatusCode? code = default(Azure.ResourceManager.SecurityCenter.Models.ExtensionOperationStatusCode?), string message = null) { throw null; } public static Azure.ResourceManager.SecurityCenter.Models.ExternalSecuritySolution ExternalSecuritySolution(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string kind = "Unknown", Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } public static Azure.ResourceManager.SecurityCenter.Models.FailedLocalLoginsNotInAllowedRange FailedLocalLoginsNotInAllowedRange(string displayName = null, string description = null, bool isEnabled = false, int minThreshold = 0, int maxThreshold = 0, System.TimeSpan timeWindowSize = default(System.TimeSpan)) { throw null; } public static Azure.ResourceManager.SecurityCenter.Models.FileUploadsNotInAllowedRange FileUploadsNotInAllowedRange(string displayName = null, string description = null, bool isEnabled = false, int minThreshold = 0, int maxThreshold = 0, System.TimeSpan timeWindowSize = default(System.TimeSpan)) { throw null; } @@ -2193,6 +2196,7 @@ public static partial class ArmSecurityCenterModelFactory public static Azure.ResourceManager.SecurityCenter.Models.MqttC2DMessagesNotInAllowedRange MqttC2DMessagesNotInAllowedRange(string displayName = null, string description = null, bool isEnabled = false, int minThreshold = 0, int maxThreshold = 0, System.TimeSpan timeWindowSize = default(System.TimeSpan)) { throw null; } public static Azure.ResourceManager.SecurityCenter.Models.MqttC2DRejectedMessagesNotInAllowedRange MqttC2DRejectedMessagesNotInAllowedRange(string displayName = null, string description = null, bool isEnabled = false, int minThreshold = 0, int maxThreshold = 0, System.TimeSpan timeWindowSize = default(System.TimeSpan)) { throw null; } public static Azure.ResourceManager.SecurityCenter.Models.MqttD2CMessagesNotInAllowedRange MqttD2CMessagesNotInAllowedRange(string displayName = null, string description = null, bool isEnabled = false, int minThreshold = 0, int maxThreshold = 0, System.TimeSpan timeWindowSize = default(System.TimeSpan)) { throw null; } + public static Azure.ResourceManager.SecurityCenter.Models.PlanExtension PlanExtension(string name = null, Azure.ResourceManager.SecurityCenter.Models.IsExtensionEnabled isEnabled = default(Azure.ResourceManager.SecurityCenter.Models.IsExtensionEnabled), System.Collections.Generic.IDictionary additionalExtensionProperties = null, Azure.ResourceManager.SecurityCenter.Models.ExtensionOperationStatus operationStatus = null) { throw null; } public static Azure.ResourceManager.SecurityCenter.Models.ProcessNotAllowed ProcessNotAllowed(string displayName = null, string description = null, bool isEnabled = false, Azure.ResourceManager.SecurityCenter.Models.SecurityValueType? valueType = default(Azure.ResourceManager.SecurityCenter.Models.SecurityValueType?), System.Collections.Generic.IEnumerable allowlistValues = null) { throw null; } public static Azure.ResourceManager.SecurityCenter.Models.QueuePurgesNotInAllowedRange QueuePurgesNotInAllowedRange(string displayName = null, string description = null, bool isEnabled = false, int minThreshold = 0, int maxThreshold = 0, System.TimeSpan timeWindowSize = default(System.TimeSpan)) { throw null; } public static Azure.ResourceManager.SecurityCenter.Models.RecommendationConfigurationProperties RecommendationConfigurationProperties(Azure.ResourceManager.SecurityCenter.Models.IotSecurityRecommendationType recommendationType = default(Azure.ResourceManager.SecurityCenter.Models.IotSecurityRecommendationType), string name = null, Azure.ResourceManager.SecurityCenter.Models.RecommendationConfigStatus status = default(Azure.ResourceManager.SecurityCenter.Models.RecommendationConfigStatus)) { throw null; } @@ -2219,7 +2223,7 @@ public static partial class ArmSecurityCenterModelFactory public static Azure.ResourceManager.SecurityCenter.Models.SecurityCenterAllowedConnection SecurityCenterAllowedConnection(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? calculatedOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable connectableResources = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } public static Azure.ResourceManager.SecurityCenter.Models.SecurityCenterCloudOffering SecurityCenterCloudOffering(string offeringType = "Unknown", string description = null) { throw null; } public static Azure.ResourceManager.SecurityCenter.SecurityCenterLocationData SecurityCenterLocationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.BinaryData properties = null) { throw null; } - public static Azure.ResourceManager.SecurityCenter.SecurityCenterPricingData SecurityCenterPricingData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.SecurityCenter.Models.SecurityCenterPricingTier? pricingTier = default(Azure.ResourceManager.SecurityCenter.Models.SecurityCenterPricingTier?), string subPlan = null, System.TimeSpan? freeTrialRemainingTime = default(System.TimeSpan?), bool? isDeprecated = default(bool?), System.Collections.Generic.IEnumerable replacedBy = null) { throw null; } + public static Azure.ResourceManager.SecurityCenter.SecurityCenterPricingData SecurityCenterPricingData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.SecurityCenter.Models.SecurityCenterPricingTier? pricingTier = default(Azure.ResourceManager.SecurityCenter.Models.SecurityCenterPricingTier?), string subPlan = null, System.TimeSpan? freeTrialRemainingTime = default(System.TimeSpan?), System.DateTimeOffset? enabledOn = default(System.DateTimeOffset?), bool? isDeprecated = default(bool?), System.Collections.Generic.IEnumerable replacedBy = null, System.Collections.Generic.IEnumerable extensions = null) { throw null; } public static Azure.ResourceManager.SecurityCenter.SecurityCloudConnectorData SecurityCloudConnectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.SecurityCenter.Models.HybridComputeSettingsProperties hybridComputeSettings = null, Azure.ResourceManager.SecurityCenter.Models.AuthenticationDetailsProperties authenticationDetails = null) { throw null; } public static Azure.ResourceManager.SecurityCenter.SecurityComplianceData SecurityComplianceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? assessedOn = default(System.DateTimeOffset?), int? resourceCount = default(int?), System.Collections.Generic.IEnumerable assessmentResult = null) { throw null; } public static Azure.ResourceManager.SecurityCenter.SecurityConnectorData SecurityConnectorData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string hierarchyIdentifier = null, System.DateTimeOffset? hierarchyIdentifierTrialEndOn = default(System.DateTimeOffset?), Azure.ResourceManager.SecurityCenter.Models.SecurityCenterCloudName? environmentName = default(Azure.ResourceManager.SecurityCenter.Models.SecurityCenterCloudName?), System.Collections.Generic.IEnumerable offerings = null, Azure.ResourceManager.SecurityCenter.Models.SecurityConnectorEnvironment environmentData = null, string kind = null, Azure.ETag? eTag = default(Azure.ETag?)) { throw null; } @@ -2793,6 +2797,30 @@ public partial class ExecuteRuleStatus internal ExecuteRuleStatus() { } public string OperationId { get { throw null; } } } + public partial class ExtensionOperationStatus + { + internal ExtensionOperationStatus() { } + public Azure.ResourceManager.SecurityCenter.Models.ExtensionOperationStatusCode? Code { get { throw null; } } + public string Message { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ExtensionOperationStatusCode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ExtensionOperationStatusCode(string value) { throw null; } + public static Azure.ResourceManager.SecurityCenter.Models.ExtensionOperationStatusCode Failed { get { throw null; } } + public static Azure.ResourceManager.SecurityCenter.Models.ExtensionOperationStatusCode Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.SecurityCenter.Models.ExtensionOperationStatusCode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.SecurityCenter.Models.ExtensionOperationStatusCode left, Azure.ResourceManager.SecurityCenter.Models.ExtensionOperationStatusCode right) { throw null; } + public static implicit operator Azure.ResourceManager.SecurityCenter.Models.ExtensionOperationStatusCode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.SecurityCenter.Models.ExtensionOperationStatusCode left, Azure.ResourceManager.SecurityCenter.Models.ExtensionOperationStatusCode right) { throw null; } + public override string ToString() { throw null; } + } public partial class ExternalSecuritySolution : Azure.ResourceManager.Models.ResourceData { public ExternalSecuritySolution() { } @@ -3203,6 +3231,24 @@ internal IotSeverityMetrics() { } public long? Low { get { throw null; } } public long? Medium { get { throw null; } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IsExtensionEnabled : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IsExtensionEnabled(string value) { throw null; } + public static Azure.ResourceManager.SecurityCenter.Models.IsExtensionEnabled False { get { throw null; } } + public static Azure.ResourceManager.SecurityCenter.Models.IsExtensionEnabled True { get { throw null; } } + public bool Equals(Azure.ResourceManager.SecurityCenter.Models.IsExtensionEnabled other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.SecurityCenter.Models.IsExtensionEnabled left, Azure.ResourceManager.SecurityCenter.Models.IsExtensionEnabled right) { throw null; } + public static implicit operator Azure.ResourceManager.SecurityCenter.Models.IsExtensionEnabled (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.SecurityCenter.Models.IsExtensionEnabled left, Azure.ResourceManager.SecurityCenter.Models.IsExtensionEnabled right) { throw null; } + public override string ToString() { throw null; } + } public partial class JitNetworkAccessPolicyInitiateContent { public JitNetworkAccessPolicyInitiateContent(System.Collections.Generic.IEnumerable virtualMachines) { } @@ -3435,6 +3481,14 @@ public PathRecommendation() { } public static bool operator !=(Azure.ResourceManager.SecurityCenter.Models.PathRecommendationFileType left, Azure.ResourceManager.SecurityCenter.Models.PathRecommendationFileType right) { throw null; } public override string ToString() { throw null; } } + public partial class PlanExtension + { + public PlanExtension(string name, Azure.ResourceManager.SecurityCenter.Models.IsExtensionEnabled isEnabled) { } + public System.Collections.Generic.IDictionary AdditionalExtensionProperties { get { throw null; } } + public Azure.ResourceManager.SecurityCenter.Models.IsExtensionEnabled IsEnabled { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.SecurityCenter.Models.ExtensionOperationStatus OperationStatus { get { throw null; } } + } public partial class ProcessNotAllowed : Azure.ResourceManager.SecurityCenter.Models.AllowlistCustomAlertRule { public ProcessNotAllowed(bool isEnabled, System.Collections.Generic.IEnumerable allowlistValues) : base (default(bool), default(System.Collections.Generic.IEnumerable)) { } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/samples/Generated/Samples/Sample_SecurityCenterPricingCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/samples/Generated/Samples/Sample_SecurityCenterPricingCollection.cs index 9d3dcf9a89c68..78bdd98770876 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/samples/Generated/Samples/Sample_SecurityCenterPricingCollection.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/samples/Generated/Samples/Sample_SecurityCenterPricingCollection.cs @@ -24,7 +24,7 @@ public partial class Sample_SecurityCenterPricingCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetPricingsOnSubscription() { - // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2022-03-01/examples/Pricings/ListPricings_example.json + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/ListPricings_example.json // this example is just showing the usage of "Pricings_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,12 +54,260 @@ public async Task GetAll_GetPricingsOnSubscription() Console.WriteLine($"Succeeded"); } - // Get pricings on subscription + // Get pricings on subscription - CloudPosture plan + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetPricingsOnSubscriptionCloudPosturePlan() + { + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameCloudPosture_example.json + // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this SecurityCenterPricingResource + SecurityCenterPricingCollection collection = subscriptionResource.GetSecurityCenterPricings(); + + // invoke the operation + string pricingName = "CloudPosture"; + SecurityCenterPricingResource result = await collection.GetAsync(pricingName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SecurityCenterPricingData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get pricings on subscription - CloudPosture plan + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetPricingsOnSubscriptionCloudPosturePlan() + { + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameCloudPosture_example.json + // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this SecurityCenterPricingResource + SecurityCenterPricingCollection collection = subscriptionResource.GetSecurityCenterPricings(); + + // invoke the operation + string pricingName = "CloudPosture"; + bool result = await collection.ExistsAsync(pricingName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get pricings on subscription - Containers plan [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetPricingsOnSubscription() + public async Task Get_GetPricingsOnSubscriptionContainersPlan() { - // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2022-03-01/examples/Pricings/GetPricingByName_example.json + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameContainers_example.json + // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this SecurityCenterPricingResource + SecurityCenterPricingCollection collection = subscriptionResource.GetSecurityCenterPricings(); + + // invoke the operation + string pricingName = "Containers"; + SecurityCenterPricingResource result = await collection.GetAsync(pricingName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SecurityCenterPricingData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get pricings on subscription - Containers plan + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetPricingsOnSubscriptionContainersPlan() + { + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameContainers_example.json + // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this SecurityCenterPricingResource + SecurityCenterPricingCollection collection = subscriptionResource.GetSecurityCenterPricings(); + + // invoke the operation + string pricingName = "Containers"; + bool result = await collection.ExistsAsync(pricingName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get pricings on subscription - Dns plan + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetPricingsOnSubscriptionDnsPlan() + { + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameDns_example.json + // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this SecurityCenterPricingResource + SecurityCenterPricingCollection collection = subscriptionResource.GetSecurityCenterPricings(); + + // invoke the operation + string pricingName = "Dns"; + SecurityCenterPricingResource result = await collection.GetAsync(pricingName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SecurityCenterPricingData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get pricings on subscription - Dns plan + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetPricingsOnSubscriptionDnsPlan() + { + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameDns_example.json + // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this SecurityCenterPricingResource + SecurityCenterPricingCollection collection = subscriptionResource.GetSecurityCenterPricings(); + + // invoke the operation + string pricingName = "Dns"; + bool result = await collection.ExistsAsync(pricingName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get pricings on subscription - StorageAccounts plan + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetPricingsOnSubscriptionStorageAccountsPlan() + { + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameStorageAccounts_example.json + // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this SecurityCenterPricingResource + SecurityCenterPricingCollection collection = subscriptionResource.GetSecurityCenterPricings(); + + // invoke the operation + string pricingName = "StorageAccounts"; + SecurityCenterPricingResource result = await collection.GetAsync(pricingName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SecurityCenterPricingData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get pricings on subscription - StorageAccounts plan + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetPricingsOnSubscriptionStorageAccountsPlan() + { + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameStorageAccounts_example.json + // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this SecurityCenterPricingResource + SecurityCenterPricingCollection collection = subscriptionResource.GetSecurityCenterPricings(); + + // invoke the operation + string pricingName = "StorageAccounts"; + bool result = await collection.ExistsAsync(pricingName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Get pricings on subscription - VirtualMachines plan + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetPricingsOnSubscriptionVirtualMachinesPlan() + { + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameVirtualMachines_example.json // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -87,12 +335,12 @@ public async Task Get_GetPricingsOnSubscription() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - // Get pricings on subscription + // Get pricings on subscription - VirtualMachines plan [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetPricingsOnSubscription() + public async Task Exists_GetPricingsOnSubscriptionVirtualMachinesPlan() { - // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2022-03-01/examples/Pricings/GetPricingByName_example.json + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameVirtualMachines_example.json // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -121,7 +369,7 @@ public async Task Exists_GetPricingsOnSubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_UpdatePricingOnSubscription() { - // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2022-03-01/examples/Pricings/PutPricingByName_example.json + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/PutPricingByName_example.json // this example is just showing the usage of "Pricings_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -139,11 +387,48 @@ public async Task CreateOrUpdate_UpdatePricingOnSubscription() SecurityCenterPricingCollection collection = subscriptionResource.GetSecurityCenterPricings(); // invoke the operation - string pricingName = "VirtualMachines"; + string pricingName = "CloudPosture"; + SecurityCenterPricingData data = new SecurityCenterPricingData() + { + PricingTier = SecurityCenterPricingTier.Standard, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, pricingName, data); + SecurityCenterPricingResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SecurityCenterPricingData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Update pricing on subscription - partial success + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_UpdatePricingOnSubscriptionPartialSuccess() + { + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/PutPricingByNamePartialSuccess_example.json + // this example is just showing the usage of "Pricings_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this SecurityCenterPricingResource + SecurityCenterPricingCollection collection = subscriptionResource.GetSecurityCenterPricings(); + + // invoke the operation + string pricingName = "CloudPosture"; SecurityCenterPricingData data = new SecurityCenterPricingData() { PricingTier = SecurityCenterPricingTier.Standard, - SubPlan = "P2", }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, pricingName, data); SecurityCenterPricingResource result = lro.Value; diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/samples/Generated/Samples/Sample_SecurityCenterPricingResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/samples/Generated/Samples/Sample_SecurityCenterPricingResource.cs index aeba7fd335302..d64e39c530d0f 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/samples/Generated/Samples/Sample_SecurityCenterPricingResource.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/samples/Generated/Samples/Sample_SecurityCenterPricingResource.cs @@ -18,12 +18,132 @@ namespace Azure.ResourceManager.SecurityCenter.Samples { public partial class Sample_SecurityCenterPricingResource { - // Get pricings on subscription + // Get pricings on subscription - CloudPosture plan [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetPricingsOnSubscription() + public async Task Get_GetPricingsOnSubscriptionCloudPosturePlan() { - // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2022-03-01/examples/Pricings/GetPricingByName_example.json + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameCloudPosture_example.json + // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SecurityCenterPricingResource created on azure + // for more information of creating SecurityCenterPricingResource, please refer to the document of SecurityCenterPricingResource + string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; + string pricingName = "CloudPosture"; + ResourceIdentifier securityCenterPricingResourceId = SecurityCenterPricingResource.CreateResourceIdentifier(subscriptionId, pricingName); + SecurityCenterPricingResource securityCenterPricing = client.GetSecurityCenterPricingResource(securityCenterPricingResourceId); + + // invoke the operation + SecurityCenterPricingResource result = await securityCenterPricing.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SecurityCenterPricingData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get pricings on subscription - Containers plan + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetPricingsOnSubscriptionContainersPlan() + { + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameContainers_example.json + // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SecurityCenterPricingResource created on azure + // for more information of creating SecurityCenterPricingResource, please refer to the document of SecurityCenterPricingResource + string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; + string pricingName = "Containers"; + ResourceIdentifier securityCenterPricingResourceId = SecurityCenterPricingResource.CreateResourceIdentifier(subscriptionId, pricingName); + SecurityCenterPricingResource securityCenterPricing = client.GetSecurityCenterPricingResource(securityCenterPricingResourceId); + + // invoke the operation + SecurityCenterPricingResource result = await securityCenterPricing.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SecurityCenterPricingData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get pricings on subscription - Dns plan + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetPricingsOnSubscriptionDnsPlan() + { + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameDns_example.json + // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SecurityCenterPricingResource created on azure + // for more information of creating SecurityCenterPricingResource, please refer to the document of SecurityCenterPricingResource + string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; + string pricingName = "Dns"; + ResourceIdentifier securityCenterPricingResourceId = SecurityCenterPricingResource.CreateResourceIdentifier(subscriptionId, pricingName); + SecurityCenterPricingResource securityCenterPricing = client.GetSecurityCenterPricingResource(securityCenterPricingResourceId); + + // invoke the operation + SecurityCenterPricingResource result = await securityCenterPricing.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SecurityCenterPricingData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get pricings on subscription - StorageAccounts plan + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetPricingsOnSubscriptionStorageAccountsPlan() + { + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameStorageAccounts_example.json + // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SecurityCenterPricingResource created on azure + // for more information of creating SecurityCenterPricingResource, please refer to the document of SecurityCenterPricingResource + string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; + string pricingName = "StorageAccounts"; + ResourceIdentifier securityCenterPricingResourceId = SecurityCenterPricingResource.CreateResourceIdentifier(subscriptionId, pricingName); + SecurityCenterPricingResource securityCenterPricing = client.GetSecurityCenterPricingResource(securityCenterPricingResourceId); + + // invoke the operation + SecurityCenterPricingResource result = await securityCenterPricing.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SecurityCenterPricingData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get pricings on subscription - VirtualMachines plan + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetPricingsOnSubscriptionVirtualMachinesPlan() + { + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/GetPricingByNameVirtualMachines_example.json // this example is just showing the usage of "Pricings_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +173,7 @@ public async Task Get_GetPricingsOnSubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdatePricingOnSubscription() { - // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2022-03-01/examples/Pricings/PutPricingByName_example.json + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/PutPricingByName_example.json // this example is just showing the usage of "Pricings_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -64,7 +184,42 @@ public async Task Update_UpdatePricingOnSubscription() // this example assumes you already have this SecurityCenterPricingResource created on azure // for more information of creating SecurityCenterPricingResource, please refer to the document of SecurityCenterPricingResource string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; - string pricingName = "VirtualMachines"; + string pricingName = "CloudPosture"; + ResourceIdentifier securityCenterPricingResourceId = SecurityCenterPricingResource.CreateResourceIdentifier(subscriptionId, pricingName); + SecurityCenterPricingResource securityCenterPricing = client.GetSecurityCenterPricingResource(securityCenterPricingResourceId); + + // invoke the operation + SecurityCenterPricingData data = new SecurityCenterPricingData() + { + PricingTier = SecurityCenterPricingTier.Standard, + }; + ArmOperation lro = await securityCenterPricing.UpdateAsync(WaitUntil.Completed, data); + SecurityCenterPricingResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SecurityCenterPricingData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Update pricing on subscription - partial success + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdatePricingOnSubscriptionPartialSuccess() + { + // Generated from example definition: specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/PutPricingByNamePartialSuccess_example.json + // this example is just showing the usage of "Pricings_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SecurityCenterPricingResource created on azure + // for more information of creating SecurityCenterPricingResource, please refer to the document of SecurityCenterPricingResource + string subscriptionId = "20ff7fc3-e762-44dd-bd96-b71116dcdc23"; + string pricingName = "CloudPosture"; ResourceIdentifier securityCenterPricingResourceId = SecurityCenterPricingResource.CreateResourceIdentifier(subscriptionId, pricingName); SecurityCenterPricingResource securityCenterPricing = client.GetSecurityCenterPricingResource(securityCenterPricingResourceId); @@ -72,7 +227,6 @@ public async Task Update_UpdatePricingOnSubscription() SecurityCenterPricingData data = new SecurityCenterPricingData() { PricingTier = SecurityCenterPricingTier.Standard, - SubPlan = "P2", }; ArmOperation lro = await securityCenterPricing.UpdateAsync(WaitUntil.Completed, data); SecurityCenterPricingResource result = lro.Value; diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ArmSecurityCenterModelFactory.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ArmSecurityCenterModelFactory.cs index 332876492a0b8..0263582a39c38 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ArmSecurityCenterModelFactory.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ArmSecurityCenterModelFactory.cs @@ -97,17 +97,48 @@ public static ComplianceResultData ComplianceResultData(ResourceIdentifier id = /// The name. /// The resourceType. /// The systemData. - /// The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. + /// 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. /// 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. /// The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). + /// 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). /// Optional. True if the plan is deprecated. If there are replacing plans they will appear in `replacedBy` property. /// Optional. List of plans that replace this plan. This property exists only if this plan is deprecated. + /// Optional. List of extensions offered under a plan. /// A new instance for mocking. - public static SecurityCenterPricingData SecurityCenterPricingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, SecurityCenterPricingTier? pricingTier = null, string subPlan = null, TimeSpan? freeTrialRemainingTime = null, bool? isDeprecated = null, IEnumerable replacedBy = null) + public static SecurityCenterPricingData SecurityCenterPricingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, SecurityCenterPricingTier? pricingTier = null, string subPlan = null, TimeSpan? freeTrialRemainingTime = null, DateTimeOffset? enabledOn = null, bool? isDeprecated = null, IEnumerable replacedBy = null, IEnumerable extensions = null) { replacedBy ??= new List(); + extensions ??= new List(); - return new SecurityCenterPricingData(id, name, resourceType, systemData, pricingTier, subPlan, freeTrialRemainingTime, isDeprecated, replacedBy?.ToList()); + return new SecurityCenterPricingData(id, name, resourceType, systemData, pricingTier, subPlan, freeTrialRemainingTime, enabledOn, isDeprecated, replacedBy?.ToList(), extensions?.ToList()); + } + + /// Initializes a new instance of PlanExtension. + /// + /// 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. + /// + /// Indicates whether the extension is enabled. + /// Property values associated with the extension. + /// Optional. A status describing the success/failure of the extension's enablement/disablement operation. + /// A new instance for mocking. + public static PlanExtension PlanExtension(string name = null, IsExtensionEnabled isEnabled = default, IDictionary additionalExtensionProperties = null, ExtensionOperationStatus operationStatus = null) + { + additionalExtensionProperties ??= new Dictionary(); + + return new PlanExtension(name, isEnabled, additionalExtensionProperties, operationStatus); + } + + /// Initializes a new instance of ExtensionOperationStatus. + /// The operation status code. + /// Additional information regarding the success/failure of the operation. + /// A new instance for mocking. + public static ExtensionOperationStatus ExtensionOperationStatus(ExtensionOperationStatusCode? code = null, string message = null) + { + return new ExtensionOperationStatus(code, message); } /// Initializes a new instance of AdvancedThreatProtectionSettingData. diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExtensionOperationStatus.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExtensionOperationStatus.Serialization.cs new file mode 100644 index 0000000000000..60339ba0749c6 --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExtensionOperationStatus.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SecurityCenter.Models +{ + public partial class ExtensionOperationStatus + { + internal static ExtensionOperationStatus DeserializeExtensionOperationStatus(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional message = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + code = new ExtensionOperationStatusCode(property.Value.GetString()); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + } + return new ExtensionOperationStatus(Optional.ToNullable(code), message.Value); + } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExtensionOperationStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExtensionOperationStatus.cs new file mode 100644 index 0000000000000..bd25ca3c61bcf --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExtensionOperationStatus.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.SecurityCenter.Models +{ + /// A status describing the success/failure of the extension's enablement/disablement operation. + public partial class ExtensionOperationStatus + { + /// Initializes a new instance of ExtensionOperationStatus. + internal ExtensionOperationStatus() + { + } + + /// Initializes a new instance of ExtensionOperationStatus. + /// The operation status code. + /// Additional information regarding the success/failure of the operation. + internal ExtensionOperationStatus(ExtensionOperationStatusCode? code, string message) + { + Code = code; + Message = message; + } + + /// The operation status code. + public ExtensionOperationStatusCode? Code { get; } + /// Additional information regarding the success/failure of the operation. + public string Message { get; } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExtensionOperationStatusCode.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExtensionOperationStatusCode.cs new file mode 100644 index 0000000000000..5d043ac6f5469 --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExtensionOperationStatusCode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SecurityCenter.Models +{ + /// The operation status code. + public readonly partial struct ExtensionOperationStatusCode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ExtensionOperationStatusCode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + + /// Extension was created/updated successfully. + public static ExtensionOperationStatusCode Succeeded { get; } = new ExtensionOperationStatusCode(SucceededValue); + /// Extension was not created/updated successfully. See operation status message for more details. + public static ExtensionOperationStatusCode Failed { get; } = new ExtensionOperationStatusCode(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(ExtensionOperationStatusCode left, ExtensionOperationStatusCode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ExtensionOperationStatusCode left, ExtensionOperationStatusCode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ExtensionOperationStatusCode(string value) => new ExtensionOperationStatusCode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ExtensionOperationStatusCode other && Equals(other); + /// + public bool Equals(ExtensionOperationStatusCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IsExtensionEnabled.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IsExtensionEnabled.cs new file mode 100644 index 0000000000000..7b0160add7001 --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IsExtensionEnabled.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SecurityCenter.Models +{ + /// Indicates whether the extension is enabled. + public readonly partial struct IsExtensionEnabled : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IsExtensionEnabled(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TrueValue = "True"; + private const string FalseValue = "False"; + + /// Indicates the extension is enabled. + public static IsExtensionEnabled True { get; } = new IsExtensionEnabled(TrueValue); + /// Indicates the extension is disabled. + public static IsExtensionEnabled False { get; } = new IsExtensionEnabled(FalseValue); + /// Determines if two values are the same. + public static bool operator ==(IsExtensionEnabled left, IsExtensionEnabled right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IsExtensionEnabled left, IsExtensionEnabled right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator IsExtensionEnabled(string value) => new IsExtensionEnabled(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IsExtensionEnabled other && Equals(other); + /// + public bool Equals(IsExtensionEnabled other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PlanExtension.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PlanExtension.Serialization.cs new file mode 100644 index 0000000000000..18d2c2eeac9f6 --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PlanExtension.Serialization.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SecurityCenter.Models +{ + public partial class PlanExtension : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("isEnabled"u8); + writer.WriteStringValue(IsEnabled.ToString()); + if (Optional.IsCollectionDefined(AdditionalExtensionProperties)) + { + writer.WritePropertyName("additionalExtensionProperties"u8); + writer.WriteStartObject(); + foreach (var item in AdditionalExtensionProperties) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); +#endif + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); + } + + internal static PlanExtension DeserializePlanExtension(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IsExtensionEnabled isEnabled = default; + Optional> additionalExtensionProperties = default; + Optional operationStatus = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("isEnabled"u8)) + { + isEnabled = new IsExtensionEnabled(property.Value.GetString()); + continue; + } + if (property.NameEquals("additionalExtensionProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); + } + } + additionalExtensionProperties = dictionary; + continue; + } + if (property.NameEquals("operationStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operationStatus = ExtensionOperationStatus.DeserializeExtensionOperationStatus(property.Value); + continue; + } + } + return new PlanExtension(name, isEnabled, Optional.ToDictionary(additionalExtensionProperties), operationStatus.Value); + } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PlanExtension.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PlanExtension.cs new file mode 100644 index 0000000000000..04542a61b2344 --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PlanExtension.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.SecurityCenter.Models +{ + /// A plan's extension properties. + public partial class PlanExtension + { + /// Initializes a new instance of PlanExtension. + /// + /// 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. + /// + /// Indicates whether the extension is enabled. + /// is null. + public PlanExtension(string name, IsExtensionEnabled isEnabled) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + IsEnabled = isEnabled; + AdditionalExtensionProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of PlanExtension. + /// + /// 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. + /// + /// Indicates whether the extension is enabled. + /// Property values associated with the extension. + /// Optional. A status describing the success/failure of the extension's enablement/disablement operation. + internal PlanExtension(string name, IsExtensionEnabled isEnabled, IDictionary additionalExtensionProperties, ExtensionOperationStatus operationStatus) + { + Name = name; + IsEnabled = isEnabled; + AdditionalExtensionProperties = additionalExtensionProperties; + OperationStatus = operationStatus; + } + + /// + /// 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. + /// + public string Name { get; set; } + /// Indicates whether the extension is enabled. + public IsExtensionEnabled IsEnabled { get; set; } + /// + /// Property values associated with the extension. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formated json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public IDictionary AdditionalExtensionProperties { get; } + /// Optional. A status describing the success/failure of the extension's enablement/disablement operation. + public ExtensionOperationStatus OperationStatus { get; } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingData.Serialization.cs index c5151c4a6f42e..de4340a4850d9 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingData.Serialization.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingData.Serialization.cs @@ -31,6 +31,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("subPlan"u8); writer.WriteStringValue(SubPlan); } + if (Optional.IsCollectionDefined(Extensions)) + { + writer.WritePropertyName("extensions"u8); + writer.WriteStartArray(); + foreach (var item in Extensions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } writer.WriteEndObject(); writer.WriteEndObject(); } @@ -48,8 +58,10 @@ internal static SecurityCenterPricingData DeserializeSecurityCenterPricingData(J Optional pricingTier = default; Optional subPlan = default; Optional freeTrialRemainingTime = default; + Optional enablementTime = default; Optional deprecated = default; Optional> replacedBy = default; + Optional> extensions = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id"u8)) @@ -108,6 +120,15 @@ internal static SecurityCenterPricingData DeserializeSecurityCenterPricingData(J freeTrialRemainingTime = property0.Value.GetTimeSpan("P"); continue; } + if (property0.NameEquals("enablementTime"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enablementTime = property0.Value.GetDateTimeOffset("O"); + continue; + } if (property0.NameEquals("deprecated"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -131,11 +152,25 @@ internal static SecurityCenterPricingData DeserializeSecurityCenterPricingData(J replacedBy = array; continue; } + if (property0.NameEquals("extensions"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(PlanExtension.DeserializePlanExtension(item)); + } + extensions = array; + continue; + } } continue; } } - return new SecurityCenterPricingData(id, name, type, systemData.Value, Optional.ToNullable(pricingTier), subPlan.Value, Optional.ToNullable(freeTrialRemainingTime), Optional.ToNullable(deprecated), Optional.ToList(replacedBy)); + return new SecurityCenterPricingData(id, name, type, systemData.Value, Optional.ToNullable(pricingTier), subPlan.Value, Optional.ToNullable(freeTrialRemainingTime), Optional.ToNullable(enablementTime), Optional.ToNullable(deprecated), Optional.ToList(replacedBy), Optional.ToList(extensions)); } } } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingTier.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingTier.cs index 8817f44cda794..de87a8b18b518 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingTier.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingTier.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.SecurityCenter.Models { - /// The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. + /// 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 readonly partial struct SecurityCenterPricingTier : IEquatable { private readonly string _value; diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/PricingsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/PricingsRestOperations.cs index 3d9acc2e5274b..2176a7751babe 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/PricingsRestOperations.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/PricingsRestOperations.cs @@ -33,7 +33,7 @@ public PricingsRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-03-01"; + _apiVersion = apiVersion ?? "2023-01-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterPricingData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterPricingData.cs index 97e6187e62821..7a1b0e64408cd 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterPricingData.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterPricingData.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.SecurityCenter { /// /// A class representing the SecurityCenterPricing data model. - /// Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. + /// 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 partial class SecurityCenterPricingData : ResourceData { @@ -23,6 +23,7 @@ public partial class SecurityCenterPricingData : ResourceData public SecurityCenterPricingData() { ReplacedBy = new ChangeTrackingList(); + Extensions = new ChangeTrackingList(); } /// Initializes a new instance of SecurityCenterPricingData. @@ -30,29 +31,37 @@ public SecurityCenterPricingData() /// The name. /// The resourceType. /// The systemData. - /// The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. + /// 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. /// 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. /// The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). + /// 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). /// Optional. True if the plan is deprecated. If there are replacing plans they will appear in `replacedBy` property. /// Optional. List of plans that replace this plan. This property exists only if this plan is deprecated. - internal SecurityCenterPricingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SecurityCenterPricingTier? pricingTier, string subPlan, TimeSpan? freeTrialRemainingTime, bool? isDeprecated, IReadOnlyList replacedBy) : base(id, name, resourceType, systemData) + /// Optional. List of extensions offered under a plan. + internal SecurityCenterPricingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SecurityCenterPricingTier? pricingTier, string subPlan, TimeSpan? freeTrialRemainingTime, DateTimeOffset? enabledOn, bool? isDeprecated, IReadOnlyList replacedBy, IList extensions) : base(id, name, resourceType, systemData) { PricingTier = pricingTier; SubPlan = subPlan; FreeTrialRemainingTime = freeTrialRemainingTime; + EnabledOn = enabledOn; IsDeprecated = isDeprecated; ReplacedBy = replacedBy; + Extensions = extensions; } - /// The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. + /// 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 SecurityCenterPricingTier? PricingTier { get; set; } /// 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. public string SubPlan { get; set; } /// The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). public TimeSpan? FreeTrialRemainingTime { get; } + /// 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). + public DateTimeOffset? EnabledOn { get; } /// Optional. True if the plan is deprecated. If there are replacing plans they will appear in `replacedBy` property. public bool? IsDeprecated { get; } /// Optional. List of plans that replace this plan. This property exists only if this plan is deprecated. public IReadOnlyList ReplacedBy { get; } + /// Optional. List of extensions offered under a plan. + public IList Extensions { get; } } } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/autorest.md b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/autorest.md index 0f9818305fa29..5dca27fe03ead 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/autorest.md +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/autorest.md @@ -8,7 +8,8 @@ azure-arm: true csharp: true library-name: SecurityCenter namespace: Azure.ResourceManager.SecurityCenter -require: https://github.com/Azure/azure-rest-api-specs/blob/44e83346defd3d4ca99efade8b1ee90c67d9f249/specification/security/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/def187e2e78d7173d8fdd7f77740dd9719e1dfbf/specification/security/resource-manager/readme.md +#tag: package-composite-v3 output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -25,6 +26,9 @@ modelerfour: flatten-payloads: false deserialize-null-collection-as-null-value: true +#mgmt-debug: +# show-serialized-names: true + keep-orphaned-models: - ExternalSecuritySolutionKind @@ -72,6 +76,7 @@ rename-mapping: IoTSecuritySolutionModel: IotSecuritySolution MdeOnboardingData: MdeOnboarding Pricing.properties.deprecated: IsDeprecated + Pricing.properties.enablementTime: EnabledOn SecuritySubAssessment.properties.id: VulnerabilityId SecuritySubAssessment.properties.timeGenerated: GeneratedOn SecurityTask.properties.creationTimeUtc: CreatedOn @@ -238,6 +243,10 @@ rename-mapping: InformationType: SecurityInformationTypeInfo InformationType.enabled: IsEnabled Rank: SensitivityLabelRank + Extension: PlanExtension + Code: ExtensionOperationStatusCode + OperationStatus: ExtensionOperationStatus + IsEnabled: IsExtensionEnabled prepend-rp-prefix: - CloudName