diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotAlertTypesOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotAlertTypesOperations.cs index bfa0d7fc1dcfa..09bebb74b52e3 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotAlertTypesOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotAlertTypesOperations.cs @@ -96,7 +96,7 @@ public partial interface IIotAlertTypesOperations /// /// Thrown when a required parameter is null /// - Task> List1WithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListAtSubscriptionScopeWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get IoT alert type /// @@ -118,6 +118,6 @@ public partial interface IIotAlertTypesOperations /// /// Thrown when a required parameter is null /// - Task> Get1WithHttpMessagesAsync(string iotAlertTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetAtSubscriptionScopeWithHttpMessagesAsync(string iotAlertTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotAlertsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotAlertsOperations.cs index 54ad8b08ba937..847830d0968f2 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotAlertsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotAlertsOperations.cs @@ -141,7 +141,7 @@ public partial interface IIotAlertsOperations /// /// Thrown when a required parameter is null /// - Task>> List1WithHttpMessagesAsync(string scope, string minStartTimeUtc = default(string), string maxStartTimeUtc = default(string), string alertType = default(string), string deviceManagementType = default(string), string compromisedEntity = default(string), int? limit = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListAtScopeWithHttpMessagesAsync(string scope, string minStartTimeUtc = default(string), string maxStartTimeUtc = default(string), string alertType = default(string), string deviceManagementType = default(string), string compromisedEntity = default(string), int? limit = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get IoT alert /// @@ -168,7 +168,7 @@ public partial interface IIotAlertsOperations /// /// Thrown when a required parameter is null /// - Task> Get1WithHttpMessagesAsync(string scope, string iotAlertId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetAtScopeWithHttpMessagesAsync(string scope, string iotAlertId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List IoT alerts /// @@ -212,6 +212,6 @@ public partial interface IIotAlertsOperations /// /// Thrown when a required parameter is null /// - Task>> List1NextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListAtScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotDefenderSettingsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotDefenderSettingsOperations.cs index bed2a48cabac8..a1bdc65137c0a 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotDefenderSettingsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotDefenderSettingsOperations.cs @@ -15,6 +15,7 @@ namespace Microsoft.Azure.Management.Security using Models; using System.Collections; using System.Collections.Generic; + using System.IO; using System.Threading; using System.Threading.Tasks; @@ -122,5 +123,24 @@ public partial interface IIotDefenderSettingsOperations /// Thrown when a required parameter is null /// Task> PackageDownloadsMethodWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Download manager activation data defined for this subscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> DownloadManagerActivationWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotRecommendationTypesOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotRecommendationTypesOperations.cs index 98c8d92038671..fe7b6676c38c0 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotRecommendationTypesOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotRecommendationTypesOperations.cs @@ -96,7 +96,7 @@ public partial interface IIotRecommendationTypesOperations /// /// Thrown when a required parameter is null /// - Task> List1WithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ListAtSubscriptionScopeWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get IoT recommendation type /// @@ -118,6 +118,6 @@ public partial interface IIotRecommendationTypesOperations /// /// Thrown when a required parameter is null /// - Task> Get1WithHttpMessagesAsync(string iotRecommendationTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetAtSubscriptionScopeWithHttpMessagesAsync(string iotRecommendationTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotRecommendationsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotRecommendationsOperations.cs index 28e840a01ffa4..cc8ac7207fb0e 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotRecommendationsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotRecommendationsOperations.cs @@ -125,7 +125,7 @@ public partial interface IIotRecommendationsOperations /// /// Thrown when a required parameter is null /// - Task>> List1WithHttpMessagesAsync(string scope, string recommendationType = default(string), string deviceId = default(string), int? limit = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListAtScopeWithHttpMessagesAsync(string scope, string recommendationType = default(string), string deviceId = default(string), int? limit = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get IoT recommendation /// @@ -152,7 +152,7 @@ public partial interface IIotRecommendationsOperations /// /// Thrown when a required parameter is null /// - Task> Get1WithHttpMessagesAsync(string scope, string iotRecommendationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetAtScopeWithHttpMessagesAsync(string scope, string iotRecommendationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List IoT recommendations /// @@ -196,6 +196,6 @@ public partial interface IIotRecommendationsOperations /// /// Thrown when a required parameter is null /// - Task>> List1NextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListAtScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotSensorsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotSensorsOperations.cs index 4af820d975d93..0dc770886024a 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotSensorsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotSensorsOperations.cs @@ -72,7 +72,7 @@ public partial interface IIotSensorsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or update IoT sensor /// @@ -83,6 +83,12 @@ public partial interface IIotSensorsOperations /// /// Name of the IoT sensor /// + /// + /// TI Automatic mode status of the IoT sensor + /// + /// + /// Zone of the IoT sensor + /// /// /// The headers that will be added to request. /// @@ -98,7 +104,7 @@ public partial interface IIotSensorsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string scope, string iotSensorName, bool? tiAutomaticUpdates = default(bool?), string zone = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete IoT sensor /// @@ -148,5 +154,57 @@ public partial interface IIotSensorsOperations /// Thrown when a required parameter is null /// Task> DownloadActivationWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Download file for reset password of the sensor + /// + /// + /// Scope of the query (IoT Hub, + /// /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Name of the IoT sensor + /// + /// + /// The appliance id of the sensor. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> DownloadResetPasswordWithHttpMessagesAsync(string scope, string iotSensorName, string applianceId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Trigger threat intelligence package update + /// + /// + /// Scope of the query (IoT Hub, + /// /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Name of the IoT sensor + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task TriggerTiPackageUpdateWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotSitesOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotSitesOperations.cs new file mode 100644 index 0000000000000..f3812984e2b54 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotSitesOperations.cs @@ -0,0 +1,122 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// IotSitesOperations operations. + /// + public partial interface IIotSitesOperations + { + /// + /// List IoT sites + /// + /// + /// Scope of the query (IoT Hub, + /// /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get IoT site + /// + /// + /// Scope of the query (IoT Hub, + /// /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update IoT site + /// + /// + /// Scope of the query (IoT Hub, + /// /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Display name of the IoT site + /// + /// + /// Tags of the IoT site + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string scope, string displayName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete IoT site + /// + /// + /// Scope of the query (IoT Hub, + /// /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IOnPremiseIotSensorsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IOnPremiseIotSensorsOperations.cs index c0a284754602c..7c268a868213f 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IOnPremiseIotSensorsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IOnPremiseIotSensorsOperations.cs @@ -128,5 +128,30 @@ public partial interface IOnPremiseIotSensorsOperations /// Thrown when a required parameter is null /// Task> DownloadActivationWithHttpMessagesAsync(string onPremiseIotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Download file for reset password of the sensor + /// + /// + /// Name of the on-premise IoT sensor + /// + /// + /// The appliance id of the sensor. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> DownloadResetPasswordWithHttpMessagesAsync(string onPremiseIotSensorName, string applianceId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISecurityCenterClient.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISecurityCenterClient.cs index 9e8b01ad5fbd1..ad24ed17b0243 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISecurityCenterClient.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISecurityCenterClient.cs @@ -336,5 +336,10 @@ public partial interface ISecurityCenterClient : System.IDisposable /// IOnPremiseIotSensorsOperations OnPremiseIotSensors { get; } + /// + /// Gets the IIotSitesOperations. + /// + IIotSitesOperations IotSites { get; } + } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertTypesOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertTypesOperations.cs index 61c52ef08a17c..ebd39347b46b3 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertTypesOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertTypesOperations.cs @@ -517,7 +517,7 @@ internal IotAlertTypesOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> List1WithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListAtSubscriptionScopeWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -540,7 +540,7 @@ internal IotAlertTypesOperations(SecurityCenterClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List1", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAtSubscriptionScope", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -703,7 +703,7 @@ internal IotAlertTypesOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> Get1WithHttpMessagesAsync(string iotAlertTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAtSubscriptionScopeWithHttpMessagesAsync(string iotAlertTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -731,7 +731,7 @@ internal IotAlertTypesOperations(SecurityCenterClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("iotAlertTypeName", iotAlertTypeName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get1", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAtSubscriptionScope", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertTypesOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertTypesOperationsExtensions.cs index 8ee11c95c0f7f..4391cc6652088 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertTypesOperationsExtensions.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertTypesOperationsExtensions.cs @@ -117,9 +117,9 @@ public static IotAlertType Get(this IIotAlertTypesOperations operations, string /// /// The operations group for this extension method. /// - public static IotAlertTypeList List1(this IIotAlertTypesOperations operations) + public static IotAlertTypeList ListAtSubscriptionScope(this IIotAlertTypesOperations operations) { - return operations.List1Async().GetAwaiter().GetResult(); + return operations.ListAtSubscriptionScopeAsync().GetAwaiter().GetResult(); } /// @@ -131,9 +131,9 @@ public static IotAlertTypeList List1(this IIotAlertTypesOperations operations) /// /// The cancellation token. /// - public static async Task List1Async(this IIotAlertTypesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListAtSubscriptionScopeAsync(this IIotAlertTypesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.List1WithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAtSubscriptionScopeWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -148,9 +148,9 @@ public static IotAlertTypeList List1(this IIotAlertTypesOperations operations) /// /// Name of the alert type /// - public static IotAlertType Get1(this IIotAlertTypesOperations operations, string iotAlertTypeName) + public static IotAlertType GetAtSubscriptionScope(this IIotAlertTypesOperations operations, string iotAlertTypeName) { - return operations.Get1Async(iotAlertTypeName).GetAwaiter().GetResult(); + return operations.GetAtSubscriptionScopeAsync(iotAlertTypeName).GetAwaiter().GetResult(); } /// @@ -165,9 +165,9 @@ public static IotAlertType Get1(this IIotAlertTypesOperations operations, string /// /// The cancellation token. /// - public static async Task Get1Async(this IIotAlertTypesOperations operations, string iotAlertTypeName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAtSubscriptionScopeAsync(this IIotAlertTypesOperations operations, string iotAlertTypeName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.Get1WithHttpMessagesAsync(iotAlertTypeName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetAtSubscriptionScopeWithHttpMessagesAsync(iotAlertTypeName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertsOperations.cs index 27dff89706fdc..804613b7756d2 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertsOperations.cs @@ -592,7 +592,7 @@ internal IotAlertsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> List1WithHttpMessagesAsync(string scope, string minStartTimeUtc = default(string), string maxStartTimeUtc = default(string), string alertType = default(string), string deviceManagementType = default(string), string compromisedEntity = default(string), int? limit = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAtScopeWithHttpMessagesAsync(string scope, string minStartTimeUtc = default(string), string maxStartTimeUtc = default(string), string alertType = default(string), string deviceManagementType = default(string), string compromisedEntity = default(string), int? limit = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (scope == null) { @@ -616,7 +616,7 @@ internal IotAlertsOperations(SecurityCenterClient client) tracingParameters.Add("limit", limit); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List1", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAtScope", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -812,7 +812,7 @@ internal IotAlertsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> Get1WithHttpMessagesAsync(string scope, string iotAlertId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAtScopeWithHttpMessagesAsync(string scope, string iotAlertId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (scope == null) { @@ -834,7 +834,7 @@ internal IotAlertsOperations(SecurityCenterClient client) tracingParameters.Add("scope", scope); tracingParameters.Add("iotAlertId", iotAlertId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get1", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAtScope", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1171,7 +1171,7 @@ internal IotAlertsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> List1NextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAtScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1186,7 +1186,7 @@ internal IotAlertsOperations(SecurityCenterClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List1Next", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAtScopeNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertsOperationsExtensions.cs index 7228b17649abc..35e11cc55f910 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertsOperationsExtensions.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertsOperationsExtensions.cs @@ -180,9 +180,9 @@ public static IotAlert Get(this IIotAlertsOperations operations, string resource /// /// Skip token used for pagination /// - public static IPage List1(this IIotAlertsOperations operations, string scope, string minStartTimeUtc = default(string), string maxStartTimeUtc = default(string), string alertType = default(string), string deviceManagementType = default(string), string compromisedEntity = default(string), int? limit = default(int?), string skipToken = default(string)) + public static IPage ListAtScope(this IIotAlertsOperations operations, string scope, string minStartTimeUtc = default(string), string maxStartTimeUtc = default(string), string alertType = default(string), string deviceManagementType = default(string), string compromisedEntity = default(string), int? limit = default(int?), string skipToken = default(string)) { - return operations.List1Async(scope, minStartTimeUtc, maxStartTimeUtc, alertType, deviceManagementType, compromisedEntity, limit, skipToken).GetAwaiter().GetResult(); + return operations.ListAtScopeAsync(scope, minStartTimeUtc, maxStartTimeUtc, alertType, deviceManagementType, compromisedEntity, limit, skipToken).GetAwaiter().GetResult(); } /// @@ -221,9 +221,9 @@ public static IotAlert Get(this IIotAlertsOperations operations, string resource /// /// The cancellation token. /// - public static async Task> List1Async(this IIotAlertsOperations operations, string scope, string minStartTimeUtc = default(string), string maxStartTimeUtc = default(string), string alertType = default(string), string deviceManagementType = default(string), string compromisedEntity = default(string), int? limit = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAtScopeAsync(this IIotAlertsOperations operations, string scope, string minStartTimeUtc = default(string), string maxStartTimeUtc = default(string), string alertType = default(string), string deviceManagementType = default(string), string compromisedEntity = default(string), int? limit = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.List1WithHttpMessagesAsync(scope, minStartTimeUtc, maxStartTimeUtc, alertType, deviceManagementType, compromisedEntity, limit, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAtScopeWithHttpMessagesAsync(scope, minStartTimeUtc, maxStartTimeUtc, alertType, deviceManagementType, compromisedEntity, limit, skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -243,9 +243,9 @@ public static IotAlert Get(this IIotAlertsOperations operations, string resource /// /// Id of the alert /// - public static IotAlertModel Get1(this IIotAlertsOperations operations, string scope, string iotAlertId) + public static IotAlertModel GetAtScope(this IIotAlertsOperations operations, string scope, string iotAlertId) { - return operations.Get1Async(scope, iotAlertId).GetAwaiter().GetResult(); + return operations.GetAtScopeAsync(scope, iotAlertId).GetAwaiter().GetResult(); } /// @@ -265,9 +265,9 @@ public static IotAlertModel Get1(this IIotAlertsOperations operations, string sc /// /// The cancellation token. /// - public static async Task Get1Async(this IIotAlertsOperations operations, string scope, string iotAlertId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAtScopeAsync(this IIotAlertsOperations operations, string scope, string iotAlertId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.Get1WithHttpMessagesAsync(scope, iotAlertId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetAtScopeWithHttpMessagesAsync(scope, iotAlertId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -316,9 +316,9 @@ public static IPage ListNext(this IIotAlertsOperations operations, str /// /// The NextLink from the previous successful call to List operation. /// - public static IPage List1Next(this IIotAlertsOperations operations, string nextPageLink) + public static IPage ListAtScopeNext(this IIotAlertsOperations operations, string nextPageLink) { - return operations.List1NextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListAtScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -333,9 +333,9 @@ public static IPage List1Next(this IIotAlertsOperations operation /// /// The cancellation token. /// - public static async Task> List1NextAsync(this IIotAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAtScopeNextAsync(this IIotAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.List1NextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAtScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotDefenderSettingsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotDefenderSettingsOperations.cs index 40ddad2dc0772..40070cf82a9a4 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotDefenderSettingsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotDefenderSettingsOperations.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.Management.Security using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; + using System.IO; using System.Linq; using System.Net; using System.Net.Http; @@ -990,5 +991,175 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) return _result; } + /// + /// Download manager activation data defined for this subscription + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> DownloadManagerActivationWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + string apiVersion = "2020-08-06-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "DownloadManagerActivation", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default/downloadManagerActivation").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotDefenderSettingsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotDefenderSettingsOperationsExtensions.cs index caddc0e950490..dd2ad1cbf0957 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotDefenderSettingsOperationsExtensions.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotDefenderSettingsOperationsExtensions.cs @@ -15,6 +15,7 @@ namespace Microsoft.Azure.Management.Security using Models; using System.Collections; using System.Collections.Generic; + using System.IO; using System.Threading; using System.Threading.Tasks; @@ -174,5 +175,32 @@ public static PackageDownloads PackageDownloadsMethod(this IIotDefenderSettingsO } } + /// + /// Download manager activation data defined for this subscription + /// + /// + /// The operations group for this extension method. + /// + public static Stream DownloadManagerActivation(this IIotDefenderSettingsOperations operations) + { + return operations.DownloadManagerActivationAsync().GetAwaiter().GetResult(); + } + + /// + /// Download manager activation data defined for this subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task DownloadManagerActivationAsync(this IIotDefenderSettingsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + var _result = await operations.DownloadManagerActivationWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false); + _result.Request.Dispose(); + return _result.Body; + } + } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationTypesOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationTypesOperations.cs index 12d98eff4a188..68117efb0f39e 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationTypesOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationTypesOperations.cs @@ -517,7 +517,7 @@ internal IotRecommendationTypesOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> List1WithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListAtSubscriptionScopeWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -540,7 +540,7 @@ internal IotRecommendationTypesOperations(SecurityCenterClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List1", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAtSubscriptionScope", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -703,7 +703,7 @@ internal IotRecommendationTypesOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> Get1WithHttpMessagesAsync(string iotRecommendationTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAtSubscriptionScopeWithHttpMessagesAsync(string iotRecommendationTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -731,7 +731,7 @@ internal IotRecommendationTypesOperations(SecurityCenterClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("iotRecommendationTypeName", iotRecommendationTypeName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get1", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAtSubscriptionScope", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationTypesOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationTypesOperationsExtensions.cs index dfccadbecb6ce..74f5ae8a9c455 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationTypesOperationsExtensions.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationTypesOperationsExtensions.cs @@ -117,9 +117,9 @@ public static IotRecommendationType Get(this IIotRecommendationTypesOperations o /// /// The operations group for this extension method. /// - public static IotRecommendationTypeList List1(this IIotRecommendationTypesOperations operations) + public static IotRecommendationTypeList ListAtSubscriptionScope(this IIotRecommendationTypesOperations operations) { - return operations.List1Async().GetAwaiter().GetResult(); + return operations.ListAtSubscriptionScopeAsync().GetAwaiter().GetResult(); } /// @@ -131,9 +131,9 @@ public static IotRecommendationTypeList List1(this IIotRecommendationTypesOperat /// /// The cancellation token. /// - public static async Task List1Async(this IIotRecommendationTypesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ListAtSubscriptionScopeAsync(this IIotRecommendationTypesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.List1WithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAtSubscriptionScopeWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -148,9 +148,9 @@ public static IotRecommendationTypeList List1(this IIotRecommendationTypesOperat /// /// Name of the recommendation type /// - public static IotRecommendationType Get1(this IIotRecommendationTypesOperations operations, string iotRecommendationTypeName) + public static IotRecommendationType GetAtSubscriptionScope(this IIotRecommendationTypesOperations operations, string iotRecommendationTypeName) { - return operations.Get1Async(iotRecommendationTypeName).GetAwaiter().GetResult(); + return operations.GetAtSubscriptionScopeAsync(iotRecommendationTypeName).GetAwaiter().GetResult(); } /// @@ -165,9 +165,9 @@ public static IotRecommendationType Get1(this IIotRecommendationTypesOperations /// /// The cancellation token. /// - public static async Task Get1Async(this IIotRecommendationTypesOperations operations, string iotRecommendationTypeName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAtSubscriptionScopeAsync(this IIotRecommendationTypesOperations operations, string iotRecommendationTypeName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.Get1WithHttpMessagesAsync(iotRecommendationTypeName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetAtSubscriptionScopeWithHttpMessagesAsync(iotRecommendationTypeName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationsOperations.cs index 2d77cef2d0044..5bd9a1726bcaf 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationsOperations.cs @@ -566,7 +566,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> List1WithHttpMessagesAsync(string scope, string recommendationType = default(string), string deviceId = default(string), int? limit = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAtScopeWithHttpMessagesAsync(string scope, string recommendationType = default(string), string deviceId = default(string), int? limit = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (scope == null) { @@ -587,7 +587,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) tracingParameters.Add("limit", limit); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List1", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAtScope", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -771,7 +771,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> Get1WithHttpMessagesAsync(string scope, string iotRecommendationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetAtScopeWithHttpMessagesAsync(string scope, string iotRecommendationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (scope == null) { @@ -793,7 +793,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) tracingParameters.Add("scope", scope); tracingParameters.Add("iotRecommendationId", iotRecommendationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get1", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetAtScope", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1130,7 +1130,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> List1NextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListAtScopeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1145,7 +1145,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List1Next", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListAtScopeNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationsOperationsExtensions.cs index c55262edd3276..ff2402c1e7c5e 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationsOperationsExtensions.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationsOperationsExtensions.cs @@ -158,9 +158,9 @@ public static IotRecommendation Get(this IIotRecommendationsOperations operation /// /// Skip token used for pagination /// - public static IPage List1(this IIotRecommendationsOperations operations, string scope, string recommendationType = default(string), string deviceId = default(string), int? limit = default(int?), string skipToken = default(string)) + public static IPage ListAtScope(this IIotRecommendationsOperations operations, string scope, string recommendationType = default(string), string deviceId = default(string), int? limit = default(int?), string skipToken = default(string)) { - return operations.List1Async(scope, recommendationType, deviceId, limit, skipToken).GetAwaiter().GetResult(); + return operations.ListAtScopeAsync(scope, recommendationType, deviceId, limit, skipToken).GetAwaiter().GetResult(); } /// @@ -189,9 +189,9 @@ public static IotRecommendation Get(this IIotRecommendationsOperations operation /// /// The cancellation token. /// - public static async Task> List1Async(this IIotRecommendationsOperations operations, string scope, string recommendationType = default(string), string deviceId = default(string), int? limit = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAtScopeAsync(this IIotRecommendationsOperations operations, string scope, string recommendationType = default(string), string deviceId = default(string), int? limit = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.List1WithHttpMessagesAsync(scope, recommendationType, deviceId, limit, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAtScopeWithHttpMessagesAsync(scope, recommendationType, deviceId, limit, skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -211,9 +211,9 @@ public static IotRecommendation Get(this IIotRecommendationsOperations operation /// /// Id of the recommendation /// - public static IotRecommendationModel Get1(this IIotRecommendationsOperations operations, string scope, string iotRecommendationId) + public static IotRecommendationModel GetAtScope(this IIotRecommendationsOperations operations, string scope, string iotRecommendationId) { - return operations.Get1Async(scope, iotRecommendationId).GetAwaiter().GetResult(); + return operations.GetAtScopeAsync(scope, iotRecommendationId).GetAwaiter().GetResult(); } /// @@ -233,9 +233,9 @@ public static IotRecommendationModel Get1(this IIotRecommendationsOperations ope /// /// The cancellation token. /// - public static async Task Get1Async(this IIotRecommendationsOperations operations, string scope, string iotRecommendationId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAtScopeAsync(this IIotRecommendationsOperations operations, string scope, string iotRecommendationId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.Get1WithHttpMessagesAsync(scope, iotRecommendationId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetAtScopeWithHttpMessagesAsync(scope, iotRecommendationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -284,9 +284,9 @@ public static IPage ListNext(this IIotRecommendationsOperatio /// /// The NextLink from the previous successful call to List operation. /// - public static IPage List1Next(this IIotRecommendationsOperations operations, string nextPageLink) + public static IPage ListAtScopeNext(this IIotRecommendationsOperations operations, string nextPageLink) { - return operations.List1NextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListAtScopeNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -301,9 +301,9 @@ public static IPage List1Next(this IIotRecommendationsOp /// /// The cancellation token. /// - public static async Task> List1NextAsync(this IIotRecommendationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAtScopeNextAsync(this IIotRecommendationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.List1NextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListAtScopeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSensorsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSensorsOperations.cs index 45873dc507b16..d451cefed9083 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSensorsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSensorsOperations.cs @@ -261,7 +261,7 @@ internal IotSensorsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (scope == null) { @@ -388,7 +388,7 @@ internal IotSensorsOperations(SecurityCenterClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -401,7 +401,7 @@ internal IotSensorsOperations(SecurityCenterClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -429,6 +429,12 @@ internal IotSensorsOperations(SecurityCenterClient client) /// /// Name of the IoT sensor /// + /// + /// TI Automatic mode status of the IoT sensor + /// + /// + /// Zone of the IoT sensor + /// /// /// Headers that will be added to request. /// @@ -450,7 +456,7 @@ internal IotSensorsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string scope, string iotSensorName, bool? tiAutomaticUpdates = default(bool?), string zone = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (scope == null) { @@ -461,6 +467,12 @@ internal IotSensorsOperations(SecurityCenterClient client) throw new ValidationException(ValidationRules.CannotBeNull, "iotSensorName"); } string apiVersion = "2020-08-06-preview"; + IotSensorsModel iotSensorsModel = new IotSensorsModel(); + if (tiAutomaticUpdates != null || zone != null) + { + iotSensorsModel.TiAutomaticUpdates = tiAutomaticUpdates; + iotSensorsModel.Zone = zone; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -471,6 +483,7 @@ internal IotSensorsOperations(SecurityCenterClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("scope", scope); tracingParameters.Add("iotSensorName", iotSensorName); + tracingParameters.Add("iotSensorsModel", iotSensorsModel); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } @@ -522,6 +535,12 @@ internal IotSensorsOperations(SecurityCenterClient client) // Serialize Request string _requestContent = null; + if(iotSensorsModel != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(iotSensorsModel, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (Client.Credentials != null) { @@ -577,7 +596,7 @@ internal IotSensorsOperations(SecurityCenterClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -590,7 +609,7 @@ internal IotSensorsOperations(SecurityCenterClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -608,7 +627,7 @@ internal IotSensorsOperations(SecurityCenterClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -971,5 +990,364 @@ internal IotSensorsOperations(SecurityCenterClient client) return _result; } + /// + /// Download file for reset password of the sensor + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Name of the IoT sensor + /// + /// + /// The appliance id of the sensor. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> DownloadResetPasswordWithHttpMessagesAsync(string scope, string iotSensorName, string applianceId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (scope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + } + if (iotSensorName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "iotSensorName"); + } + string apiVersion = "2020-08-06-preview"; + ResetPasswordInput body = new ResetPasswordInput(); + if (applianceId != null) + { + body.ApplianceId = applianceId; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("scope", scope); + tracingParameters.Add("iotSensorName", iotSensorName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "DownloadResetPassword", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadResetPassword").ToString(); + _url = _url.Replace("{scope}", scope); + _url = _url.Replace("{iotSensorName}", System.Uri.EscapeDataString(iotSensorName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Trigger threat intelligence package update + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Name of the IoT sensor + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task TriggerTiPackageUpdateWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (scope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + } + if (iotSensorName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "iotSensorName"); + } + string apiVersion = "2020-08-06-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("scope", scope); + tracingParameters.Add("iotSensorName", iotSensorName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "TriggerTiPackageUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/triggerTiPackageUpdate").ToString(); + _url = _url.Replace("{scope}", scope); + _url = _url.Replace("{iotSensorName}", System.Uri.EscapeDataString(iotSensorName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSensorsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSensorsOperationsExtensions.cs index c5d3a27e2f229..b4d0da207386b 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSensorsOperationsExtensions.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSensorsOperationsExtensions.cs @@ -68,7 +68,7 @@ public static IotSensorsList List(this IIotSensorsOperations operations, string /// /// Name of the IoT sensor /// - public static IotSensor Get(this IIotSensorsOperations operations, string scope, string iotSensorName) + public static IotSensorsModel Get(this IIotSensorsOperations operations, string scope, string iotSensorName) { return operations.GetAsync(scope, iotSensorName).GetAwaiter().GetResult(); } @@ -88,7 +88,7 @@ public static IotSensor Get(this IIotSensorsOperations operations, string scope, /// /// The cancellation token. /// - public static async Task GetAsync(this IIotSensorsOperations operations, string scope, string iotSensorName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IIotSensorsOperations operations, string scope, string iotSensorName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(scope, iotSensorName, null, cancellationToken).ConfigureAwait(false)) { @@ -108,9 +108,15 @@ public static IotSensor Get(this IIotSensorsOperations operations, string scope, /// /// Name of the IoT sensor /// - public static IotSensor CreateOrUpdate(this IIotSensorsOperations operations, string scope, string iotSensorName) + /// + /// TI Automatic mode status of the IoT sensor + /// + /// + /// Zone of the IoT sensor + /// + public static IotSensorsModel CreateOrUpdate(this IIotSensorsOperations operations, string scope, string iotSensorName, bool? tiAutomaticUpdates = default(bool?), string zone = default(string)) { - return operations.CreateOrUpdateAsync(scope, iotSensorName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(scope, iotSensorName, tiAutomaticUpdates, zone).GetAwaiter().GetResult(); } /// @@ -125,12 +131,18 @@ public static IotSensor CreateOrUpdate(this IIotSensorsOperations operations, st /// /// Name of the IoT sensor /// + /// + /// TI Automatic mode status of the IoT sensor + /// + /// + /// Zone of the IoT sensor + /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IIotSensorsOperations operations, string scope, string iotSensorName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IIotSensorsOperations operations, string scope, string iotSensorName, bool? tiAutomaticUpdates = default(bool?), string zone = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(scope, iotSensorName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(scope, iotSensorName, tiAutomaticUpdates, zone, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -212,5 +224,87 @@ public static Stream DownloadActivation(this IIotSensorsOperations operations, s return _result.Body; } + /// + /// Download file for reset password of the sensor + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Name of the IoT sensor + /// + /// + /// The appliance id of the sensor. + /// + public static Stream DownloadResetPassword(this IIotSensorsOperations operations, string scope, string iotSensorName, string applianceId = default(string)) + { + return operations.DownloadResetPasswordAsync(scope, iotSensorName, applianceId).GetAwaiter().GetResult(); + } + + /// + /// Download file for reset password of the sensor + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Name of the IoT sensor + /// + /// + /// The appliance id of the sensor. + /// + /// + /// The cancellation token. + /// + public static async Task DownloadResetPasswordAsync(this IIotSensorsOperations operations, string scope, string iotSensorName, string applianceId = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + var _result = await operations.DownloadResetPasswordWithHttpMessagesAsync(scope, iotSensorName, applianceId, null, cancellationToken).ConfigureAwait(false); + _result.Request.Dispose(); + return _result.Body; + } + + /// + /// Trigger threat intelligence package update + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Name of the IoT sensor + /// + public static void TriggerTiPackageUpdate(this IIotSensorsOperations operations, string scope, string iotSensorName) + { + operations.TriggerTiPackageUpdateAsync(scope, iotSensorName).GetAwaiter().GetResult(); + } + + /// + /// Trigger threat intelligence package update + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Name of the IoT sensor + /// + /// + /// The cancellation token. + /// + public static async Task TriggerTiPackageUpdateAsync(this IIotSensorsOperations operations, string scope, string iotSensorName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.TriggerTiPackageUpdateWithHttpMessagesAsync(scope, iotSensorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSitesOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSitesOperations.cs new file mode 100644 index 0000000000000..8a429fe9ed7f0 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSitesOperations.cs @@ -0,0 +1,794 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// IotSitesOperations operations. + /// + internal partial class IotSitesOperations : IServiceOperations, IIotSitesOperations + { + /// + /// Initializes a new instance of the IotSitesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal IotSitesOperations(SecurityCenterClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityCenterClient + /// + public SecurityCenterClient Client { get; private set; } + + /// + /// List IoT sites + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (scope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + } + string apiVersion = "2020-08-06-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("scope", scope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotSites").ToString(); + _url = _url.Replace("{scope}", scope); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get IoT site + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (scope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + } + string apiVersion = "2020-08-06-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("scope", scope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotSites/default").ToString(); + _url = _url.Replace("{scope}", scope); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or update IoT site + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Display name of the IoT site + /// + /// + /// Tags of the IoT site + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string scope, string displayName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (scope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + } + if (displayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "displayName"); + } + string apiVersion = "2020-08-06-preview"; + IotSitesModel iotSitesModel = new IotSitesModel(); + if (displayName != null || tags != null) + { + iotSitesModel.DisplayName = displayName; + iotSitesModel.Tags = tags; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("scope", scope); + tracingParameters.Add("iotSitesModel", iotSitesModel); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotSites/default").ToString(); + _url = _url.Replace("{scope}", scope); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(iotSitesModel != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(iotSitesModel, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete IoT site + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (scope == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + } + string apiVersion = "2020-08-06-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("scope", scope); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotSites/default").ToString(); + _url = _url.Replace("{scope}", scope); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSitesOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSitesOperationsExtensions.cs new file mode 100644 index 0000000000000..91350e58c066c --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSitesOperationsExtensions.cs @@ -0,0 +1,172 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for IotSitesOperations. + /// + public static partial class IotSitesOperationsExtensions + { + /// + /// List IoT sites + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + public static IotSitesList List(this IIotSitesOperations operations, string scope) + { + return operations.ListAsync(scope).GetAwaiter().GetResult(); + } + + /// + /// List IoT sites + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// The cancellation token. + /// + public static async Task ListAsync(this IIotSitesOperations operations, string scope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get IoT site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + public static IotSitesModel Get(this IIotSitesOperations operations, string scope) + { + return operations.GetAsync(scope).GetAwaiter().GetResult(); + } + + /// + /// Get IoT site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IIotSitesOperations operations, string scope, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update IoT site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Display name of the IoT site + /// + /// + /// Tags of the IoT site + /// + public static IotSitesModel CreateOrUpdate(this IIotSitesOperations operations, string scope, string displayName, IDictionary tags = default(IDictionary)) + { + return operations.CreateOrUpdateAsync(scope, displayName, tags).GetAwaiter().GetResult(); + } + + /// + /// Create or update IoT site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// Display name of the IoT site + /// + /// + /// Tags of the IoT site + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IIotSitesOperations operations, string scope, string displayName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(scope, displayName, tags, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete IoT site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + public static void Delete(this IIotSitesOperations operations, string scope) + { + operations.DeleteAsync(scope).GetAwaiter().GetResult(); + } + + /// + /// Delete IoT site + /// + /// + /// The operations group for this extension method. + /// + /// + /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IIotSitesOperations operations, string scope, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.cs index 3c4aefd5b0a4a..1d901cbc4a885 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of active connections is not in allowed range. /// - [Newtonsoft.Json.JsonObject("ActiveConnectionsNotInAllowedRange")] public partial class ActiveConnectionsNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalData.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalData.cs index efcb3ced1b862..a052f822516ac 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalData.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalData.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Details of the sub-assessment /// - [Newtonsoft.Json.JsonObject("AdditionalData")] public partial class AdditionalData { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspaceDataType.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspaceDataType.cs new file mode 100644 index 0000000000000..676173dbafca0 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspaceDataType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for AdditionalWorkspaceDataType. + /// + public static class AdditionalWorkspaceDataType + { + public const string Alerts = "Alerts"; + public const string RawEvents = "RawEvents"; + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspaceType.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspaceType.cs new file mode 100644 index 0000000000000..62a80cafd8d8e --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspaceType.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for AdditionalWorkspaceType. + /// + public static class AdditionalWorkspaceType + { + public const string Sentinel = "Sentinel"; + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspacesProperties.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspacesProperties.cs new file mode 100644 index 0000000000000..832e8fc248f4d --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspacesProperties.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties of the additional workspaces. + /// + public partial class AdditionalWorkspacesProperties + { + /// + /// Initializes a new instance of the AdditionalWorkspacesProperties + /// class. + /// + public AdditionalWorkspacesProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AdditionalWorkspacesProperties + /// class. + /// + /// Workspace resource id + /// Workspace type. Possible values include: + /// 'Sentinel' + /// List of data types sent to + /// workspace + public AdditionalWorkspacesProperties(string workspace = default(string), string type = default(string), IList dataTypes = default(IList)) + { + Workspace = workspace; + Type = type; + DataTypes = dataTypes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets workspace resource id + /// + [JsonProperty(PropertyName = "workspace")] + public string Workspace { get; set; } + + /// + /// Gets or sets workspace type. Possible values include: 'Sentinel' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets list of data types sent to workspace + /// + [JsonProperty(PropertyName = "dataTypes")] + public IList DataTypes { get; set; } + + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.cs index 9033e1abbffb7..4f1823712b08e 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.Security.Models /// A custom alert rule that checks if a value (depends on the custom alert /// type) is allowed. /// - [Newtonsoft.Json.JsonObject("AllowlistCustomAlertRule")] public partial class AllowlistCustomAlertRule : ListCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.cs index 83fcf7eef6d5e..1ec0be41d31f2 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of cloud to device messages (AMQP protocol) is not in allowed /// range. /// - [Newtonsoft.Json.JsonObject("AmqpC2DMessagesNotInAllowedRange")] public partial class AmqpC2DMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.cs index 61375802e9ea5..27ca3c49286ed 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of rejected cloud to device messages (AMQP protocol) is not in /// allowed range. /// - [Newtonsoft.Json.JsonObject("AmqpC2DRejectedMessagesNotInAllowedRange")] public partial class AmqpC2DRejectedMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.cs index fd6dd48b1060b..8061c59a72cea 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of device to cloud messages (AMQP protocol) is not in allowed /// range. /// - [Newtonsoft.Json.JsonObject("AmqpD2CMessagesNotInAllowedRange")] public partial class AmqpD2CMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AuthenticationDetailsProperties.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AuthenticationDetailsProperties.cs index bf9f8117be032..4e15389c098a9 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AuthenticationDetailsProperties.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AuthenticationDetailsProperties.cs @@ -18,7 +18,6 @@ namespace Microsoft.Azure.Management.Security.Models /// /// Settings for cloud authentication management /// - [Newtonsoft.Json.JsonObject("AuthenticationDetailsProperties")] public partial class AuthenticationDetailsProperties { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationAction.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationAction.cs index e486a3ba01b92..921ecb8ffaf1e 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationAction.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationAction.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// The action that should be triggered. /// - [Newtonsoft.Json.JsonObject("AutomationAction")] public partial class AutomationAction { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationSource.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationSource.cs index 8bdc7a2c40c11..d166a2614f9ea 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationSource.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationSource.cs @@ -35,7 +35,9 @@ public AutomationSource() /// Initializes a new instance of the AutomationSource class. /// /// A valid event source type. Possible - /// values include: 'Assessments', 'SubAssessments', 'Alerts' + /// values include: 'Assessments', 'SubAssessments', 'Alerts', + /// 'SecureScores', 'SecureScoreControls', + /// 'RegulatoryComplianceAssessment' /// A set of rules which evaluate upon event /// interception. A logical disjunction is applied between defined rule /// sets (logical 'or'). @@ -53,7 +55,8 @@ public AutomationSource() /// /// Gets or sets a valid event source type. Possible values include: - /// 'Assessments', 'SubAssessments', 'Alerts' + /// 'Assessments', 'SubAssessments', 'Alerts', 'SecureScores', + /// 'SecureScoreControls', 'RegulatoryComplianceAssessment' /// [JsonProperty(PropertyName = "eventSource")] public string EventSource { get; set; } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionFromIpNotAllowed.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionFromIpNotAllowed.cs new file mode 100644 index 0000000000000..1c567d2fc44cf --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionFromIpNotAllowed.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Inbound connection from an ip that isn't allowed. Allow list consists + /// of ipv4 or ipv6 range in CIDR notation. + /// + public partial class ConnectionFromIpNotAllowed : AllowlistCustomAlertRule + { + /// + /// Initializes a new instance of the ConnectionFromIpNotAllowed class. + /// + public ConnectionFromIpNotAllowed() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectionFromIpNotAllowed class. + /// + /// Status of the custom alert. + /// The values to allow. The format of + /// the values depends on the rule type. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + /// The value type of the items in the list. + /// Possible values include: 'IpCidr', 'String' + public ConnectionFromIpNotAllowed(bool isEnabled, IList allowlistValues, string displayName = default(string), string description = default(string), string valueType = default(string)) + : base(isEnabled, allowlistValues, displayName, description, valueType) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionToIpNotAllowed.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionToIpNotAllowed.cs index 19cc63c8934cd..16d02941054a2 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionToIpNotAllowed.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionToIpNotAllowed.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.Security.Models /// Outbound connection to an ip that isn't allowed. Allow list consists of /// ipv4 or ipv6 range in CIDR notation. /// - [Newtonsoft.Json.JsonObject("ConnectionToIpNotAllowed")] public partial class ConnectionToIpNotAllowed : AllowlistCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CreatedByType.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CreatedByType.cs new file mode 100644 index 0000000000000..a18acdd38fdf2 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CreatedByType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for CreatedByType. + /// + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CustomAlertRule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CustomAlertRule.cs index a581bbf4f832f..c52d16896c228 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CustomAlertRule.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CustomAlertRule.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.Security.Models /// /// A custom alert rule. /// - [Newtonsoft.Json.JsonObject("CustomAlertRule")] public partial class CustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DataExportSettings.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DataExportSettings.cs index 3c01ebcc5c172..9d743cb001b55 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DataExportSettings.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DataExportSettings.cs @@ -18,7 +18,6 @@ namespace Microsoft.Azure.Management.Security.Models /// /// Represents a data export setting /// - [Newtonsoft.Json.JsonObject("DataExportSettings")] [Rest.Serialization.JsonTransformation] public partial class DataExportSettings : Setting { diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DenylistCustomAlertRule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DenylistCustomAlertRule.cs index 1bfe4ef2944a7..fefdebb7ccadc 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DenylistCustomAlertRule.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DenylistCustomAlertRule.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.Security.Models /// A custom alert rule that checks if a value (depends on the custom alert /// type) is denied. /// - [Newtonsoft.Json.JsonObject("DenylistCustomAlertRule")] public partial class DenylistCustomAlertRule : ListCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Device.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Device.cs index 3b43ed623c18e..1e41a249b2cf7 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Device.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Device.cs @@ -269,16 +269,13 @@ public Device() /// public virtual void Validate() { - if (RiskScore != null) + if (RiskScore > 100) { - if (RiskScore > 100) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "RiskScore", 100); - } - if (RiskScore < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RiskScore", 0); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "RiskScore", 100); + } + if (RiskScore < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "RiskScore", 0); } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.cs index 5965d35479674..efb160b104ecb 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of direct method invokes is not in allowed range. /// - [Newtonsoft.Json.JsonObject("DirectMethodInvokesNotInAllowedRange")] public partial class DirectMethodInvokesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensor.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ErrorAdditionalInfo.cs similarity index 51% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensor.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ErrorAdditionalInfo.cs index a78e65a6ae6b2..9beab3502ae2b 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensor.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ErrorAdditionalInfo.cs @@ -14,29 +14,27 @@ namespace Microsoft.Azure.Management.Security.Models using System.Linq; /// - /// IoT sensor + /// The resource management error additional info. /// - public partial class IotSensor : Resource + public partial class ErrorAdditionalInfo { /// - /// Initializes a new instance of the IotSensor class. + /// Initializes a new instance of the ErrorAdditionalInfo class. /// - public IotSensor() + public ErrorAdditionalInfo() { CustomInit(); } /// - /// Initializes a new instance of the IotSensor class. + /// Initializes a new instance of the ErrorAdditionalInfo class. /// - /// Resource Id - /// Resource name - /// Resource type - /// IoT sensor properties - public IotSensor(string id = default(string), string name = default(string), string type = default(string), object properties = default(object)) - : base(id, name, type) + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) { - Properties = properties; + Type = type; + Info = info; CustomInit(); } @@ -46,10 +44,16 @@ public IotSensor() partial void CustomInit(); /// - /// Gets or sets ioT sensor properties + /// Gets the additional info type. /// - [JsonProperty(PropertyName = "properties")] - public object Properties { get; set; } + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the additional info. + /// + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EventSource.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EventSource.cs index 33c257f4f0b44..170dc529c798d 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EventSource.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EventSource.cs @@ -19,5 +19,8 @@ public static class EventSource public const string Assessments = "Assessments"; public const string SubAssessments = "SubAssessments"; public const string Alerts = "Alerts"; + public const string SecureScores = "SecureScores"; + public const string SecureScoreControls = "SecureScoreControls"; + public const string RegulatoryComplianceAssessment = "RegulatoryComplianceAssessment"; } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ExternalSecuritySolution.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ExternalSecuritySolution.cs index 6391dffca8f2f..119f870c19ad7 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ExternalSecuritySolution.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ExternalSecuritySolution.cs @@ -18,7 +18,6 @@ namespace Microsoft.Azure.Management.Security.Models /// sends information to an OMS workspace and whose data is displayed by /// Azure Security Center. /// - [Newtonsoft.Json.JsonObject("ExternalSecuritySolution")] public partial class ExternalSecuritySolution { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.cs index 940afb4c7ce2c..d2d8d1166ae26 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of failed local logins is not in allowed range. /// - [Newtonsoft.Json.JsonObject("FailedLocalLoginsNotInAllowedRange")] public partial class FailedLocalLoginsNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.cs index b35c49246449d..55109af42dc0b 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of file uploads is not in allowed range. /// - [Newtonsoft.Json.JsonObject("FileUploadsNotInAllowedRange")] public partial class FileUploadsNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.cs index b4c92a0347b10..21b2e8bf7d9e4 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of cloud to device messages (HTTP protocol) is not in allowed /// range. /// - [Newtonsoft.Json.JsonObject("HttpC2DMessagesNotInAllowedRange")] public partial class HttpC2DMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.cs index a9d06f0275783..73f69e0b71b0c 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of rejected cloud to device messages (HTTP protocol) is not in /// allowed range. /// - [Newtonsoft.Json.JsonObject("HttpC2DRejectedMessagesNotInAllowedRange")] public partial class HttpC2DRejectedMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.cs index d9ecd22c241b8..820edd41c00ac 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of device to cloud messages (HTTP protocol) is not in allowed /// range. /// - [Newtonsoft.Json.JsonObject("HttpD2CMessagesNotInAllowedRange")] public partial class HttpD2CMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlert.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlert.cs index 576c441f6737e..6976cdba2dbb7 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlert.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlert.cs @@ -62,7 +62,7 @@ public IoTSecurityAggregatedAlert() /// list of affected devices/alerts. /// 10 devices with the highest number of /// occurrences of this alert type, on this day. - public IoTSecurityAggregatedAlert(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string alertType = default(string), string alertDisplayName = default(string), System.DateTime? aggregatedDateUtc = default(System.DateTime?), string vendorName = default(string), string reportedSeverity = default(string), string remediationSteps = default(string), string description = default(string), int? count = default(int?), string effectedResourceType = default(string), string systemSource = default(string), string actionTaken = default(string), string logAnalyticsQuery = default(string), IList topDevicesList = default(IList)) + public IoTSecurityAggregatedAlert(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string alertType = default(string), string alertDisplayName = default(string), System.DateTime? aggregatedDateUtc = default(System.DateTime?), string vendorName = default(string), string reportedSeverity = default(string), string remediationSteps = default(string), string description = default(string), long? count = default(long?), string effectedResourceType = default(string), string systemSource = default(string), string actionTaken = default(string), string logAnalyticsQuery = default(string), IList topDevicesList = default(IList)) { Id = id; Name = name; @@ -162,7 +162,7 @@ public IoTSecurityAggregatedAlert() /// window. /// [JsonProperty(PropertyName = "properties.count")] - public int? Count { get; private set; } + public long? Count { get; private set; } /// /// Gets azure resource ID of the resource that received the alerts. diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.cs index fe7313395686e..e99cf861e6436 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.cs @@ -33,7 +33,7 @@ public IoTSecurityAggregatedAlertPropertiesTopDevicesListItem() /// device. /// Most recent time this alert was raised /// for this device, on this day. - public IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(string deviceId = default(string), int? alertsCount = default(int?), string lastOccurrence = default(string)) + public IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(string deviceId = default(string), long? alertsCount = default(long?), string lastOccurrence = default(string)) { DeviceId = deviceId; AlertsCount = alertsCount; @@ -56,7 +56,7 @@ public IoTSecurityAggregatedAlertPropertiesTopDevicesListItem() /// Gets number of alerts raised for this device. /// [JsonProperty(PropertyName = "alertsCount")] - public int? AlertsCount { get; private set; } + public long? AlertsCount { get; private set; } /// /// Gets most recent time this alert was raised for this device, on diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedRecommendation.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedRecommendation.cs index 8a9bb666b2753..10cb785cc6f80 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedRecommendation.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedRecommendation.cs @@ -61,7 +61,7 @@ public IoTSecurityAggregatedRecommendation() /// within the IoT Security solution. /// Log analytics query for getting the /// list of affected devices/alerts. - public IoTSecurityAggregatedRecommendation(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string recommendationName = default(string), string recommendationDisplayName = default(string), string description = default(string), string recommendationTypeId = default(string), string detectedBy = default(string), string remediationSteps = default(string), string reportedSeverity = default(string), int? healthyDevices = default(int?), int? unhealthyDeviceCount = default(int?), string logAnalyticsQuery = default(string)) + public IoTSecurityAggregatedRecommendation(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string recommendationName = default(string), string recommendationDisplayName = default(string), string description = default(string), string recommendationTypeId = default(string), string detectedBy = default(string), string remediationSteps = default(string), string reportedSeverity = default(string), long? healthyDevices = default(long?), long? unhealthyDeviceCount = default(long?), string logAnalyticsQuery = default(string)) { Id = id; Name = name; @@ -156,13 +156,13 @@ public IoTSecurityAggregatedRecommendation() /// Gets number of healthy devices within the IoT Security solution. /// [JsonProperty(PropertyName = "properties.healthyDevices")] - public int? HealthyDevices { get; private set; } + public long? HealthyDevices { get; private set; } /// /// Gets number of unhealthy devices within the IoT Security solution. /// [JsonProperty(PropertyName = "properties.unhealthyDeviceCount")] - public int? UnhealthyDeviceCount { get; private set; } + public long? UnhealthyDeviceCount { get; private set; } /// /// Gets log analytics query for getting the list of affected diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAlertedDevice.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAlertedDevice.cs index c4a2dece5c37b..370ea29693b8f 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAlertedDevice.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAlertedDevice.cs @@ -33,7 +33,7 @@ public IoTSecurityAlertedDevice() /// Device identifier. /// Number of alerts raised for this /// device. - public IoTSecurityAlertedDevice(string deviceId = default(string), int? alertsCount = default(int?)) + public IoTSecurityAlertedDevice(string deviceId = default(string), long? alertsCount = default(long?)) { DeviceId = deviceId; AlertsCount = alertsCount; @@ -55,7 +55,7 @@ public IoTSecurityAlertedDevice() /// Gets number of alerts raised for this device. /// [JsonProperty(PropertyName = "alertsCount")] - public int? AlertsCount { get; private set; } + public long? AlertsCount { get; private set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceAlert.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceAlert.cs index 2a3591bb89da3..fcc0b588b6c17 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceAlert.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceAlert.cs @@ -35,7 +35,7 @@ public IoTSecurityDeviceAlert() /// values include: 'Informational', 'Low', 'Medium', 'High' /// Number of alerts raised for this alert /// type. - public IoTSecurityDeviceAlert(string alertDisplayName = default(string), string reportedSeverity = default(string), int? alertsCount = default(int?)) + public IoTSecurityDeviceAlert(string alertDisplayName = default(string), string reportedSeverity = default(string), long? alertsCount = default(long?)) { AlertDisplayName = alertDisplayName; ReportedSeverity = reportedSeverity; @@ -65,7 +65,7 @@ public IoTSecurityDeviceAlert() /// Gets number of alerts raised for this alert type. /// [JsonProperty(PropertyName = "alertsCount")] - public int? AlertsCount { get; private set; } + public long? AlertsCount { get; private set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceRecommendation.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceRecommendation.cs index fbafa0d2216d4..273a5f40b9c50 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceRecommendation.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceRecommendation.cs @@ -39,7 +39,7 @@ public IoTSecurityDeviceRecommendation() /// 'High' /// Number of devices with this /// recommendation. - public IoTSecurityDeviceRecommendation(string recommendationDisplayName = default(string), string reportedSeverity = default(string), int? devicesCount = default(int?)) + public IoTSecurityDeviceRecommendation(string recommendationDisplayName = default(string), string reportedSeverity = default(string), long? devicesCount = default(long?)) { RecommendationDisplayName = recommendationDisplayName; ReportedSeverity = reportedSeverity; @@ -69,7 +69,7 @@ public IoTSecurityDeviceRecommendation() /// Gets number of devices with this recommendation. /// [JsonProperty(PropertyName = "devicesCount")] - public int? DevicesCount { get; private set; } + public long? DevicesCount { get; private set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionAnalyticsModel.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionAnalyticsModel.cs index c9573fa848cd1..d9b4829a9e80e 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionAnalyticsModel.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionAnalyticsModel.cs @@ -51,7 +51,7 @@ public IoTSecuritySolutionAnalyticsModel() /// prevalent device alerts. /// List of the 3 most /// prevalent device recommendations. - public IoTSecuritySolutionAnalyticsModel(string id = default(string), string name = default(string), string type = default(string), IoTSeverityMetrics metrics = default(IoTSeverityMetrics), int? unhealthyDeviceCount = default(int?), IList devicesMetrics = default(IList), IList topAlertedDevices = default(IList), IList mostPrevalentDeviceAlerts = default(IList), IList mostPrevalentDeviceRecommendations = default(IList)) + public IoTSecuritySolutionAnalyticsModel(string id = default(string), string name = default(string), string type = default(string), IoTSeverityMetrics metrics = default(IoTSeverityMetrics), long? unhealthyDeviceCount = default(long?), IList devicesMetrics = default(IList), IList topAlertedDevices = default(IList), IList mostPrevalentDeviceAlerts = default(IList), IList mostPrevalentDeviceRecommendations = default(IList)) : base(id, name, type) { Metrics = metrics; @@ -78,7 +78,7 @@ public IoTSecuritySolutionAnalyticsModel() /// Gets number of unhealthy devices within your IoT Security solution. /// [JsonProperty(PropertyName = "properties.unhealthyDeviceCount")] - public int? UnhealthyDeviceCount { get; private set; } + public long? UnhealthyDeviceCount { get; private set; } /// /// Gets list of device metrics by the aggregation date. diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionModel.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionModel.cs index 30c128604d478..513d7a6b57544 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionModel.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionModel.cs @@ -53,7 +53,11 @@ public IoTSecuritySolutionModel() /// solution. /// Unmasked IP address logging /// status. Possible values include: 'Disabled', 'Enabled' - public IoTSecuritySolutionModel(string displayName, IList iotHubs, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), string workspace = default(string), string status = default(string), IList export = default(IList), IList disabledDataSources = default(IList), UserDefinedResourcesProperties userDefinedResources = default(UserDefinedResourcesProperties), IList autoDiscoveredResources = default(IList), IList recommendationsConfiguration = default(IList), string unmaskedIpLoggingStatus = default(string)) + /// List of additional + /// workspaces + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + public IoTSecuritySolutionModel(string displayName, IList iotHubs, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), string workspace = default(string), string status = default(string), IList export = default(IList), IList disabledDataSources = default(IList), UserDefinedResourcesProperties userDefinedResources = default(UserDefinedResourcesProperties), IList autoDiscoveredResources = default(IList), IList recommendationsConfiguration = default(IList), string unmaskedIpLoggingStatus = default(string), IList additionalWorkspaces = default(IList), SystemData systemData = default(SystemData)) { Id = id; Name = name; @@ -70,6 +74,8 @@ public IoTSecuritySolutionModel() AutoDiscoveredResources = autoDiscoveredResources; RecommendationsConfiguration = recommendationsConfiguration; UnmaskedIpLoggingStatus = unmaskedIpLoggingStatus; + AdditionalWorkspaces = additionalWorkspaces; + SystemData = systemData; CustomInit(); } @@ -171,6 +177,19 @@ public IoTSecuritySolutionModel() [JsonProperty(PropertyName = "properties.unmaskedIpLoggingStatus")] public string UnmaskedIpLoggingStatus { get; set; } + /// + /// Gets or sets list of additional workspaces + /// + [JsonProperty(PropertyName = "properties.additionalWorkspaces")] + public IList AdditionalWorkspaces { get; set; } + + /// + /// Gets azure Resource Manager metadata containing createdBy and + /// modifiedBy information. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSeverityMetrics.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSeverityMetrics.cs index 31723ada6abe6..71fc0a7748c72 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSeverityMetrics.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSeverityMetrics.cs @@ -35,7 +35,7 @@ public IoTSeverityMetrics() /// alerts/recommendations. /// Count of low severity /// alerts/recommendations. - public IoTSeverityMetrics(int? high = default(int?), int? medium = default(int?), int? low = default(int?)) + public IoTSeverityMetrics(long? high = default(long?), long? medium = default(long?), long? low = default(long?)) { High = high; Medium = medium; @@ -52,19 +52,19 @@ public IoTSeverityMetrics() /// Gets or sets count of high severity alerts/recommendations. /// [JsonProperty(PropertyName = "high")] - public int? High { get; set; } + public long? High { get; set; } /// /// Gets or sets count of medium severity alerts/recommendations. /// [JsonProperty(PropertyName = "medium")] - public int? Medium { get; set; } + public long? Medium { get; set; } /// /// Gets or sets count of low severity alerts/recommendations. /// [JsonProperty(PropertyName = "low")] - public int? Low { get; set; } + public long? Low { get; set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlert.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlert.cs index 03e3833029c35..18edcb5188e2f 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlert.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlert.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.Security.Models /// IoT alert /// [Rest.Serialization.JsonTransformation] - public partial class IotAlert + public partial class IotAlert : Resource { /// /// Initializes a new instance of the IotAlert class. @@ -34,6 +34,9 @@ public IotAlert() /// /// Initializes a new instance of the IotAlert class. /// + /// Resource Id + /// Resource name + /// Resource type /// Holds the product canonical identifier /// of the alert within the scope of a product /// Display name of the main entity @@ -47,7 +50,8 @@ public IotAlert() /// alert /// A bag of fields which extends the /// alert information - public IotAlert(string systemAlertId = default(string), string compromisedEntity = default(string), string alertType = default(string), string startTimeUtc = default(string), string endTimeUtc = default(string), IList entities = default(IList), object extendedProperties = default(object)) + public IotAlert(string id = default(string), string name = default(string), string type = default(string), string systemAlertId = default(string), string compromisedEntity = default(string), string alertType = default(string), string startTimeUtc = default(string), string endTimeUtc = default(string), IList entities = default(IList), object extendedProperties = default(object)) + : base(id, name, type) { SystemAlertId = systemAlertId; CompromisedEntity = compromisedEntity; diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlertModel.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlertModel.cs index d1555b4f74523..e4d276ce8ce98 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlertModel.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlertModel.cs @@ -21,7 +21,7 @@ namespace Microsoft.Azure.Management.Security.Models /// IoT alert /// [Rest.Serialization.JsonTransformation] - public partial class IotAlertModel + public partial class IotAlertModel : Resource { /// /// Initializes a new instance of the IotAlertModel class. @@ -34,6 +34,9 @@ public IotAlertModel() /// /// Initializes a new instance of the IotAlertModel class. /// + /// Resource Id + /// Resource name + /// Resource type /// Holds the product canonical identifier /// of the alert within the scope of a product /// Display name of the main entity @@ -47,7 +50,8 @@ public IotAlertModel() /// alert /// A bag of fields which extends the /// alert information - public IotAlertModel(string systemAlertId = default(string), string compromisedEntity = default(string), string alertType = default(string), string startTimeUtc = default(string), string endTimeUtc = default(string), IList entities = default(IList), object extendedProperties = default(object)) + public IotAlertModel(string id = default(string), string name = default(string), string type = default(string), string systemAlertId = default(string), string compromisedEntity = default(string), string alertType = default(string), string startTimeUtc = default(string), string endTimeUtc = default(string), IList entities = default(IList), object extendedProperties = default(object)) + : base(id, name, type) { SystemAlertId = systemAlertId; CompromisedEntity = compromisedEntity; diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensorsList.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensorsList.cs index aac5bc83d934d..f432097bf7e13 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensorsList.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensorsList.cs @@ -32,7 +32,7 @@ public IotSensorsList() /// Initializes a new instance of the IotSensorsList class. /// /// List data - public IotSensorsList(IList value = default(IList)) + public IotSensorsList(IList value = default(IList)) { Value = value; CustomInit(); @@ -47,7 +47,7 @@ public IotSensorsList() /// Gets list data /// [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } + public IList Value { get; private set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensorsModel.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensorsModel.cs new file mode 100644 index 0000000000000..b626bbc146cce --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensorsModel.cs @@ -0,0 +1,138 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// IoT sensor model + /// + [Rest.Serialization.JsonTransformation] + public partial class IotSensorsModel : Resource + { + /// + /// Initializes a new instance of the IotSensorsModel class. + /// + public IotSensorsModel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IotSensorsModel class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// Last connectivity time of the IoT + /// sensor + /// Creation time of the IoT sensor + /// Dynamic mode status of the IoT + /// sensor + /// Learning mode status of the IoT + /// sensor + /// Status of the IoT sensor. Possible + /// values include: 'Ok', 'Disconnected', 'Unavailable' + /// Version of the IoT sensor + /// TI Automatic mode status of the + /// IoT sensor + /// TI Status of the IoT sensor. Possible values + /// include: 'Ok', 'Failed', 'InProgress', 'UpdateAvailable' + /// TI Version of the IoT sensor + /// Zone of the IoT sensor + public IotSensorsModel(string id = default(string), string name = default(string), string type = default(string), string connectivityTime = default(string), string creationTime = default(string), bool? dynamicLearning = default(bool?), bool? learningMode = default(bool?), string sensorStatus = default(string), string sensorVersion = default(string), bool? tiAutomaticUpdates = default(bool?), string tiStatus = default(string), string tiVersion = default(string), string zone = default(string)) + : base(id, name, type) + { + ConnectivityTime = connectivityTime; + CreationTime = creationTime; + DynamicLearning = dynamicLearning; + LearningMode = learningMode; + SensorStatus = sensorStatus; + SensorVersion = sensorVersion; + TiAutomaticUpdates = tiAutomaticUpdates; + TiStatus = tiStatus; + TiVersion = tiVersion; + Zone = zone; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets last connectivity time of the IoT sensor + /// + [JsonProperty(PropertyName = "properties.connectivityTime")] + public string ConnectivityTime { get; private set; } + + /// + /// Gets creation time of the IoT sensor + /// + [JsonProperty(PropertyName = "properties.creationTime")] + public string CreationTime { get; private set; } + + /// + /// Gets dynamic mode status of the IoT sensor + /// + [JsonProperty(PropertyName = "properties.dynamicLearning")] + public bool? DynamicLearning { get; private set; } + + /// + /// Gets learning mode status of the IoT sensor + /// + [JsonProperty(PropertyName = "properties.learningMode")] + public bool? LearningMode { get; private set; } + + /// + /// Gets status of the IoT sensor. Possible values include: 'Ok', + /// 'Disconnected', 'Unavailable' + /// + [JsonProperty(PropertyName = "properties.sensorStatus")] + public string SensorStatus { get; private set; } + + /// + /// Gets version of the IoT sensor + /// + [JsonProperty(PropertyName = "properties.sensorVersion")] + public string SensorVersion { get; private set; } + + /// + /// Gets or sets TI Automatic mode status of the IoT sensor + /// + [JsonProperty(PropertyName = "properties.tiAutomaticUpdates")] + public bool? TiAutomaticUpdates { get; set; } + + /// + /// Gets TI Status of the IoT sensor. Possible values include: 'Ok', + /// 'Failed', 'InProgress', 'UpdateAvailable' + /// + [JsonProperty(PropertyName = "properties.tiStatus")] + public string TiStatus { get; private set; } + + /// + /// Gets TI Version of the IoT sensor + /// + [JsonProperty(PropertyName = "properties.tiVersion")] + public string TiVersion { get; private set; } + + /// + /// Gets or sets zone of the IoT sensor + /// + [JsonProperty(PropertyName = "properties.zone")] + public string Zone { get; set; } + + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsThreatIntelligence.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSitesList.cs similarity index 58% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsThreatIntelligence.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSitesList.cs index 38058ad743fcb..cfedc65bd7745 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsThreatIntelligence.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSitesList.cs @@ -11,30 +11,30 @@ namespace Microsoft.Azure.Management.Security.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// All downloads for threat intelligence + /// List of IoT sites /// - public partial class PackageDownloadsThreatIntelligence + public partial class IotSitesList { /// - /// Initializes a new instance of the - /// PackageDownloadsThreatIntelligence class. + /// Initializes a new instance of the IotSitesList class. /// - public PackageDownloadsThreatIntelligence() + public IotSitesList() { CustomInit(); } /// - /// Initializes a new instance of the - /// PackageDownloadsThreatIntelligence class. + /// Initializes a new instance of the IotSitesList class. /// - /// Download link - public PackageDownloadsThreatIntelligence(string link = default(string)) + /// List data + public IotSitesList(IList value = default(IList)) { - Link = link; + Value = value; CustomInit(); } @@ -44,10 +44,10 @@ public PackageDownloadsThreatIntelligence() partial void CustomInit(); /// - /// Gets or sets download link + /// Gets list data /// - [JsonProperty(PropertyName = "link")] - public string Link { get; set; } + [JsonProperty(PropertyName = "value")] + public IList Value { get; private set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSitesModel.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSitesModel.cs new file mode 100644 index 0000000000000..dd4e635522550 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSitesModel.cs @@ -0,0 +1,81 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// IoT site model + /// + [Rest.Serialization.JsonTransformation] + public partial class IotSitesModel : Resource + { + /// + /// Initializes a new instance of the IotSitesModel class. + /// + public IotSitesModel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IotSitesModel class. + /// + /// Display name of the IoT site + /// Resource Id + /// Resource name + /// Resource type + /// Tags of the IoT site + public IotSitesModel(string displayName, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + : base(id, name, type) + { + DisplayName = displayName; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets display name of the IoT site + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets tags of the IoT site + /// + [JsonProperty(PropertyName = "properties.tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DisplayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); + } + } + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ListCustomAlertRule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ListCustomAlertRule.cs index 763959ad3860f..528d183316de5 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ListCustomAlertRule.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ListCustomAlertRule.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.Security.Models /// /// A List custom alert rule. /// - [Newtonsoft.Json.JsonObject("ListCustomAlertRule")] public partial class ListCustomAlertRule : CustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.cs index 27e661e467c1e..0005bd059e44c 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.Security.Models /// Login by a local user that isn't allowed. Allow list consists of login /// names to allow. /// - [Newtonsoft.Json.JsonObject("LocalUserNotAllowed")] public partial class LocalUserNotAllowed : AllowlistCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.cs index 50ce5fe30a68a..3df5348335277 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of cloud to device messages (MQTT protocol) is not in allowed /// range. /// - [Newtonsoft.Json.JsonObject("MqttC2DMessagesNotInAllowedRange")] public partial class MqttC2DMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.cs index 55fb3039b11ad..6607cb5285c9b 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of rejected cloud to device messages (MQTT protocol) is not in /// allowed range. /// - [Newtonsoft.Json.JsonObject("MqttC2DRejectedMessagesNotInAllowedRange")] public partial class MqttC2DRejectedMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.cs index 358bb0c6e4f81..1bba936ed5917 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of device to cloud messages (MQTT protocol) is not in allowed /// range. /// - [Newtonsoft.Json.JsonObject("MqttD2CMessagesNotInAllowedRange")] public partial class MqttD2CMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloads.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloads.cs index fc5f9bb7fc97f..a2c83f1cb0173 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloads.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloads.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.Management.Security.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -34,11 +36,21 @@ public PackageDownloads() /// Manager /// All downloads for threat /// intelligence - public PackageDownloads(PackageDownloadsSensor sensor = default(PackageDownloadsSensor), PackageDownloadsCentralManager centralManager = default(PackageDownloadsCentralManager), PackageDownloadsThreatIntelligence threatIntelligence = default(PackageDownloadsThreatIntelligence)) + /// SNMP Server file + /// Used for local configuration export + /// Authorized devices + /// import template + /// Authorized + /// devices import template + public PackageDownloads(PackageDownloadsSensor sensor = default(PackageDownloadsSensor), PackageDownloadsCentralManager centralManager = default(PackageDownloadsCentralManager), IList threatIntelligence = default(IList), IList snmp = default(IList), IList wmiTool = default(IList), IList authorizedDevicesImportTemplate = default(IList), IList deviceInformationUpdateImportTemplate = default(IList)) { Sensor = sensor; CentralManager = centralManager; ThreatIntelligence = threatIntelligence; + Snmp = snmp; + WmiTool = wmiTool; + AuthorizedDevicesImportTemplate = authorizedDevicesImportTemplate; + DeviceInformationUpdateImportTemplate = deviceInformationUpdateImportTemplate; CustomInit(); } @@ -63,7 +75,31 @@ public PackageDownloads() /// Gets all downloads for threat intelligence /// [JsonProperty(PropertyName = "threatIntelligence")] - public PackageDownloadsThreatIntelligence ThreatIntelligence { get; private set; } + public IList ThreatIntelligence { get; private set; } + + /// + /// Gets SNMP Server file + /// + [JsonProperty(PropertyName = "snmp")] + public IList Snmp { get; private set; } + + /// + /// Gets used for local configuration export + /// + [JsonProperty(PropertyName = "wmiTool")] + public IList WmiTool { get; private set; } + + /// + /// Gets authorized devices import template + /// + [JsonProperty(PropertyName = "authorizedDevicesImportTemplate")] + public IList AuthorizedDevicesImportTemplate { get; private set; } + + /// + /// Gets authorized devices import template + /// + [JsonProperty(PropertyName = "deviceInformationUpdateImportTemplate")] + public IList DeviceInformationUpdateImportTemplate { get; private set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsCentralManager.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsCentralManager.cs index f2172606f5e25..442c6c7b7aa80 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsCentralManager.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsCentralManager.cs @@ -36,7 +36,7 @@ public PackageDownloadsCentralManager() /// Contains full package downloads /// Central Manager upgrade package downloads (on /// existing installations) - public PackageDownloadsCentralManager(PackageDownloadsCentralManagerFull full = default(PackageDownloadsCentralManagerFull), IList upgrade = default(IList)) + public PackageDownloadsCentralManager(PackageDownloadsCentralManagerFull full = default(PackageDownloadsCentralManagerFull), IList upgrade = default(IList)) { Full = full; Upgrade = upgrade; @@ -59,7 +59,7 @@ public PackageDownloadsCentralManager() /// installations) /// [JsonProperty(PropertyName = "upgrade")] - public IList Upgrade { get; private set; } + public IList Upgrade { get; private set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsSensor.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsSensor.cs index 06a65fb7899cf..dd5b1b86174c7 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsSensor.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsSensor.cs @@ -34,7 +34,7 @@ public PackageDownloadsSensor() /// Contains full package downloads /// Sensor upgrade package downloads (on existing /// installations) - public PackageDownloadsSensor(PackageDownloadsSensorFull full = default(PackageDownloadsSensorFull), IList upgrade = default(IList)) + public PackageDownloadsSensor(PackageDownloadsSensorFull full = default(PackageDownloadsSensorFull), IList upgrade = default(IList)) { Full = full; Upgrade = upgrade; @@ -57,7 +57,7 @@ public PackageDownloadsSensor() /// installations) /// [JsonProperty(PropertyName = "upgrade")] - public IList Upgrade { get; set; } + public IList Upgrade { get; set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProcessNotAllowed.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProcessNotAllowed.cs index 66e7dc1f46f90..a69d3dc5f9326 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProcessNotAllowed.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProcessNotAllowed.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.Security.Models /// Execution of a process that isn't allowed. Allow list consists of /// process names to allow. /// - [Newtonsoft.Json.JsonObject("ProcessNotAllowed")] public partial class ProcessNotAllowed : AllowlistCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.cs index e7a506d93b606..6845776d0aed3 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of device queue purges is not in allowed range. /// - [Newtonsoft.Json.JsonObject("QueuePurgesNotInAllowedRange")] public partial class QueuePurgesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SettingResource.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResetPasswordInput.cs similarity index 57% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SettingResource.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResetPasswordInput.cs index 1f6f76dbf11a5..c4f92216e4a0f 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SettingResource.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResetPasswordInput.cs @@ -14,28 +14,25 @@ namespace Microsoft.Azure.Management.Security.Models using System.Linq; /// - /// The kind of the security setting + /// Reset password input. /// - [Newtonsoft.Json.JsonObject("SettingResource")] - public partial class SettingResource : Resource + public partial class ResetPasswordInput { /// - /// Initializes a new instance of the SettingResource class. + /// Initializes a new instance of the ResetPasswordInput class. /// - public SettingResource() + public ResetPasswordInput() { CustomInit(); } /// - /// Initializes a new instance of the SettingResource class. + /// Initializes a new instance of the ResetPasswordInput class. /// - /// Resource Id - /// Resource name - /// Resource type - public SettingResource(string id = default(string), string name = default(string), string type = default(string)) - : base(id, name, type) + /// The appliance id of the sensor. + public ResetPasswordInput(string applianceId = default(string)) { + ApplianceId = applianceId; CustomInit(); } @@ -44,5 +41,11 @@ public SettingResource() /// partial void CustomInit(); + /// + /// Gets or sets the appliance id of the sensor. + /// + [JsonProperty(PropertyName = "applianceId")] + public string ApplianceId { get; set; } + } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceDetails.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceDetails.cs index 6ab1d4f7544fb..14c1aa7336673 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceDetails.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceDetails.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Details of the resource that was assessed /// - [Newtonsoft.Json.JsonObject("ResourceDetails")] public partial class ResourceDetails { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceIdentifier.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceIdentifier.cs index 261c4ea106f6a..bc31b41d1eddd 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceIdentifier.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceIdentifier.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +17,6 @@ namespace Microsoft.Azure.Management.Security.Models /// alert to the right product exposure group (tenant, workspace, /// subscription etc.). /// - [Newtonsoft.Json.JsonObject("ResourceIdentifier")] public partial class ResourceIdentifier { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionItem.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionItem.cs index 8692c1b52ee58..b00aa0b76545b 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionItem.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionItem.cs @@ -110,16 +110,13 @@ public virtual void Validate() throw new ValidationException(ValidationRules.MaxLength, "Description", 256); } } - if (MaxScore != null) + if (MaxScore > 10) { - if (MaxScore > 10) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxScore", 10); - } - if (MaxScore < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxScore", 0); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxScore", 10); + } + if (MaxScore < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxScore", 0); } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDetails.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDetails.cs index a85e38cb2ff43..731ad402ecdc8 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDetails.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDetails.cs @@ -135,37 +135,25 @@ public SecureScoreControlDetails() /// public virtual void Validate() { - if (Max != null) + if (Max < 0) { - if (Max < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Max", 0); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "Max", 0); } - if (Current != null) + if (Current < 0) { - if (Current < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Current", 0); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "Current", 0); } - if (Percentage != null) + if (Percentage > 1) { - if (Percentage > 1) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Percentage", 1); - } - if (Percentage < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Percentage", 0); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "Percentage", 1); } - if (Weight != null) + if (Percentage < 0) { - if (Weight < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Weight", 0); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "Percentage", 0); + } + if (Weight < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Weight", 0); } if (Definition != null) { diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlScore.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlScore.cs index c13205cd0a703..0c5bcb1169afa 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlScore.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlScore.cs @@ -78,38 +78,29 @@ public SecureScoreControlScore() /// public virtual void Validate() { - if (Max != null) + if (Max > 10) { - if (Max > 10) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Max", 10); - } - if (Max < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Max", 0); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "Max", 10); } - if (Current != null) + if (Max < 0) { - if (Current > 10) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Current", 10); - } - if (Current < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Current", 0); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "Max", 0); } - if (Percentage != null) + if (Current > 10) { - if (Percentage > 1) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Percentage", 1); - } - if (Percentage < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Percentage", 0); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "Current", 10); + } + if (Current < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Current", 0); + } + if (Percentage > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Percentage", 1); + } + if (Percentage < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Percentage", 0); } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreItem.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreItem.cs index aa0e2ba185d29..eef77dd1344fa 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreItem.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreItem.cs @@ -99,37 +99,25 @@ public SecureScoreItem() /// public virtual void Validate() { - if (Max != null) + if (Max < 0) { - if (Max < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Max", 0); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "Max", 0); } - if (Current != null) + if (Current < 0) { - if (Current < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Current", 0); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "Current", 0); } - if (Percentage != null) + if (Percentage > 1) { - if (Percentage > 1) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Percentage", 1); - } - if (Percentage < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Percentage", 0); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "Percentage", 1); } - if (Weight != null) + if (Percentage < 0) { - if (Weight < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Weight", 0); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "Percentage", 0); + } + if (Weight < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Weight", 0); } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SensorStatus.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SensorStatus.cs new file mode 100644 index 0000000000000..a104e1a8c5f83 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SensorStatus.cs @@ -0,0 +1,23 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for SensorStatus. + /// + public static class SensorStatus + { + public const string Ok = "Ok"; + public const string Disconnected = "Disconnected"; + public const string Unavailable = "Unavailable"; + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Setting.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Setting.cs index 3d55e2d4a9649..6b8f43e31e7d5 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Setting.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Setting.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Represents a security setting in Azure Security Center. + /// The kind of the security setting /// - [Newtonsoft.Json.JsonObject("Setting")] - public partial class Setting : SettingResource + public partial class Setting : Resource { /// /// Initializes a new instance of the Setting class. diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SystemData.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SystemData.cs new file mode 100644 index 0000000000000..7606fd957b648 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The type of identity that last + /// modified the resource. + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ThresholdCustomAlertRule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ThresholdCustomAlertRule.cs index 7df8da76196bc..47f1dfdf2e8f7 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ThresholdCustomAlertRule.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ThresholdCustomAlertRule.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Management.Security.Models /// A custom alert rule that checks if a value (depends on the custom alert /// type) is within the given range. /// - [Newtonsoft.Json.JsonObject("ThresholdCustomAlertRule")] public partial class ThresholdCustomAlertRule : CustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TiStatus.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TiStatus.cs new file mode 100644 index 0000000000000..2a6295e5ffdc5 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TiStatus.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for TiStatus. + /// + public static class TiStatus + { + public const string Ok = "Ok"; + public const string Failed = "Failed"; + public const string InProgress = "InProgress"; + public const string UpdateAvailable = "UpdateAvailable"; + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TimeWindowCustomAlertRule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TimeWindowCustomAlertRule.cs index eaeb685da1b5a..e6fdc3230f94a 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TimeWindowCustomAlertRule.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TimeWindowCustomAlertRule.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Management.Security.Models /// A custom alert rule that checks if the number of activities (depends on /// the custom alert type) in a time window is within the given range. /// - [Newtonsoft.Json.JsonObject("TimeWindowCustomAlertRule")] public partial class TimeWindowCustomAlertRule : ThresholdCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.cs index e0b4415251e92..047ed484cb7e8 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of twin updates is not in allowed range. /// - [Newtonsoft.Json.JsonObject("TwinUpdatesNotInAllowedRange")] public partial class TwinUpdatesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.cs index f57c05fd4648b..757b89fe6a5f4 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of unauthorized operations is not in allowed range. /// - [Newtonsoft.Json.JsonObject("UnauthorizedOperationsNotInAllowedRange")] public partial class UnauthorizedOperationsNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/UpgradePackageDownloadInfo.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/UpgradePackageDownloadInfo.cs new file mode 100644 index 0000000000000..9751d1f752e74 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/UpgradePackageDownloadInfo.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Information on a specific package upgrade download + /// + public partial class UpgradePackageDownloadInfo : PackageDownloadInfo + { + /// + /// Initializes a new instance of the UpgradePackageDownloadInfo class. + /// + public UpgradePackageDownloadInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UpgradePackageDownloadInfo class. + /// + /// Version number + /// Download link + /// Kind of the version. Possible values + /// include: 'Latest', 'Previous', 'Preview' + /// Minimum base version for upgrade + public UpgradePackageDownloadInfo(string version = default(string), string link = default(string), string versionKind = default(string), string fromVersion = default(string)) + : base(version, link, versionKind) + { + FromVersion = fromVersion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets minimum base version for upgrade + /// + [JsonProperty(PropertyName = "fromVersion")] + public string FromVersion { get; private set; } + + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/OnPremiseIotSensorsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/OnPremiseIotSensorsOperations.cs index 256212b665bc6..71d998ed9f73b 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/OnPremiseIotSensorsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/OnPremiseIotSensorsOperations.cs @@ -986,5 +986,199 @@ internal OnPremiseIotSensorsOperations(SecurityCenterClient client) return _result; } + /// + /// Download file for reset password of the sensor + /// + /// + /// Name of the on-premise IoT sensor + /// + /// + /// The appliance id of the sensor. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> DownloadResetPasswordWithHttpMessagesAsync(string onPremiseIotSensorName, string applianceId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (onPremiseIotSensorName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "onPremiseIotSensorName"); + } + string apiVersion = "2020-08-06-preview"; + ResetPasswordInput body = new ResetPasswordInput(); + if (applianceId != null) + { + body.ApplianceId = applianceId; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("onPremiseIotSensorName", onPremiseIotSensorName); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "DownloadResetPassword", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}/downloadResetPassword").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{onPremiseIotSensorName}", System.Uri.EscapeDataString(onPremiseIotSensorName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/OnPremiseIotSensorsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/OnPremiseIotSensorsOperationsExtensions.cs index 47615b98c03c0..b078ef2c46b5c 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/OnPremiseIotSensorsOperationsExtensions.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/OnPremiseIotSensorsOperationsExtensions.cs @@ -182,5 +182,44 @@ public static Stream DownloadActivation(this IOnPremiseIotSensorsOperations oper return _result.Body; } + /// + /// Download file for reset password of the sensor + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the on-premise IoT sensor + /// + /// + /// The appliance id of the sensor. + /// + public static Stream DownloadResetPassword(this IOnPremiseIotSensorsOperations operations, string onPremiseIotSensorName, string applianceId = default(string)) + { + return operations.DownloadResetPasswordAsync(onPremiseIotSensorName, applianceId).GetAwaiter().GetResult(); + } + + /// + /// Download file for reset password of the sensor + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the on-premise IoT sensor + /// + /// + /// The appliance id of the sensor. + /// + /// + /// The cancellation token. + /// + public static async Task DownloadResetPasswordAsync(this IOnPremiseIotSensorsOperations operations, string onPremiseIotSensorName, string applianceId = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + var _result = await operations.DownloadResetPasswordWithHttpMessagesAsync(onPremiseIotSensorName, applianceId, null, cancellationToken).ConfigureAwait(false); + _result.Request.Dispose(); + return _result.Body; + } + } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs index 19968c9a9ea69..cbb7ba1394875 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs @@ -53,6 +53,7 @@ public static IEnumerable> ApiInfo_SecurityCenter new Tuple("Security", "IotSecuritySolutionsAnalyticsAggregatedAlert", "2019-08-01"), new Tuple("Security", "IotSecuritySolutionsAnalyticsRecommendation", "2019-08-01"), new Tuple("Security", "IotSensors", "2020-08-06-preview"), + new Tuple("Security", "IotSites", "2020-08-06-preview"), new Tuple("Security", "JitNetworkAccessPolicies", "2020-01-01"), new Tuple("Security", "Locations", "2015-06-01-preview"), new Tuple("Security", "OnPremiseIotSensors", "2020-08-06-preview"), @@ -80,16 +81,5 @@ public static IEnumerable> ApiInfo_SecurityCenter }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/security/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\Rome\\apiVteam\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "32b4d058d54d206bdf6b336677a3182feab7c07b"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SecurityCenterClient.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SecurityCenterClient.cs index fa6209f9af3b6..1c3d201fc1322 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SecurityCenterClient.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SecurityCenterClient.cs @@ -341,6 +341,11 @@ public partial class SecurityCenterClient : ServiceClient, /// public virtual IOnPremiseIotSensorsOperations OnPremiseIotSensors { get; private set; } + /// + /// Gets the IIotSitesOperations. + /// + public virtual IIotSitesOperations IotSites { get; private set; } + /// /// Initializes a new instance of the SecurityCenterClient class. /// @@ -635,6 +640,7 @@ private void Initialize() DevicesForHub = new DevicesForHubOperations(this); Device = new DeviceOperations(this); OnPremiseIotSensors = new OnPremiseIotSensorsOperations(this); + IotSites = new IotSitesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; @@ -665,8 +671,8 @@ private void Initialize() new Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("ruleType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("ruleType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("source"));