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 35189e39f1fa..8252bdb3653e 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? EnablementOn { 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.Extension Extension(string name = null, Azure.ResourceManager.SecurityCenter.Models.IsEnabled isEnabled = default(Azure.ResourceManager.SecurityCenter.Models.IsEnabled), System.Collections.Generic.IDictionary additionalExtensionProperties = null, Azure.ResourceManager.SecurityCenter.Models.OperationStatus operationStatus = 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.OperationStatus OperationStatus(Azure.ResourceManager.SecurityCenter.Models.Code? code = default(Azure.ResourceManager.SecurityCenter.Models.Code?), string message = 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? enablementOn = 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; } @@ -2442,6 +2446,24 @@ public CefSolutionProperties() { } public string Hostname { get { throw null; } set { } } public string LastEventReceived { get { throw null; } set { } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct Code : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public Code(string value) { throw null; } + public static Azure.ResourceManager.SecurityCenter.Models.Code Failed { get { throw null; } } + public static Azure.ResourceManager.SecurityCenter.Models.Code Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.SecurityCenter.Models.Code 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.Code left, Azure.ResourceManager.SecurityCenter.Models.Code right) { throw null; } + public static implicit operator Azure.ResourceManager.SecurityCenter.Models.Code (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.SecurityCenter.Models.Code left, Azure.ResourceManager.SecurityCenter.Models.Code right) { throw null; } + public override string ToString() { throw null; } + } public partial class ComplianceSegment { internal ComplianceSegment() { } @@ -2793,6 +2815,14 @@ public partial class ExecuteRuleStatus internal ExecuteRuleStatus() { } public string OperationId { get { throw null; } } } + public partial class Extension + { + public Extension(string name, Azure.ResourceManager.SecurityCenter.Models.IsEnabled isEnabled) { } + public System.Collections.Generic.IDictionary AdditionalExtensionProperties { get { throw null; } } + public Azure.ResourceManager.SecurityCenter.Models.IsEnabled IsEnabled { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.SecurityCenter.Models.OperationStatus OperationStatus { get { throw null; } } + } public partial class ExternalSecuritySolution : Azure.ResourceManager.Models.ResourceData { public ExternalSecuritySolution() { } @@ -3203,6 +3233,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 IsEnabled : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IsEnabled(string value) { throw null; } + public static Azure.ResourceManager.SecurityCenter.Models.IsEnabled False { get { throw null; } } + public static Azure.ResourceManager.SecurityCenter.Models.IsEnabled True { get { throw null; } } + public bool Equals(Azure.ResourceManager.SecurityCenter.Models.IsEnabled 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.IsEnabled left, Azure.ResourceManager.SecurityCenter.Models.IsEnabled right) { throw null; } + public static implicit operator Azure.ResourceManager.SecurityCenter.Models.IsEnabled (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.SecurityCenter.Models.IsEnabled left, Azure.ResourceManager.SecurityCenter.Models.IsEnabled right) { throw null; } + public override string ToString() { throw null; } + } public partial class JitNetworkAccessPolicyInitiateContent { public JitNetworkAccessPolicyInitiateContent(System.Collections.Generic.IEnumerable virtualMachines) { } @@ -3400,6 +3448,12 @@ public partial class OnPremiseSqlResourceDetails : Azure.ResourceManager.Securit public string DatabaseName { get { throw null; } set { } } public string ServerName { get { throw null; } set { } } } + public partial class OperationStatus + { + internal OperationStatus() { } + public Azure.ResourceManager.SecurityCenter.Models.Code? Code { get { throw null; } } + public string Message { get { throw null; } } + } public partial class PathRecommendation { public PathRecommendation() { } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ArmSecurityCenterModelFactory.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ArmSecurityCenterModelFactory.cs index 332876492a0b..fc43d6a5bbb5 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? enablementOn = 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, enablementOn, isDeprecated, replacedBy?.ToList(), extensions?.ToList()); + } + + /// Initializes a new instance of Extension. + /// + /// 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 Extension Extension(string name = null, IsEnabled isEnabled = default, IDictionary additionalExtensionProperties = null, OperationStatus operationStatus = null) + { + additionalExtensionProperties ??= new Dictionary(); + + return new Extension(name, isEnabled, additionalExtensionProperties, operationStatus); + } + + /// Initializes a new instance of OperationStatus. + /// The operation status code. + /// Additional information regarding the success/failure of the operation. + /// A new instance for mocking. + public static OperationStatus OperationStatus(Code? code = null, string message = null) + { + return new OperationStatus(code, message); } /// Initializes a new instance of AdvancedThreatProtectionSettingData. diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Code.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Code.cs new file mode 100644 index 000000000000..9e959eb1b0aa --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Code.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 Code : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Code(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 Code Succeeded { get; } = new Code(SucceededValue); + /// Extension was not created/updated successfully. See operation status message for more details. + public static Code Failed { get; } = new Code(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(Code left, Code right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Code left, Code right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator Code(string value) => new Code(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Code other && Equals(other); + /// + public bool Equals(Code 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/Extension.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Extension.Serialization.cs new file mode 100644 index 000000000000..1bee8ae9cab6 --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Extension.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 Extension : 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 Extension DeserializeExtension(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IsEnabled 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 IsEnabled(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 = OperationStatus.DeserializeOperationStatus(property.Value); + continue; + } + } + return new Extension(name, isEnabled, Optional.ToDictionary(additionalExtensionProperties), operationStatus.Value); + } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Extension.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Extension.cs new file mode 100644 index 000000000000..6be041434279 --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Extension.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 Extension + { + /// Initializes a new instance of Extension. + /// + /// 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 Extension(string name, IsEnabled isEnabled) + { + Argument.AssertNotNull(name, nameof(name)); + + Name = name; + IsEnabled = isEnabled; + AdditionalExtensionProperties = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of Extension. + /// + /// 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 Extension(string name, IsEnabled isEnabled, IDictionary additionalExtensionProperties, OperationStatus 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 IsEnabled 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 OperationStatus OperationStatus { get; } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IsEnabled.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IsEnabled.cs new file mode 100644 index 000000000000..386ae0a5be5a --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IsEnabled.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 IsEnabled : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IsEnabled(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 IsEnabled True { get; } = new IsEnabled(TrueValue); + /// Indicates the extension is disabled. + public static IsEnabled False { get; } = new IsEnabled(FalseValue); + /// Determines if two values are the same. + public static bool operator ==(IsEnabled left, IsEnabled right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IsEnabled left, IsEnabled right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator IsEnabled(string value) => new IsEnabled(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IsEnabled other && Equals(other); + /// + public bool Equals(IsEnabled 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/OperationStatus.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OperationStatus.Serialization.cs new file mode 100644 index 000000000000..9e914a2c5720 --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OperationStatus.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 OperationStatus + { + internal static OperationStatus DeserializeOperationStatus(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 Code(property.Value.GetString()); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + } + return new OperationStatus(Optional.ToNullable(code), message.Value); + } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OperationStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OperationStatus.cs new file mode 100644 index 000000000000..df41802904a3 --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OperationStatus.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 OperationStatus + { + /// Initializes a new instance of OperationStatus. + internal OperationStatus() + { + } + + /// Initializes a new instance of OperationStatus. + /// The operation status code. + /// Additional information regarding the success/failure of the operation. + internal OperationStatus(Code? code, string message) + { + Code = code; + Message = message; + } + + /// The operation status code. + public Code? 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/SecurityCenterPricingData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingData.Serialization.cs index c5151c4a6f42..e53b424ffa92 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(Extension.DeserializeExtension(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 8817f44cda79..de87a8b18b51 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 3d9acc2e5274..2176a7751bab 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 97e6187e6282..10ac0e53e0c9 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? enablementOn, bool? isDeprecated, IReadOnlyList replacedBy, IList extensions) : base(id, name, resourceType, systemData) { PricingTier = pricingTier; SubPlan = subPlan; FreeTrialRemainingTime = freeTrialRemainingTime; + EnablementOn = enablementOn; 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? EnablementOn { 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 9a9f41b46b4a..8d5520256c96 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/autorest.md +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/autorest.md @@ -8,7 +8,7 @@ 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: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/security/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true tag: package-dotnet-sdk