diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ActionsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ActionsOperations.cs index d74d588b5618..2b96c54e0bc5 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ActionsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ActionsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// ActionsOperations operations. /// - internal partial class ActionsOperations : IServiceOperations, IActionsOperations + internal partial class ActionsOperations : IServiceOperations, IActionsOperations { /// /// Initializes a new instance of the ActionsOperations class. @@ -36,7 +36,7 @@ internal partial class ActionsOperations : IServiceOperations, /// /// Thrown when a required parameter is null /// - internal ActionsOperations(SecurityInsights client) + internal ActionsOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal ActionsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all actions of alert rule. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRuleTemplatesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRuleTemplatesOperations.cs index 422cdc0e61c7..f17c3df4d9fc 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRuleTemplatesOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRuleTemplatesOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// AlertRuleTemplatesOperations operations. /// - internal partial class AlertRuleTemplatesOperations : IServiceOperations, IAlertRuleTemplatesOperations + internal partial class AlertRuleTemplatesOperations : IServiceOperations, IAlertRuleTemplatesOperations { /// /// Initializes a new instance of the AlertRuleTemplatesOperations class. @@ -36,7 +36,7 @@ internal partial class AlertRuleTemplatesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AlertRuleTemplatesOperations(SecurityInsights client) + internal AlertRuleTemplatesOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal AlertRuleTemplatesOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all alert rule templates. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRulesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRulesOperations.cs index eacafd1cf40a..a0fef971c404 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRulesOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRulesOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// AlertRulesOperations operations. /// - internal partial class AlertRulesOperations : IServiceOperations, IAlertRulesOperations + internal partial class AlertRulesOperations : IServiceOperations, IAlertRulesOperations { /// /// Initializes a new instance of the AlertRulesOperations class. @@ -36,7 +36,7 @@ internal partial class AlertRulesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AlertRulesOperations(SecurityInsights client) + internal AlertRulesOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal AlertRulesOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all alert rules. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AutomationRulesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AutomationRulesOperations.cs index d800ce802b6a..0677ac54ddf8 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AutomationRulesOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AutomationRulesOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// AutomationRulesOperations operations. /// - internal partial class AutomationRulesOperations : IServiceOperations, IAutomationRulesOperations + internal partial class AutomationRulesOperations : IServiceOperations, IAutomationRulesOperations { /// /// Initializes a new instance of the AutomationRulesOperations class. @@ -36,7 +36,7 @@ internal partial class AutomationRulesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AutomationRulesOperations(SecurityInsights client) + internal AutomationRulesOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal AutomationRulesOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets the automation rule. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkOperations.cs index 4e9346626c3f..8fa86232487f 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// BookmarkOperations operations. /// - internal partial class BookmarkOperations : IServiceOperations, IBookmarkOperations + internal partial class BookmarkOperations : IServiceOperations, IBookmarkOperations { /// /// Initializes a new instance of the BookmarkOperations class. @@ -36,7 +36,7 @@ internal partial class BookmarkOperations : IServiceOperations /// /// Thrown when a required parameter is null /// - internal BookmarkOperations(SecurityInsights client) + internal BookmarkOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal BookmarkOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Expand an bookmark diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkRelationsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkRelationsOperations.cs index 91f6924fc204..8e2e841bdba3 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkRelationsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkRelationsOperations.cs @@ -26,7 +26,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// BookmarkRelationsOperations operations. /// - internal partial class BookmarkRelationsOperations : IServiceOperations, IBookmarkRelationsOperations + internal partial class BookmarkRelationsOperations : IServiceOperations, IBookmarkRelationsOperations { /// /// Initializes a new instance of the BookmarkRelationsOperations class. @@ -37,7 +37,7 @@ internal partial class BookmarkRelationsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal BookmarkRelationsOperations(SecurityInsights client) + internal BookmarkRelationsOperations(SecurityInsightsClient client) { if (client == null) { @@ -47,9 +47,9 @@ internal BookmarkRelationsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all bookmark relations. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarksOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarksOperations.cs index b47656c600ec..6448169b7218 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarksOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarksOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// BookmarksOperations operations. /// - internal partial class BookmarksOperations : IServiceOperations, IBookmarksOperations + internal partial class BookmarksOperations : IServiceOperations, IBookmarksOperations { /// /// Initializes a new instance of the BookmarksOperations class. @@ -36,7 +36,7 @@ internal partial class BookmarksOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal BookmarksOperations(SecurityInsights client) + internal BookmarksOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal BookmarksOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all bookmarks. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsCheckRequirementsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsCheckRequirementsOperations.cs index c133cc2118c1..dc2808839a06 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsCheckRequirementsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsCheckRequirementsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// DataConnectorsCheckRequirementsOperations operations. /// - internal partial class DataConnectorsCheckRequirementsOperations : IServiceOperations, IDataConnectorsCheckRequirementsOperations + internal partial class DataConnectorsCheckRequirementsOperations : IServiceOperations, IDataConnectorsCheckRequirementsOperations { /// /// Initializes a new instance of the DataConnectorsCheckRequirementsOperations class. @@ -36,7 +36,7 @@ internal partial class DataConnectorsCheckRequirementsOperations : IServiceOpera /// /// Thrown when a required parameter is null /// - internal DataConnectorsCheckRequirementsOperations(SecurityInsights client) + internal DataConnectorsCheckRequirementsOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal DataConnectorsCheckRequirementsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Get requirements state for a data connector type. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsOperations.cs index 9c265a009a55..6e26d565e0b7 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// DataConnectorsOperations operations. /// - internal partial class DataConnectorsOperations : IServiceOperations, IDataConnectorsOperations + internal partial class DataConnectorsOperations : IServiceOperations, IDataConnectorsOperations { /// /// Initializes a new instance of the DataConnectorsOperations class. @@ -36,7 +36,7 @@ internal partial class DataConnectorsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DataConnectorsOperations(SecurityInsights client) + internal DataConnectorsOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal DataConnectorsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all data connectors. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DomainWhoisOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DomainWhoisOperations.cs index 5c08def4a2e4..4e8e6ef93d31 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DomainWhoisOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DomainWhoisOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// DomainWhoisOperations operations. /// - internal partial class DomainWhoisOperations : IServiceOperations, IDomainWhoisOperations + internal partial class DomainWhoisOperations : IServiceOperations, IDomainWhoisOperations { /// /// Initializes a new instance of the DomainWhoisOperations class. @@ -36,7 +36,7 @@ internal partial class DomainWhoisOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal DomainWhoisOperations(SecurityInsights client) + internal DomainWhoisOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal DomainWhoisOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Get whois information for a single domain name diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesGetTimelineOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesGetTimelineOperations.cs index 0c6e41b263c6..a8199a33ed66 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesGetTimelineOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesGetTimelineOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// EntitiesGetTimelineOperations operations. /// - internal partial class EntitiesGetTimelineOperations : IServiceOperations, IEntitiesGetTimelineOperations + internal partial class EntitiesGetTimelineOperations : IServiceOperations, IEntitiesGetTimelineOperations { /// /// Initializes a new instance of the EntitiesGetTimelineOperations class. @@ -36,7 +36,7 @@ internal partial class EntitiesGetTimelineOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal EntitiesGetTimelineOperations(SecurityInsights client) + internal EntitiesGetTimelineOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal EntitiesGetTimelineOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Timeline for an entity. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesOperations.cs index bdf70d9b958e..887590e35c20 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// EntitiesOperations operations. /// - internal partial class EntitiesOperations : IServiceOperations, IEntitiesOperations + internal partial class EntitiesOperations : IServiceOperations, IEntitiesOperations { /// /// Initializes a new instance of the EntitiesOperations class. @@ -36,7 +36,7 @@ internal partial class EntitiesOperations : IServiceOperations /// /// Thrown when a required parameter is null /// - internal EntitiesOperations(SecurityInsights client) + internal EntitiesOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal EntitiesOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all entities. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesRelationsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesRelationsOperations.cs index 3821405ef9ce..6c37b03fc81f 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesRelationsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesRelationsOperations.cs @@ -26,7 +26,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// EntitiesRelationsOperations operations. /// - internal partial class EntitiesRelationsOperations : IServiceOperations, IEntitiesRelationsOperations + internal partial class EntitiesRelationsOperations : IServiceOperations, IEntitiesRelationsOperations { /// /// Initializes a new instance of the EntitiesRelationsOperations class. @@ -37,7 +37,7 @@ internal partial class EntitiesRelationsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal EntitiesRelationsOperations(SecurityInsights client) + internal EntitiesRelationsOperations(SecurityInsightsClient client) { if (client == null) { @@ -47,9 +47,9 @@ internal EntitiesRelationsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all relations of an entity. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueriesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueriesOperations.cs index 9a749a3cc322..b15302ace52c 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueriesOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueriesOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// EntityQueriesOperations operations. /// - internal partial class EntityQueriesOperations : IServiceOperations, IEntityQueriesOperations + internal partial class EntityQueriesOperations : IServiceOperations, IEntityQueriesOperations { /// /// Initializes a new instance of the EntityQueriesOperations class. @@ -36,7 +36,7 @@ internal partial class EntityQueriesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal EntityQueriesOperations(SecurityInsights client) + internal EntityQueriesOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal EntityQueriesOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all entity queries. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueryTemplatesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueryTemplatesOperations.cs index 14011393b0d7..2b0938cb95f2 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueryTemplatesOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueryTemplatesOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// EntityQueryTemplatesOperations operations. /// - internal partial class EntityQueryTemplatesOperations : IServiceOperations, IEntityQueryTemplatesOperations + internal partial class EntityQueryTemplatesOperations : IServiceOperations, IEntityQueryTemplatesOperations { /// /// Initializes a new instance of the EntityQueryTemplatesOperations class. @@ -36,7 +36,7 @@ internal partial class EntityQueryTemplatesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal EntityQueryTemplatesOperations(SecurityInsights client) + internal EntityQueryTemplatesOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal EntityQueryTemplatesOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all entity query templates. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityRelationsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityRelationsOperations.cs index 428fb38c44f1..0dcd0ca2c60b 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityRelationsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityRelationsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// EntityRelationsOperations operations. /// - internal partial class EntityRelationsOperations : IServiceOperations, IEntityRelationsOperations + internal partial class EntityRelationsOperations : IServiceOperations, IEntityRelationsOperations { /// /// Initializes a new instance of the EntityRelationsOperations class. @@ -36,7 +36,7 @@ internal partial class EntityRelationsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal EntityRelationsOperations(SecurityInsights client) + internal EntityRelationsOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal EntityRelationsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets an entity relation. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/FileImportsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/FileImportsOperations.cs new file mode 100644 index 000000000000..a7e33844ae13 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/FileImportsOperations.cs @@ -0,0 +1,1260 @@ +// +// 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.SecurityInsights +{ + 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; + + /// + /// FileImportsOperations operations. + /// + internal partial class FileImportsOperations : IServiceOperations, IFileImportsOperations + { + /// + /// Initializes a new instance of the FileImportsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal FileImportsOperations(SecurityInsightsClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityInsightsClient + /// + public SecurityInsightsClient Client { get; private set; } + + /// + /// Gets all file imports. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Filters the results, based on a Boolean condition. Optional. + /// + /// + /// Sorts the results. Optional. + /// + /// + /// Returns only the first n results. Optional. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls. Optional. + /// + /// + /// 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 resourceGroupName, string workspaceName, string filter = default(string), string orderby = default(string), int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 90); + } + if (workspaceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("orderby", orderby); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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; + } + + /// + /// Gets a file import. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + /// + /// 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 resourceGroupName, string workspaceName, string fileImportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 90); + } + if (workspaceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 1); + } + } + if (fileImportId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fileImportId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("fileImportId", fileImportId); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{fileImportId}", System.Uri.EscapeDataString(fileImportId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + } + + /// + /// Creates the file import. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + /// + /// The file import + /// + /// + /// 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> CreateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string fileImportId, FileImport fileImport, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 90); + } + if (workspaceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 1); + } + } + if (fileImportId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fileImportId"); + } + if (fileImport == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fileImport"); + } + if (fileImport != null) + { + fileImport.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("fileImportId", fileImportId); + tracingParameters.Add("fileImport", fileImport); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{fileImportId}", System.Uri.EscapeDataString(fileImportId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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(fileImport != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(fileImport, 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 != 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 == 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 the file import. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string fileImportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, fileImportId, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete the file import. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + /// + /// 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> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string fileImportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 90); + } + if (workspaceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 1); + } + } + if (fileImportId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "fileImportId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("fileImportId", fileImportId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/fileImports/{fileImportId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{fileImportId}", System.Uri.EscapeDataString(fileImportId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 != 202 && (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(); + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _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; + } + + /// + /// Gets all file imports. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + 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; + } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/FileImportsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/FileImportsOperationsExtensions.cs new file mode 100644 index 000000000000..482dd1a8052d --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/FileImportsOperationsExtensions.cs @@ -0,0 +1,319 @@ +// +// 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.SecurityInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for FileImportsOperations. + /// + public static partial class FileImportsOperationsExtensions + { + /// + /// Gets all file imports. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Filters the results, based on a Boolean condition. Optional. + /// + /// + /// Sorts the results. Optional. + /// + /// + /// Returns only the first n results. Optional. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls. Optional. + /// + public static IPage List(this IFileImportsOperations operations, string resourceGroupName, string workspaceName, string filter = default(string), string orderby = default(string), int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Gets all file imports. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Filters the results, based on a Boolean condition. Optional. + /// + /// + /// Sorts the results. Optional. + /// + /// + /// Returns only the first n results. Optional. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls. Optional. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IFileImportsOperations operations, string resourceGroupName, string workspaceName, string filter = default(string), string orderby = default(string), int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, filter, orderby, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a file import. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + public static FileImport Get(this IFileImportsOperations operations, string resourceGroupName, string workspaceName, string fileImportId) + { + return operations.GetAsync(resourceGroupName, workspaceName, fileImportId).GetAwaiter().GetResult(); + } + + /// + /// Gets a file import. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IFileImportsOperations operations, string resourceGroupName, string workspaceName, string fileImportId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, fileImportId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates the file import. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + /// + /// The file import + /// + public static FileImport Create(this IFileImportsOperations operations, string resourceGroupName, string workspaceName, string fileImportId, FileImport fileImport) + { + return operations.CreateAsync(resourceGroupName, workspaceName, fileImportId, fileImport).GetAwaiter().GetResult(); + } + + /// + /// Creates the file import. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + /// + /// The file import + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IFileImportsOperations operations, string resourceGroupName, string workspaceName, string fileImportId, FileImport fileImport, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, workspaceName, fileImportId, fileImport, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete the file import. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + public static FileImport Delete(this IFileImportsOperations operations, string resourceGroupName, string workspaceName, string fileImportId) + { + return operations.DeleteAsync(resourceGroupName, workspaceName, fileImportId).GetAwaiter().GetResult(); + } + + /// + /// Delete the file import. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IFileImportsOperations operations, string resourceGroupName, string workspaceName, string fileImportId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, fileImportId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete the file import. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + public static FileImport BeginDelete(this IFileImportsOperations operations, string resourceGroupName, string workspaceName, string fileImportId) + { + return operations.BeginDeleteAsync(resourceGroupName, workspaceName, fileImportId).GetAwaiter().GetResult(); + } + + /// + /// Delete the file import. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IFileImportsOperations operations, string resourceGroupName, string workspaceName, string fileImportId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, fileImportId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all file imports. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IFileImportsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all file imports. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IFileImportsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IFileImportsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IFileImportsOperations.cs new file mode 100644 index 000000000000..9cbf941c51ad --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IFileImportsOperations.cs @@ -0,0 +1,205 @@ +// +// 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.SecurityInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// FileImportsOperations operations. + /// + public partial interface IFileImportsOperations + { + /// + /// Gets all file imports. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Filters the results, based on a Boolean condition. Optional. + /// + /// + /// Sorts the results. Optional. + /// + /// + /// Returns only the first n results. Optional. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skiptoken parameter + /// that specifies a starting point to use for subsequent calls. + /// Optional. + /// + /// + /// 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 resourceGroupName, string workspaceName, string filter = default(string), string orderby = default(string), int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a file import. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + /// + /// 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 resourceGroupName, string workspaceName, string fileImportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates the file import. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + /// + /// The file import + /// + /// + /// 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> CreateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string fileImportId, FileImport fileImport, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete the file import. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + /// + /// 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> DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string fileImportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete the file import. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// File import ID + /// + /// + /// 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> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string fileImportId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all file imports. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIncidentsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIncidentsOperations.cs index f5b147d54528..067c5d55797c 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIncidentsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIncidentsOperations.cs @@ -34,10 +34,10 @@ public partial interface IIncidentsOperations /// /// /// - /// - /// /// /// + /// + /// /// /// The headers that will be added to request. /// @@ -53,7 +53,7 @@ public partial interface IIncidentsOperations /// /// Thrown when a required parameter is null /// - Task> RunPlaybookWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentIdentifier, System.Guid? tenantId = default(System.Guid?), string logicAppsResourceId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RunPlaybookWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentIdentifier, string logicAppsResourceId, System.Guid? tenantId = default(System.Guid?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all incidents. /// diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IPGeodataOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IPGeodataOperations.cs index 9ecfbdce7dd0..e1a36829d4b5 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IPGeodataOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IPGeodataOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// IPGeodataOperations operations. /// - internal partial class IPGeodataOperations : IServiceOperations, IIPGeodataOperations + internal partial class IPGeodataOperations : IServiceOperations, IIPGeodataOperations { /// /// Initializes a new instance of the IPGeodataOperations class. @@ -36,7 +36,7 @@ internal partial class IPGeodataOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal IPGeodataOperations(SecurityInsights client) + internal IPGeodataOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal IPGeodataOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Get geodata for a single IP address diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISecurityInsights.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISecurityInsightsClient.cs similarity index 92% rename from sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISecurityInsights.cs rename to sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISecurityInsightsClient.cs index 48a9d8edc1a1..f99e26b5d12b 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISecurityInsights.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISecurityInsightsClient.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// API spec for Microsoft.SecurityInsights (Azure Security Insights) /// resource provider /// - public partial interface ISecurityInsights : System.IDisposable + public partial interface ISecurityInsightsClient : System.IDisposable { /// /// The base URI of the service. @@ -150,6 +150,11 @@ public partial interface ISecurityInsights : System.IDisposable /// IEntityQueryTemplatesOperations EntityQueryTemplates { get; } + /// + /// Gets the IFileImportsOperations. + /// + IFileImportsOperations FileImports { get; } + /// /// Gets the IIncidentCommentsOperations. /// @@ -175,6 +180,11 @@ public partial interface ISecurityInsights : System.IDisposable /// ISentinelOnboardingStatesOperations SentinelOnboardingStates { get; } + /// + /// Gets the ISecurityMLAnalyticsSettingsOperations. + /// + ISecurityMLAnalyticsSettingsOperations SecurityMLAnalyticsSettings { get; } + /// /// Gets the IProductSettingsOperations. /// @@ -215,6 +225,11 @@ public partial interface ISecurityInsights : System.IDisposable /// IWatchlistItemsOperations WatchlistItems { get; } + /// + /// Gets the IWorkspaceManagerGroupsOperations. + /// + IWorkspaceManagerGroupsOperations WorkspaceManagerGroups { get; } + /// /// Gets the IDataConnectorsOperations. /// diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISecurityMLAnalyticsSettingsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISecurityMLAnalyticsSettingsOperations.cs new file mode 100644 index 000000000000..f3389cf76edd --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISecurityMLAnalyticsSettingsOperations.cs @@ -0,0 +1,158 @@ +// +// 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.SecurityInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SecurityMLAnalyticsSettingsOperations operations. + /// + public partial interface ISecurityMLAnalyticsSettingsOperations + { + /// + /// Gets all Security ML Analytics Settings. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the Security ML Analytics Settings. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Security ML Analytics Settings resource name + /// + /// + /// 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 resourceGroupName, string workspaceName, string settingsResourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates the Security ML Analytics Settings. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Security ML Analytics Settings resource name + /// + /// + /// The security ML Analytics setting + /// + /// + /// 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 resourceGroupName, string workspaceName, string settingsResourceName, SecurityMLAnalyticsSetting securityMLAnalyticsSetting, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete the Security ML Analytics Settings. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Security ML Analytics Settings resource name + /// + /// + /// 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 resourceGroupName, string workspaceName, string settingsResourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all Security ML Analytics Settings. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IWorkspaceManagerGroupsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IWorkspaceManagerGroupsOperations.cs new file mode 100644 index 000000000000..f66fa3ddacb1 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IWorkspaceManagerGroupsOperations.cs @@ -0,0 +1,171 @@ +// +// 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.SecurityInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// WorkspaceManagerGroupsOperations operations. + /// + public partial interface IWorkspaceManagerGroupsOperations + { + /// + /// Gets all workspace manager groups in the Sentinel workspace manager + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Sorts the results. Optional. + /// + /// + /// Returns only the first n results. Optional. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial + /// result. If a previous response contains a nextLink element, the + /// value of the nextLink element will include a skiptoken parameter + /// that specifies a starting point to use for subsequent calls. + /// Optional. + /// + /// + /// 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 resourceGroupName, string workspaceName, string orderby = default(string), int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a workspace manager group + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the workspace manager group + /// + /// + /// 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 resourceGroupName, string workspaceName, string workspaceManagerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a workspace manager group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the workspace manager group + /// + /// + /// The workspace manager group object + /// + /// + /// 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 resourceGroupName, string workspaceName, string workspaceManagerGroupName, WorkspaceManagerGroup workspaceManagerGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a workspace manager group + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the workspace manager group + /// + /// + /// 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 resourceGroupName, string workspaceName, string workspaceManagerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all workspace manager groups in the Sentinel workspace manager + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentCommentsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentCommentsOperations.cs index 20668fe8068b..8d7193857969 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentCommentsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentCommentsOperations.cs @@ -26,7 +26,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// IncidentCommentsOperations operations. /// - internal partial class IncidentCommentsOperations : IServiceOperations, IIncidentCommentsOperations + internal partial class IncidentCommentsOperations : IServiceOperations, IIncidentCommentsOperations { /// /// Initializes a new instance of the IncidentCommentsOperations class. @@ -37,7 +37,7 @@ internal partial class IncidentCommentsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal IncidentCommentsOperations(SecurityInsights client) + internal IncidentCommentsOperations(SecurityInsightsClient client) { if (client == null) { @@ -47,9 +47,9 @@ internal IncidentCommentsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all incident comments. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentRelationsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentRelationsOperations.cs index a9f18a98b415..8420c69cd761 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentRelationsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentRelationsOperations.cs @@ -26,7 +26,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// IncidentRelationsOperations operations. /// - internal partial class IncidentRelationsOperations : IServiceOperations, IIncidentRelationsOperations + internal partial class IncidentRelationsOperations : IServiceOperations, IIncidentRelationsOperations { /// /// Initializes a new instance of the IncidentRelationsOperations class. @@ -37,7 +37,7 @@ internal partial class IncidentRelationsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal IncidentRelationsOperations(SecurityInsights client) + internal IncidentRelationsOperations(SecurityInsightsClient client) { if (client == null) { @@ -47,9 +47,9 @@ internal IncidentRelationsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all incident relations. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentsOperations.cs index 7d4ebaa00a57..05385115c86f 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// IncidentsOperations operations. /// - internal partial class IncidentsOperations : IServiceOperations, IIncidentsOperations + internal partial class IncidentsOperations : IServiceOperations, IIncidentsOperations { /// /// Initializes a new instance of the IncidentsOperations class. @@ -36,7 +36,7 @@ internal partial class IncidentsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal IncidentsOperations(SecurityInsights client) + internal IncidentsOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal IncidentsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Triggers playbook on a specific incident @@ -61,10 +61,10 @@ internal IncidentsOperations(SecurityInsights client) /// /// /// - /// - /// /// /// + /// + /// /// /// Headers that will be added to request. /// @@ -86,7 +86,7 @@ internal IncidentsOperations(SecurityInsights client) /// /// A response object containing the response body and response headers. /// - public async Task> RunPlaybookWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentIdentifier, System.Guid? tenantId = default(System.Guid?), string logicAppsResourceId = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> RunPlaybookWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentIdentifier, string logicAppsResourceId, System.Guid? tenantId = default(System.Guid?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -144,6 +144,10 @@ internal IncidentsOperations(SecurityInsights client) { throw new ValidationException(ValidationRules.CannotBeNull, "incidentIdentifier"); } + if (logicAppsResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "logicAppsResourceId"); + } ManualTriggerRequestBody requestBody = default(ManualTriggerRequestBody); if (tenantId != null || logicAppsResourceId != null) { diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentsOperationsExtensions.cs index f3ee8378cffd..2c9e96f2d472 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentsOperationsExtensions.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentsOperationsExtensions.cs @@ -35,13 +35,13 @@ public static partial class IncidentsOperationsExtensions /// /// /// - /// - /// /// /// - public static object RunPlaybook(this IIncidentsOperations operations, string resourceGroupName, string workspaceName, string incidentIdentifier, System.Guid? tenantId = default(System.Guid?), string logicAppsResourceId = default(string)) + /// + /// + public static object RunPlaybook(this IIncidentsOperations operations, string resourceGroupName, string workspaceName, string incidentIdentifier, string logicAppsResourceId, System.Guid? tenantId = default(System.Guid?)) { - return operations.RunPlaybookAsync(resourceGroupName, workspaceName, incidentIdentifier, tenantId, logicAppsResourceId).GetAwaiter().GetResult(); + return operations.RunPlaybookAsync(resourceGroupName, workspaceName, incidentIdentifier, logicAppsResourceId, tenantId).GetAwaiter().GetResult(); } /// @@ -58,16 +58,16 @@ public static partial class IncidentsOperationsExtensions /// /// /// - /// - /// /// /// + /// + /// /// /// The cancellation token. /// - public static async Task RunPlaybookAsync(this IIncidentsOperations operations, string resourceGroupName, string workspaceName, string incidentIdentifier, System.Guid? tenantId = default(System.Guid?), string logicAppsResourceId = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RunPlaybookAsync(this IIncidentsOperations operations, string resourceGroupName, string workspaceName, string incidentIdentifier, string logicAppsResourceId, System.Guid? tenantId = default(System.Guid?), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.RunPlaybookWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentIdentifier, tenantId, logicAppsResourceId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RunPlaybookWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentIdentifier, logicAppsResourceId, tenantId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/MetadataOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/MetadataOperations.cs index 45ebdac256b0..fa9c23e4bcf0 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/MetadataOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/MetadataOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// MetadataOperations operations. /// - internal partial class MetadataOperations : IServiceOperations, IMetadataOperations + internal partial class MetadataOperations : IServiceOperations, IMetadataOperations { /// /// Initializes a new instance of the MetadataOperations class. @@ -36,7 +36,7 @@ internal partial class MetadataOperations : IServiceOperations /// /// Thrown when a required parameter is null /// - internal MetadataOperations(SecurityInsights client) + internal MetadataOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal MetadataOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// List of all metadata diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityCustomEntityQuery.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityCustomEntityQuery.cs index 90d755c93950..82af8ba5e902 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityCustomEntityQuery.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityCustomEntityQuery.cs @@ -56,7 +56,7 @@ public ActivityCustomEntityQuery() /// 'Malware', 'Process', 'RegistryKey', 'RegistryValue', /// 'SecurityGroup', 'URL', 'IoTDevice', 'SecurityAlert', /// 'HuntingBookmark', 'MailCluster', 'MailMessage', 'Mailbox', - /// 'SubmissionMail' + /// 'SubmissionMail', 'Nic' /// List of the fields of the /// source entity that are required to run the query /// The query applied only to entities @@ -121,7 +121,7 @@ public ActivityCustomEntityQuery() /// 'CloudApplication', 'DNS', 'FileHash', 'IP', 'Malware', 'Process', /// 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'URL', /// 'IoTDevice', 'SecurityAlert', 'HuntingBookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' + /// 'MailMessage', 'Mailbox', 'SubmissionMail', 'Nic' /// [JsonProperty(PropertyName = "properties.inputEntityType")] public string InputEntityType { get; set; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQuery.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQuery.cs index de83406d7424..63629813d2f3 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQuery.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQuery.cs @@ -56,7 +56,7 @@ public ActivityEntityQuery() /// 'Malware', 'Process', 'RegistryKey', 'RegistryValue', /// 'SecurityGroup', 'URL', 'IoTDevice', 'SecurityAlert', /// 'HuntingBookmark', 'MailCluster', 'MailMessage', 'Mailbox', - /// 'SubmissionMail' + /// 'SubmissionMail', 'Nic' /// List of the fields of the /// source entity that are required to run the query /// The query applied only to entities @@ -121,7 +121,7 @@ public ActivityEntityQuery() /// 'CloudApplication', 'DNS', 'FileHash', 'IP', 'Malware', 'Process', /// 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'URL', /// 'IoTDevice', 'SecurityAlert', 'HuntingBookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' + /// 'MailMessage', 'Mailbox', 'SubmissionMail', 'Nic' /// [JsonProperty(PropertyName = "properties.inputEntityType")] public string InputEntityType { get; set; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQueryTemplate.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQueryTemplate.cs index 5c153c6a3c06..f7643158a6c0 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQueryTemplate.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQueryTemplate.cs @@ -59,7 +59,7 @@ public ActivityEntityQueryTemplate() /// 'Malware', 'Process', 'RegistryKey', 'RegistryValue', /// 'SecurityGroup', 'URL', 'IoTDevice', 'SecurityAlert', /// 'HuntingBookmark', 'MailCluster', 'MailMessage', 'Mailbox', - /// 'SubmissionMail' + /// 'SubmissionMail', 'Nic' /// List of the fields of the /// source entity that are required to run the query /// The query applied only to entities @@ -120,7 +120,7 @@ public ActivityEntityQueryTemplate() /// 'CloudApplication', 'DNS', 'FileHash', 'IP', 'Malware', 'Process', /// 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'URL', /// 'IoTDevice', 'SecurityAlert', 'HuntingBookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' + /// 'MailMessage', 'Mailbox', 'SubmissionMail', 'Nic' /// [JsonProperty(PropertyName = "properties.inputEntityType")] public string InputEntityType { get; set; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertDetailsOverride.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertDetailsOverride.cs index e42ab0f0cbe0..6e8cd06c01ac 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertDetailsOverride.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertDetailsOverride.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -37,12 +39,15 @@ public AlertDetailsOverride() /// alert tactics from /// the column name to take the /// alert severity from - public AlertDetailsOverride(string alertDisplayNameFormat = default(string), string alertDescriptionFormat = default(string), string alertTacticsColumnName = default(string), string alertSeverityColumnName = default(string)) + /// List of additional dynamic + /// properties to override + public AlertDetailsOverride(string alertDisplayNameFormat = default(string), string alertDescriptionFormat = default(string), string alertTacticsColumnName = default(string), string alertSeverityColumnName = default(string), IList alertDynamicProperties = default(IList)) { AlertDisplayNameFormat = alertDisplayNameFormat; AlertDescriptionFormat = alertDescriptionFormat; AlertTacticsColumnName = alertTacticsColumnName; AlertSeverityColumnName = alertSeverityColumnName; + AlertDynamicProperties = alertDynamicProperties; CustomInit(); } @@ -77,5 +82,11 @@ public AlertDetailsOverride() [JsonProperty(PropertyName = "alertSeverityColumnName")] public string AlertSeverityColumnName { get; set; } + /// + /// Gets or sets list of additional dynamic properties to override + /// + [JsonProperty(PropertyName = "alertDynamicProperties")] + public IList AlertDynamicProperties { get; set; } + } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertProperty.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertProperty.cs new file mode 100644 index 000000000000..cf8043044b7a --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertProperty.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.SecurityInsights.Models +{ + + /// + /// Defines values for AlertProperty. + /// + public static class AlertProperty + { + /// + /// Alert's link + /// + public const string AlertLink = "AlertLink"; + /// + /// Confidence level property + /// + public const string ConfidenceLevel = "ConfidenceLevel"; + /// + /// Confidence score + /// + public const string ConfidenceScore = "ConfidenceScore"; + /// + /// Extended links to the alert + /// + public const string ExtendedLinks = "ExtendedLinks"; + /// + /// Product name alert property + /// + public const string ProductName = "ProductName"; + /// + /// Provider name alert property + /// + public const string ProviderName = "ProviderName"; + /// + /// Product component name alert property + /// + public const string ProductComponentName = "ProductComponentName"; + /// + /// Remediation steps alert property + /// + public const string RemediationSteps = "RemediationSteps"; + /// + /// Techniques alert property + /// + public const string Techniques = "Techniques"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertPropertyMapping.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertPropertyMapping.cs new file mode 100644 index 000000000000..9e294a9fa022 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertPropertyMapping.cs @@ -0,0 +1,66 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A single alert property mapping to override + /// + public partial class AlertPropertyMapping + { + /// + /// Initializes a new instance of the AlertPropertyMapping class. + /// + public AlertPropertyMapping() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AlertPropertyMapping class. + /// + /// Possible values include: 'AlertLink', + /// 'ConfidenceLevel', 'ConfidenceScore', 'ExtendedLinks', + /// 'ProductName', 'ProviderName', 'ProductComponentName', + /// 'RemediationSteps', 'Techniques' + /// the column name to use to override this + /// property + public AlertPropertyMapping(string alertProperty = default(string), string value = default(string)) + { + AlertProperty = alertProperty; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'AlertLink', + /// 'ConfidenceLevel', 'ConfidenceScore', 'ExtendedLinks', + /// 'ProductName', 'ProviderName', 'ProductComponentName', + /// 'RemediationSteps', 'Techniques' + /// + [JsonProperty(PropertyName = "alertProperty")] + public string AlertProperty { get; set; } + + /// + /// Gets or sets the column name to use to override this property + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AnomalySecurityMLAnalyticsSettings.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AnomalySecurityMLAnalyticsSettings.cs new file mode 100644 index 000000000000..73f762f8aae4 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AnomalySecurityMLAnalyticsSettings.cs @@ -0,0 +1,221 @@ +// +// 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.SecurityInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents Anomaly Security ML Analytics Settings + /// + [Newtonsoft.Json.JsonObject("Anomaly")] + [Rest.Serialization.JsonTransformation] + public partial class AnomalySecurityMLAnalyticsSettings : SecurityMLAnalyticsSetting + { + /// + /// Initializes a new instance of the + /// AnomalySecurityMLAnalyticsSettings class. + /// + public AnomalySecurityMLAnalyticsSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AnomalySecurityMLAnalyticsSettings class. + /// + /// The display name for settings created by + /// this SecurityMLAnalyticsSettings. + /// Determines whether this settings is enabled + /// or disabled. + /// The anomaly version of the + /// AnomalySecurityMLAnalyticsSettings. + /// The frequency that this + /// SecurityMLAnalyticsSettings will be run. + /// The anomaly + /// SecurityMLAnalyticsSettings status. Possible values include: + /// 'Production', 'Flighting' + /// Determines whether this anomaly + /// security ml analytics settings is a default settings + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// Etag of the azure resource + /// The description of the + /// SecurityMLAnalyticsSettings. + /// The last time that this + /// SecurityMLAnalyticsSettings has been modified. + /// The required data sources for + /// this SecurityMLAnalyticsSettings + /// The tactics of the + /// SecurityMLAnalyticsSettings + /// The techniques of the + /// SecurityMLAnalyticsSettings + /// The customizable + /// observations of the AnomalySecurityMLAnalyticsSettings. + /// The anomaly settings version + /// of the Anomaly security ml analytics settings that dictates whether + /// job version gets updated or not. + /// The anomaly settings definition + /// Id + public AnomalySecurityMLAnalyticsSettings(string displayName, bool enabled, string anomalyVersion, System.TimeSpan frequency, string settingsStatus, bool isDefaultSettings, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string description = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?), IList requiredDataConnectors = default(IList), IList tactics = default(IList), IList techniques = default(IList), object customizableObservations = default(object), int? anomalySettingsVersion = default(int?), System.Guid? settingsDefinitionId = default(System.Guid?)) + : base(id, name, type, systemData, etag) + { + Description = description; + DisplayName = displayName; + Enabled = enabled; + LastModifiedUtc = lastModifiedUtc; + RequiredDataConnectors = requiredDataConnectors; + Tactics = tactics; + Techniques = techniques; + AnomalyVersion = anomalyVersion; + CustomizableObservations = customizableObservations; + Frequency = frequency; + SettingsStatus = settingsStatus; + IsDefaultSettings = isDefaultSettings; + AnomalySettingsVersion = anomalySettingsVersion; + SettingsDefinitionId = settingsDefinitionId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the description of the SecurityMLAnalyticsSettings. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets the display name for settings created by this + /// SecurityMLAnalyticsSettings. + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets determines whether this settings is enabled or + /// disabled. + /// + [JsonProperty(PropertyName = "properties.enabled")] + public bool Enabled { get; set; } + + /// + /// Gets the last time that this SecurityMLAnalyticsSettings has been + /// modified. + /// + [JsonProperty(PropertyName = "properties.lastModifiedUtc")] + public System.DateTime? LastModifiedUtc { get; private set; } + + /// + /// Gets or sets the required data sources for this + /// SecurityMLAnalyticsSettings + /// + [JsonProperty(PropertyName = "properties.requiredDataConnectors")] + public IList RequiredDataConnectors { get; set; } + + /// + /// Gets or sets the tactics of the SecurityMLAnalyticsSettings + /// + [JsonProperty(PropertyName = "properties.tactics")] + public IList Tactics { get; set; } + + /// + /// Gets or sets the techniques of the SecurityMLAnalyticsSettings + /// + [JsonProperty(PropertyName = "properties.techniques")] + public IList Techniques { get; set; } + + /// + /// Gets or sets the anomaly version of the + /// AnomalySecurityMLAnalyticsSettings. + /// + [JsonProperty(PropertyName = "properties.anomalyVersion")] + public string AnomalyVersion { get; set; } + + /// + /// Gets or sets the customizable observations of the + /// AnomalySecurityMLAnalyticsSettings. + /// + [JsonProperty(PropertyName = "properties.customizableObservations")] + public object CustomizableObservations { get; set; } + + /// + /// Gets or sets the frequency that this SecurityMLAnalyticsSettings + /// will be run. + /// + [JsonProperty(PropertyName = "properties.frequency")] + public System.TimeSpan Frequency { get; set; } + + /// + /// Gets or sets the anomaly SecurityMLAnalyticsSettings status. + /// Possible values include: 'Production', 'Flighting' + /// + [JsonProperty(PropertyName = "properties.settingsStatus")] + public string SettingsStatus { get; set; } + + /// + /// Gets or sets determines whether this anomaly security ml analytics + /// settings is a default settings + /// + [JsonProperty(PropertyName = "properties.isDefaultSettings")] + public bool IsDefaultSettings { get; set; } + + /// + /// Gets or sets the anomaly settings version of the Anomaly security + /// ml analytics settings that dictates whether job version gets + /// updated or not. + /// + [JsonProperty(PropertyName = "properties.anomalySettingsVersion")] + public int? AnomalySettingsVersion { get; set; } + + /// + /// Gets or sets the anomaly settings definition Id + /// + [JsonProperty(PropertyName = "properties.settingsDefinitionId")] + public System.Guid? SettingsDefinitionId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DisplayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); + } + if (AnomalyVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AnomalyVersion"); + } + if (SettingsStatus == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SettingsStatus"); + } + } + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AnomalyTimelineItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AnomalyTimelineItem.cs new file mode 100644 index 000000000000..f46ce5dafdf7 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AnomalyTimelineItem.cs @@ -0,0 +1,153 @@ +// +// 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.SecurityInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents anomaly timeline item. + /// + [Newtonsoft.Json.JsonObject("Anomaly")] + public partial class AnomalyTimelineItem : EntityTimelineItem + { + /// + /// Initializes a new instance of the AnomalyTimelineItem class. + /// + public AnomalyTimelineItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AnomalyTimelineItem class. + /// + /// The anomaly azure resource + /// id. + /// The anomaly name. + /// The anomaly end time. + /// The anomaly start time. + /// The anomaly generated time. + /// The anomaly product name. + /// The anomaly description. + /// The name of the anomaly vendor. + /// The intent of the anomaly. + /// The techniques of the anomaly. + /// The reasons that cause the anomaly. + public AnomalyTimelineItem(string azureResourceId, string displayName, System.DateTime endTimeUtc, System.DateTime startTimeUtc, System.DateTime timeGenerated, string productName = default(string), string description = default(string), string vendor = default(string), string intent = default(string), IList techniques = default(IList), IList reasons = default(IList)) + { + AzureResourceId = azureResourceId; + ProductName = productName; + Description = description; + DisplayName = displayName; + EndTimeUtc = endTimeUtc; + StartTimeUtc = startTimeUtc; + TimeGenerated = timeGenerated; + Vendor = vendor; + Intent = intent; + Techniques = techniques; + Reasons = reasons; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the anomaly azure resource id. + /// + [JsonProperty(PropertyName = "azureResourceId")] + public string AzureResourceId { get; set; } + + /// + /// Gets or sets the anomaly product name. + /// + [JsonProperty(PropertyName = "productName")] + public string ProductName { get; set; } + + /// + /// Gets or sets the anomaly description. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets the anomaly name. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets the anomaly end time. + /// + [JsonProperty(PropertyName = "endTimeUtc")] + public System.DateTime EndTimeUtc { get; set; } + + /// + /// Gets or sets the anomaly start time. + /// + [JsonProperty(PropertyName = "startTimeUtc")] + public System.DateTime StartTimeUtc { get; set; } + + /// + /// Gets or sets the anomaly generated time. + /// + [JsonProperty(PropertyName = "timeGenerated")] + public System.DateTime TimeGenerated { get; set; } + + /// + /// Gets or sets the name of the anomaly vendor. + /// + [JsonProperty(PropertyName = "vendor")] + public string Vendor { get; set; } + + /// + /// Gets or sets the intent of the anomaly. + /// + [JsonProperty(PropertyName = "intent")] + public string Intent { get; set; } + + /// + /// Gets or sets the techniques of the anomaly. + /// + [JsonProperty(PropertyName = "techniques")] + public IList Techniques { get; set; } + + /// + /// Gets or sets the reasons that cause the anomaly. + /// + [JsonProperty(PropertyName = "reasons")] + public IList Reasons { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AzureResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AzureResourceId"); + } + if (DisplayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); + } + } + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRule.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRule.cs index dc0a44be99ce..24634eab5a0b 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRule.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRule.cs @@ -25,7 +25,6 @@ public partial class AutomationRule : ResourceWithEtag /// public AutomationRule() { - TriggeringLogic = new AutomationRuleTriggeringLogic(); CustomInit(); } @@ -33,11 +32,11 @@ public AutomationRule() /// Initializes a new instance of the AutomationRule class. /// /// The display name of the automation - /// rule + /// rule. /// The order of execution of the automation - /// rule + /// rule. /// The actions to execute when the automation - /// rule is triggered + /// rule is triggered. /// Fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// The name of the resource @@ -48,9 +47,9 @@ public AutomationRule() /// createdBy and modifiedBy information. /// Etag of the azure resource /// The last time the automation rule - /// was updated + /// was updated. /// The time the automation rule was - /// created + /// created. public AutomationRule(string displayName, int order, AutomationRuleTriggeringLogic triggeringLogic, IList actions, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), System.DateTime? createdTimeUtc = default(System.DateTime?), ClientInfo lastModifiedBy = default(ClientInfo), ClientInfo createdBy = default(ClientInfo)) : base(id, name, type, systemData, etag) { @@ -71,13 +70,13 @@ public AutomationRule() partial void CustomInit(); /// - /// Gets or sets the display name of the automation rule + /// Gets or sets the display name of the automation rule. /// [JsonProperty(PropertyName = "properties.displayName")] public string DisplayName { get; set; } /// - /// Gets or sets the order of execution of the automation rule + /// Gets or sets the order of execution of the automation rule. /// [JsonProperty(PropertyName = "properties.order")] public int Order { get; set; } @@ -89,19 +88,19 @@ public AutomationRule() /// /// Gets or sets the actions to execute when the automation rule is - /// triggered + /// triggered. /// [JsonProperty(PropertyName = "properties.actions")] public IList Actions { get; set; } /// - /// Gets the last time the automation rule was updated + /// Gets the last time the automation rule was updated. /// [JsonProperty(PropertyName = "properties.lastModifiedTimeUtc")] public System.DateTime? LastModifiedTimeUtc { get; private set; } /// - /// Gets the time the automation rule was created + /// Gets the time the automation rule was created. /// [JsonProperty(PropertyName = "properties.createdTimeUtc")] public System.DateTime? CreatedTimeUtc { get; private set; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleAction.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleAction.cs index 8cbf8dfe910e..352c5358710a 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleAction.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleAction.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models using System.Linq; /// - /// Describes an automation rule action + /// Describes an automation rule action. /// public partial class AutomationRuleAction { diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleBooleanCondition.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleBooleanCondition.cs new file mode 100644 index 000000000000..276e4ea2e4bd --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleBooleanCondition.cs @@ -0,0 +1,80 @@ +// +// 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.SecurityInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class AutomationRuleBooleanCondition + { + /// + /// Initializes a new instance of the AutomationRuleBooleanCondition + /// class. + /// + public AutomationRuleBooleanCondition() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AutomationRuleBooleanCondition + /// class. + /// + /// Possible values include: 'And', + /// 'Or' + public AutomationRuleBooleanCondition(string operatorProperty = default(string), IList innerConditions = default(IList)) + { + OperatorProperty = operatorProperty; + InnerConditions = innerConditions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'And', 'Or' + /// + [JsonProperty(PropertyName = "operator")] + public string OperatorProperty { get; set; } + + /// + /// + [JsonProperty(PropertyName = "innerConditions")] + public IList InnerConditions { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (InnerConditions != null) + { + if (InnerConditions.Count > 10) + { + throw new ValidationException(ValidationRules.MaxItems, "InnerConditions", 10); + } + if (InnerConditions.Count < 2) + { + throw new ValidationException(ValidationRules.MinItems, "InnerConditions", 2); + } + } + } + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleBooleanConditionSupportedOperator.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleBooleanConditionSupportedOperator.cs new file mode 100644 index 000000000000..74c1892d19bf --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleBooleanConditionSupportedOperator.cs @@ -0,0 +1,29 @@ +// +// 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.SecurityInsights.Models +{ + + /// + /// Defines values for AutomationRuleBooleanConditionSupportedOperator. + /// + public static class AutomationRuleBooleanConditionSupportedOperator + { + /// + /// Evaluates as true if all the item conditions are evaluated as true + /// + public const string And = "And"; + /// + /// Evaluates as true if at least one of the item conditions are + /// evaluated as true + /// + public const string Or = "Or"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleCondition.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleCondition.cs index 3647e487416a..1dfdb1fe6b7d 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleCondition.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleCondition.cs @@ -13,7 +13,7 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models using System.Linq; /// - /// Describes an automation rule condition + /// Describes an automation rule condition. /// public partial class AutomationRuleCondition { diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayChangedConditionSupportedArrayType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayChangedConditionSupportedArrayType.cs new file mode 100644 index 000000000000..73d06e54f4af --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayChangedConditionSupportedArrayType.cs @@ -0,0 +1,37 @@ +// +// 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.SecurityInsights.Models +{ + + /// + /// Defines values for + /// AutomationRulePropertyArrayChangedConditionSupportedArrayType. + /// + public static class AutomationRulePropertyArrayChangedConditionSupportedArrayType + { + /// + /// Evaluate the condition on the alerts + /// + public const string Alerts = "Alerts"; + /// + /// Evaluate the condition on the labels + /// + public const string Labels = "Labels"; + /// + /// Evaluate the condition on the tactics + /// + public const string Tactics = "Tactics"; + /// + /// Evaluate the condition on the comments + /// + public const string Comments = "Comments"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayChangedConditionSupportedChangeType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayChangedConditionSupportedChangeType.cs new file mode 100644 index 000000000000..0e2d123cac5b --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayChangedConditionSupportedChangeType.cs @@ -0,0 +1,25 @@ +// +// 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.SecurityInsights.Models +{ + + /// + /// Defines values for + /// AutomationRulePropertyArrayChangedConditionSupportedChangeType. + /// + public static class AutomationRulePropertyArrayChangedConditionSupportedChangeType + { + /// + /// Evaluate the condition on items added to the array + /// + public const string Added = "Added"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayChangedValuesCondition.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayChangedValuesCondition.cs new file mode 100644 index 000000000000..48a1dee07db4 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayChangedValuesCondition.cs @@ -0,0 +1,60 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class AutomationRulePropertyArrayChangedValuesCondition + { + /// + /// Initializes a new instance of the + /// AutomationRulePropertyArrayChangedValuesCondition class. + /// + public AutomationRulePropertyArrayChangedValuesCondition() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AutomationRulePropertyArrayChangedValuesCondition class. + /// + /// Possible values include: 'Alerts', + /// 'Labels', 'Tactics', 'Comments' + /// Possible values include: 'Added' + public AutomationRulePropertyArrayChangedValuesCondition(string arrayType = default(string), string changeType = default(string)) + { + ArrayType = arrayType; + ChangeType = changeType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'Alerts', 'Labels', + /// 'Tactics', 'Comments' + /// + [JsonProperty(PropertyName = "arrayType")] + public string ArrayType { get; set; } + + /// + /// Gets or sets possible values include: 'Added' + /// + [JsonProperty(PropertyName = "changeType")] + public string ChangeType { get; set; } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayConditionSupportedArrayConditionType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayConditionSupportedArrayConditionType.cs new file mode 100644 index 000000000000..9c40d5a13b54 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayConditionSupportedArrayConditionType.cs @@ -0,0 +1,25 @@ +// +// 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.SecurityInsights.Models +{ + + /// + /// Defines values for + /// AutomationRulePropertyArrayConditionSupportedArrayConditionType. + /// + public static class AutomationRulePropertyArrayConditionSupportedArrayConditionType + { + /// + /// Evaluate the condition as true if any item fulfills it + /// + public const string AnyItem = "AnyItem"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayConditionSupportedArrayType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayConditionSupportedArrayType.cs new file mode 100644 index 000000000000..2905d04dfce1 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayConditionSupportedArrayType.cs @@ -0,0 +1,29 @@ +// +// 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.SecurityInsights.Models +{ + + /// + /// Defines values for + /// AutomationRulePropertyArrayConditionSupportedArrayType. + /// + public static class AutomationRulePropertyArrayConditionSupportedArrayType + { + /// + /// Evaluate the condition on the custom detail keys + /// + public const string CustomDetails = "CustomDetails"; + /// + /// Evaluate the condition on a custom detail's values + /// + public const string CustomDetailValues = "CustomDetailValues"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayValuesCondition.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayValuesCondition.cs new file mode 100644 index 000000000000..d93d1f634a34 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyArrayValuesCondition.cs @@ -0,0 +1,86 @@ +// +// 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.SecurityInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class AutomationRulePropertyArrayValuesCondition + { + /// + /// Initializes a new instance of the + /// AutomationRulePropertyArrayValuesCondition class. + /// + public AutomationRulePropertyArrayValuesCondition() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AutomationRulePropertyArrayValuesCondition class. + /// + /// Possible values include: 'CustomDetails', + /// 'CustomDetailValues' + /// Possible values include: + /// 'AnyItem' + public AutomationRulePropertyArrayValuesCondition(string arrayType = default(string), string arrayConditionType = default(string), IList itemConditions = default(IList)) + { + ArrayType = arrayType; + ArrayConditionType = arrayConditionType; + ItemConditions = itemConditions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'CustomDetails', + /// 'CustomDetailValues' + /// + [JsonProperty(PropertyName = "arrayType")] + public string ArrayType { get; set; } + + /// + /// Gets or sets possible values include: 'AnyItem' + /// + [JsonProperty(PropertyName = "arrayConditionType")] + public string ArrayConditionType { get; set; } + + /// + /// + [JsonProperty(PropertyName = "itemConditions")] + public IList ItemConditions { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ItemConditions != null) + { + if (ItemConditions.Count > 10) + { + throw new ValidationException(ValidationRules.MaxItems, "ItemConditions", 10); + } + } + } + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyChangedConditionSupportedChangedType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyChangedConditionSupportedChangedType.cs new file mode 100644 index 000000000000..de73b52a43a3 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyChangedConditionSupportedChangedType.cs @@ -0,0 +1,29 @@ +// +// 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.SecurityInsights.Models +{ + + /// + /// Defines values for + /// AutomationRulePropertyChangedConditionSupportedChangedType. + /// + public static class AutomationRulePropertyChangedConditionSupportedChangedType + { + /// + /// Evaluate the condition on the previous value of the property + /// + public const string ChangedFrom = "ChangedFrom"; + /// + /// Evaluate the condition on the updated value of the property + /// + public const string ChangedTo = "ChangedTo"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyChangedConditionSupportedPropertyType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyChangedConditionSupportedPropertyType.cs new file mode 100644 index 000000000000..c4471dc0f620 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyChangedConditionSupportedPropertyType.cs @@ -0,0 +1,33 @@ +// +// 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.SecurityInsights.Models +{ + + /// + /// Defines values for + /// AutomationRulePropertyChangedConditionSupportedPropertyType. + /// + public static class AutomationRulePropertyChangedConditionSupportedPropertyType + { + /// + /// Evaluate the condition on the incident severity + /// + public const string IncidentSeverity = "IncidentSeverity"; + /// + /// Evaluate the condition on the incident status + /// + public const string IncidentStatus = "IncidentStatus"; + /// + /// Evaluate the condition on the incident owner + /// + public const string IncidentOwner = "IncidentOwner"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyConditionSupportedProperty.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyConditionSupportedProperty.cs index 64c9fbc6512e..2fe9bd569c55 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyConditionSupportedProperty.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyConditionSupportedProperty.cs @@ -49,6 +49,18 @@ public static class AutomationRulePropertyConditionSupportedProperty /// public const string IncidentProviderName = "IncidentProviderName"; /// + /// The update source of the incident + /// + public const string IncidentUpdatedBySource = "IncidentUpdatedBySource"; + /// + /// The incident custom detail key + /// + public const string IncidentCustomDetailsKey = "IncidentCustomDetailsKey"; + /// + /// The incident custom detail value + /// + public const string IncidentCustomDetailsValue = "IncidentCustomDetailsValue"; + /// /// The account Azure Active Directory tenant id /// public const string AccountAadTenantId = "AccountAadTenantId"; @@ -85,6 +97,10 @@ public static class AutomationRulePropertyConditionSupportedProperty /// public const string AlertProductNames = "AlertProductNames"; /// + /// The analytic rule ids of the alert + /// + public const string AlertAnalyticRuleIds = "AlertAnalyticRuleIds"; + /// /// The Azure resource id /// public const string AzureResourceResourceId = "AzureResourceResourceId"; diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyValuesChangedCondition.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyValuesChangedCondition.cs new file mode 100644 index 000000000000..72ce6fa4e962 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyValuesChangedCondition.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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class AutomationRulePropertyValuesChangedCondition + { + /// + /// Initializes a new instance of the + /// AutomationRulePropertyValuesChangedCondition class. + /// + public AutomationRulePropertyValuesChangedCondition() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AutomationRulePropertyValuesChangedCondition class. + /// + /// Possible values include: + /// 'IncidentSeverity', 'IncidentStatus', 'IncidentOwner' + /// Possible values include: 'ChangedFrom', + /// 'ChangedTo' + /// Possible values include: 'Equals', + /// 'NotEquals', 'Contains', 'NotContains', 'StartsWith', + /// 'NotStartsWith', 'EndsWith', 'NotEndsWith' + public AutomationRulePropertyValuesChangedCondition(string propertyName = default(string), string changeType = default(string), string operatorProperty = default(string), IList propertyValues = default(IList)) + { + PropertyName = propertyName; + ChangeType = changeType; + OperatorProperty = operatorProperty; + PropertyValues = propertyValues; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'IncidentSeverity', + /// 'IncidentStatus', 'IncidentOwner' + /// + [JsonProperty(PropertyName = "propertyName")] + public string PropertyName { get; set; } + + /// + /// Gets or sets possible values include: 'ChangedFrom', 'ChangedTo' + /// + [JsonProperty(PropertyName = "changeType")] + public string ChangeType { get; set; } + + /// + /// Gets or sets possible values include: 'Equals', 'NotEquals', + /// 'Contains', 'NotContains', 'StartsWith', 'NotStartsWith', + /// 'EndsWith', 'NotEndsWith' + /// + [JsonProperty(PropertyName = "operator")] + public string OperatorProperty { get; set; } + + /// + /// + [JsonProperty(PropertyName = "propertyValues")] + public IList PropertyValues { get; set; } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyValuesCondition.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyValuesCondition.cs index 4c9cb6e89b2f..a1f7008188e9 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyValuesCondition.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyValuesCondition.cs @@ -34,9 +34,11 @@ public AutomationRulePropertyValuesCondition() /// 'IncidentTitle', 'IncidentDescription', 'IncidentSeverity', /// 'IncidentStatus', 'IncidentRelatedAnalyticRuleIds', /// 'IncidentTactics', 'IncidentLabel', 'IncidentProviderName', - /// 'AccountAadTenantId', 'AccountAadUserId', 'AccountName', - /// 'AccountNTDomain', 'AccountPUID', 'AccountSid', - /// 'AccountObjectGuid', 'AccountUPNSuffix', 'AlertProductNames', + /// 'IncidentUpdatedBySource', 'IncidentCustomDetailsKey', + /// 'IncidentCustomDetailsValue', 'AccountAadTenantId', + /// 'AccountAadUserId', 'AccountName', 'AccountNTDomain', + /// 'AccountPUID', 'AccountSid', 'AccountObjectGuid', + /// 'AccountUPNSuffix', 'AlertProductNames', 'AlertAnalyticRuleIds', /// 'AzureResourceResourceId', 'AzureResourceSubscriptionId', /// 'CloudApplicationAppId', 'CloudApplicationAppName', /// 'DNSDomainName', 'FileDirectory', 'FileName', 'FileHashValue', @@ -70,10 +72,12 @@ public AutomationRulePropertyValuesCondition() /// Gets or sets possible values include: 'IncidentTitle', /// 'IncidentDescription', 'IncidentSeverity', 'IncidentStatus', /// 'IncidentRelatedAnalyticRuleIds', 'IncidentTactics', - /// 'IncidentLabel', 'IncidentProviderName', 'AccountAadTenantId', - /// 'AccountAadUserId', 'AccountName', 'AccountNTDomain', - /// 'AccountPUID', 'AccountSid', 'AccountObjectGuid', - /// 'AccountUPNSuffix', 'AlertProductNames', 'AzureResourceResourceId', + /// 'IncidentLabel', 'IncidentProviderName', 'IncidentUpdatedBySource', + /// 'IncidentCustomDetailsKey', 'IncidentCustomDetailsValue', + /// 'AccountAadTenantId', 'AccountAadUserId', 'AccountName', + /// 'AccountNTDomain', 'AccountPUID', 'AccountSid', + /// 'AccountObjectGuid', 'AccountUPNSuffix', 'AlertProductNames', + /// 'AlertAnalyticRuleIds', 'AzureResourceResourceId', /// 'AzureResourceSubscriptionId', 'CloudApplicationAppId', /// 'CloudApplicationAppName', 'DNSDomainName', 'FileDirectory', /// 'FileName', 'FileHashValue', 'HostAzureID', 'HostName', diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleTriggeringLogic.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleTriggeringLogic.cs index de85e5c02bd4..2fc9c4072f2f 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleTriggeringLogic.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleTriggeringLogic.cs @@ -17,7 +17,7 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models using System.Linq; /// - /// Describes automation rule triggering logic + /// Describes automation rule triggering logic. /// public partial class AutomationRuleTriggeringLogic { @@ -35,26 +35,24 @@ public AutomationRuleTriggeringLogic() /// class. /// /// Determines whether the automation rule is - /// enabled or disabled + /// enabled or disabled. + /// Possible values include: 'Incidents', + /// 'Alerts' + /// Possible values include: 'Created', + /// 'Updated' /// Determines when the automation rule /// should automatically expire and be disabled. /// The conditions to evaluate to determine if - /// the automation rule should be triggered on a given object - public AutomationRuleTriggeringLogic(bool isEnabled, System.DateTime? expirationTimeUtc = default(System.DateTime?), IList conditions = default(IList)) + /// the automation rule should be triggered on a given object. + public AutomationRuleTriggeringLogic(bool isEnabled, string triggersOn, string triggersWhen, System.DateTime? expirationTimeUtc = default(System.DateTime?), IList conditions = default(IList)) { IsEnabled = isEnabled; ExpirationTimeUtc = expirationTimeUtc; + TriggersOn = triggersOn; + TriggersWhen = triggersWhen; Conditions = conditions; CustomInit(); } - /// - /// Static constructor for AutomationRuleTriggeringLogic class. - /// - static AutomationRuleTriggeringLogic() - { - TriggersOn = "Incidents"; - TriggersWhen = "Created"; - } /// /// An initialization method that performs custom operations like setting defaults @@ -63,7 +61,7 @@ static AutomationRuleTriggeringLogic() /// /// Gets or sets determines whether the automation rule is enabled or - /// disabled + /// disabled. /// [JsonProperty(PropertyName = "isEnabled")] public bool IsEnabled { get; set; } @@ -76,21 +74,23 @@ static AutomationRuleTriggeringLogic() public System.DateTime? ExpirationTimeUtc { get; set; } /// - /// Gets or sets the conditions to evaluate to determine if the - /// automation rule should be triggered on a given object + /// Gets or sets possible values include: 'Incidents', 'Alerts' /// - [JsonProperty(PropertyName = "conditions")] - public IList Conditions { get; set; } + [JsonProperty(PropertyName = "triggersOn")] + public string TriggersOn { get; set; } /// + /// Gets or sets possible values include: 'Created', 'Updated' /// - [JsonProperty(PropertyName = "triggersOn")] - public static string TriggersOn { get; private set; } + [JsonProperty(PropertyName = "triggersWhen")] + public string TriggersWhen { get; set; } /// + /// Gets or sets the conditions to evaluate to determine if the + /// automation rule should be triggered on a given object. /// - [JsonProperty(PropertyName = "triggersWhen")] - public static string TriggersWhen { get; private set; } + [JsonProperty(PropertyName = "conditions")] + public IList Conditions { get; set; } /// /// Validate the object. @@ -100,6 +100,14 @@ static AutomationRuleTriggeringLogic() /// public virtual void Validate() { + if (TriggersOn == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TriggersOn"); + } + if (TriggersWhen == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TriggersWhen"); + } if (Conditions != null) { if (Conditions.Count > 50) diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BooleanConditionProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BooleanConditionProperties.cs new file mode 100644 index 000000000000..3a050c1adbf8 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BooleanConditionProperties.cs @@ -0,0 +1,64 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes an automation rule condition that applies a boolean operator + /// (e.g AND, OR) to conditions + /// + [Newtonsoft.Json.JsonObject("Boolean")] + public partial class BooleanConditionProperties : AutomationRuleCondition + { + /// + /// Initializes a new instance of the BooleanConditionProperties class. + /// + public BooleanConditionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BooleanConditionProperties class. + /// + public BooleanConditionProperties(AutomationRuleBooleanCondition conditionProperties = default(AutomationRuleBooleanCondition)) + { + ConditionProperties = conditionProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "conditionProperties")] + public AutomationRuleBooleanCondition ConditionProperties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ConditionProperties != null) + { + ConditionProperties.Validate(); + } + } + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConditionType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConditionType.cs index 48cf53f0bb52..53812a9d7bce 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConditionType.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConditionType.cs @@ -20,5 +20,21 @@ public static class ConditionType /// Evaluate an object property value /// public const string Property = "Property"; + /// + /// Evaluate an object array property value + /// + public const string PropertyArray = "PropertyArray"; + /// + /// Evaluate an object property changed value + /// + public const string PropertyChanged = "PropertyChanged"; + /// + /// Evaluate an object array property changed value + /// + public const string PropertyArrayChanged = "PropertyArrayChanged"; + /// + /// Apply a boolean operator (e.g AND, OR) to conditions + /// + public const string Boolean = "Boolean"; } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorConnectBody.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorConnectBody.cs index a188ff4b082c..3dd35e3c006d 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorConnectBody.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorConnectBody.cs @@ -34,6 +34,15 @@ public DataConnectorConnectBody() /// The authentication kind used to poll the data. /// Possible values include: 'Basic', 'OAuth2', 'APIKey' /// The API key of the audit server. + /// Used in v2 logs connector. + /// Represents the data collection ingestion endpoint in log + /// analytics. + /// Used in v2 logs + /// connector. The data collection rule immutable id, the rule defines + /// the transformation and data destination. + /// Used in v2 logs connector. The stream we + /// are sending the data to, this is the name of the streamDeclarations + /// defined in the DCR. /// The client secret of the OAuth 2.0 /// application. /// The client id of the OAuth 2.0 @@ -44,10 +53,13 @@ public DataConnectorConnectBody() /// server. /// The user password in the audit log /// server. - public DataConnectorConnectBody(string kind = default(string), string apiKey = default(string), string clientSecret = default(string), string clientId = default(string), string authorizationCode = default(string), string userName = default(string), string password = default(string), IList requestConfigUserInputValues = default(IList)) + public DataConnectorConnectBody(string kind = default(string), string apiKey = default(string), string dataCollectionEndpoint = default(string), string dataCollectionRuleImmutableId = default(string), string outputStream = default(string), string clientSecret = default(string), string clientId = default(string), string authorizationCode = default(string), string userName = default(string), string password = default(string), IList requestConfigUserInputValues = default(IList)) { Kind = kind; ApiKey = apiKey; + DataCollectionEndpoint = dataCollectionEndpoint; + DataCollectionRuleImmutableId = dataCollectionRuleImmutableId; + OutputStream = outputStream; ClientSecret = clientSecret; ClientId = clientId; AuthorizationCode = authorizationCode; @@ -75,6 +87,29 @@ public DataConnectorConnectBody() [JsonProperty(PropertyName = "apiKey")] public string ApiKey { get; set; } + /// + /// Gets or sets used in v2 logs connector. Represents the data + /// collection ingestion endpoint in log analytics. + /// + [JsonProperty(PropertyName = "dataCollectionEndpoint")] + public string DataCollectionEndpoint { get; set; } + + /// + /// Gets or sets used in v2 logs connector. The data collection rule + /// immutable id, the rule defines the transformation and data + /// destination. + /// + [JsonProperty(PropertyName = "dataCollectionRuleImmutableId")] + public string DataCollectionRuleImmutableId { get; set; } + + /// + /// Gets or sets used in v2 logs connector. The stream we are sending + /// the data to, this is the name of the streamDeclarations defined in + /// the DCR. + /// + [JsonProperty(PropertyName = "outputStream")] + public string OutputStream { get; set; } + /// /// Gets or sets the client secret of the OAuth 2.0 application. /// diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DeleteStatus.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DeleteStatus.cs new file mode 100644 index 000000000000..e7904b8042ff --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DeleteStatus.cs @@ -0,0 +1,32 @@ +// +// 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.SecurityInsights.Models +{ + + /// + /// Defines values for DeleteStatus. + /// + public static class DeleteStatus + { + /// + /// The file was deleted. + /// + public const string Deleted = "Deleted"; + /// + /// The file was not deleted. + /// + public const string NotDeleted = "NotDeleted"; + /// + /// Unspecified + /// + public const string Unspecified = "Unspecified"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DeviceImportance.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DeviceImportance.cs new file mode 100644 index 000000000000..0b58873656aa --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DeviceImportance.cs @@ -0,0 +1,36 @@ +// +// 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.SecurityInsights.Models +{ + + /// + /// Defines values for DeviceImportance. + /// + public static class DeviceImportance + { + /// + /// Unknown - Default value + /// + public const string Unknown = "Unknown"; + /// + /// Low + /// + public const string Low = "Low"; + /// + /// Normal + /// + public const string Normal = "Normal"; + /// + /// High + /// + public const string High = "High"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityAnalytics.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityAnalytics.cs index 9cd4307b7aad..4b98f6bf4493 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityAnalytics.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityAnalytics.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -41,12 +43,12 @@ public EntityAnalytics() /// Azure Resource Manager metadata containing /// createdBy and modifiedBy information. /// Etag of the azure resource - /// Determines whether the setting is enable or - /// disabled. - public EntityAnalytics(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), bool? isEnabled = default(bool?)) + /// The relevant entity providers that + /// are synced + public EntityAnalytics(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), IList entityProviders = default(IList)) : base(id, name, type, systemData, etag) { - IsEnabled = isEnabled; + EntityProviders = entityProviders; CustomInit(); } @@ -56,10 +58,10 @@ public EntityAnalytics() partial void CustomInit(); /// - /// Gets determines whether the setting is enable or disabled. + /// Gets or sets the relevant entity providers that are synced /// - [JsonProperty(PropertyName = "properties.isEnabled")] - public bool? IsEnabled { get; private set; } + [JsonProperty(PropertyName = "properties.entityProviders")] + public IList EntityProviders { get; set; } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityKind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityKind.cs index 2547a43a7e72..10f739266189 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityKind.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityKind.cs @@ -100,5 +100,9 @@ public static class EntityKind /// Entity represents submission mail in the system. /// public const string SubmissionMail = "SubmissionMail"; + /// + /// Entity represents network interface in the system. + /// + public const string Nic = "Nic"; } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityProviders.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityProviders.cs new file mode 100644 index 000000000000..56b3cb933866 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityProviders.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.SecurityInsights.Models +{ + + /// + /// Defines values for EntityProviders. + /// + public static class EntityProviders + { + public const string ActiveDirectory = "ActiveDirectory"; + public const string AzureActiveDirectory = "AzureActiveDirectory"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryItemProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryItemProperties.cs index 50be53c5ad32..a798a04209c8 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryItemProperties.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryItemProperties.cs @@ -37,7 +37,7 @@ public EntityQueryItemProperties() /// 'CloudApplication', 'DNS', 'FileHash', 'IP', 'Malware', 'Process', /// 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'URL', /// 'IoTDevice', 'SecurityAlert', 'HuntingBookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' + /// 'MailMessage', 'Mailbox', 'SubmissionMail', 'Nic' /// Data types for /// template /// The query applied only to entities @@ -68,7 +68,7 @@ public EntityQueryItemProperties() /// 'DNS', 'FileHash', 'IP', 'Malware', 'Process', 'RegistryKey', /// 'RegistryValue', 'SecurityGroup', 'URL', 'IoTDevice', /// 'SecurityAlert', 'HuntingBookmark', 'MailCluster', 'MailMessage', - /// 'Mailbox', 'SubmissionMail' + /// 'Mailbox', 'SubmissionMail', 'Nic' /// [JsonProperty(PropertyName = "inputEntityType")] public string InputEntityType { get; set; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityTimelineKind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityTimelineKind.cs index 7187fa5452ad..03e23ef1a90c 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityTimelineKind.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityTimelineKind.cs @@ -28,5 +28,9 @@ public static class EntityTimelineKind /// security alerts /// public const string SecurityAlert = "SecurityAlert"; + /// + /// anomaly + /// + public const string Anomaly = "Anomaly"; } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityType.cs index 0a6dc63eb8a1..c4237b5aa576 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityType.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityType.cs @@ -100,5 +100,9 @@ public static class EntityType /// Entity represents submission mail in the system. /// public const string SubmissionMail = "SubmissionMail"; + /// + /// Entity represents network interface in the system. + /// + public const string Nic = "Nic"; } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorAdditionalInfo.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorAdditionalInfo.cs new file mode 100644 index 000000000000..9b6b4d01971a --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorAdditionalInfo.cs @@ -0,0 +1,59 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource management error additional info. + /// + public partial class ErrorAdditionalInfo + { + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + public ErrorAdditionalInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorAdditionalInfo class. + /// + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) + { + Type = type; + Info = info; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the additional info type. + /// + [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/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorDetail.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 000000000000..f100dc672081 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,85 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorResponse.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorResponse.cs new file mode 100644 index 000000000000..7d2ad4e46377 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorResponse.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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error response + /// + /// + /// Common error response for all Azure Resource Manager APIs to return + /// error details for failed operations. (This also follows the OData error + /// response format.). + /// + public partial class ErrorResponse + { + /// + /// Initializes a new instance of the ErrorResponse class. + /// + public ErrorResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponse class. + /// + /// The error object. + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the error object. + /// + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorResponseException.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorResponseException.cs new file mode 100644 index 000000000000..93959aa48c53 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorResponseException.cs @@ -0,0 +1,62 @@ +// +// 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.SecurityInsights.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorResponse + /// information. + /// + public partial class ErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ExpansionEntityQuery.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ExpansionEntityQuery.cs index 19b310286fbd..115db4112f2d 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ExpansionEntityQuery.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ExpansionEntityQuery.cs @@ -53,7 +53,7 @@ public ExpansionEntityQuery() /// 'Malware', 'Process', 'RegistryKey', 'RegistryValue', /// 'SecurityGroup', 'URL', 'IoTDevice', 'SecurityAlert', /// 'HuntingBookmark', 'MailCluster', 'MailMessage', 'Mailbox', - /// 'SubmissionMail' + /// 'SubmissionMail', 'Nic' /// List of the fields of the source entity /// that are required to run the query /// List of the desired output types to @@ -96,7 +96,7 @@ public ExpansionEntityQuery() /// 'CloudApplication', 'DNS', 'FileHash', 'IP', 'Malware', 'Process', /// 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'URL', /// 'IoTDevice', 'SecurityAlert', 'HuntingBookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' + /// 'MailMessage', 'Mailbox', 'SubmissionMail', 'Nic' /// [JsonProperty(PropertyName = "properties.inputEntityType")] public string InputEntityType { get; set; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ExpansionResultAggregation.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ExpansionResultAggregation.cs index dbc96904e981..5ad8b6a68ab9 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ExpansionResultAggregation.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ExpansionResultAggregation.cs @@ -37,7 +37,8 @@ public ExpansionResultAggregation() /// 'AzureResource', 'CloudApplication', 'DnsResolution', 'FileHash', /// 'Ip', 'Malware', 'Process', 'RegistryKey', 'RegistryValue', /// 'SecurityGroup', 'Url', 'IoTDevice', 'SecurityAlert', 'Bookmark', - /// 'MailCluster', 'MailMessage', 'Mailbox', 'SubmissionMail' + /// 'MailCluster', 'MailMessage', 'Mailbox', 'SubmissionMail', + /// 'Nic' /// The common type of the aggregation. /// (for e.g. entity field name) /// The display name of the aggregation by @@ -82,7 +83,7 @@ public ExpansionResultAggregation() /// 'CloudApplication', 'DnsResolution', 'FileHash', 'Ip', 'Malware', /// 'Process', 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'Url', /// 'IoTDevice', 'SecurityAlert', 'Bookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' + /// 'MailMessage', 'Mailbox', 'SubmissionMail', 'Nic' /// [JsonProperty(PropertyName = "entityKind")] public string EntityKind { get; set; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileFormat.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileFormat.cs new file mode 100644 index 000000000000..0d6def06468e --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileFormat.cs @@ -0,0 +1,32 @@ +// +// 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.SecurityInsights.Models +{ + + /// + /// Defines values for FileFormat. + /// + public static class FileFormat + { + /// + /// A CSV file. + /// + public const string CSV = "CSV"; + /// + /// A JSON file. + /// + public const string JSON = "JSON"; + /// + /// A file of other format. + /// + public const string Unspecified = "Unspecified"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileImport.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileImport.cs new file mode 100644 index 000000000000..8b29fb3c0b7d --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileImport.cs @@ -0,0 +1,209 @@ +// +// 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.SecurityInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents a file import in Azure Security Insights. + /// + [Rest.Serialization.JsonTransformation] + public partial class FileImport : Resource + { + /// + /// Initializes a new instance of the FileImport class. + /// + public FileImport() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FileImport class. + /// + /// Describes how to ingest the records in + /// the file. Possible values include: 'IngestOnlyIfAllAreValid', + /// 'IngestAnyValidRecords', 'Unspecified' + /// The content type of this file. Possible + /// values include: 'BasicIndicator', 'StixIndicator', + /// 'Unspecified' + /// Represents the imported file. + /// The source for the data in the file. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// The time the file was + /// imported. + /// Represents the error file (if the import + /// was ingested with errors or failed the validation). + /// An ordered list of some of the errors + /// that were encountered during validation. + /// The number of records that have + /// been successfully ingested. + /// The state of the file import. Possible values + /// include: 'FatalError', 'Ingested', 'IngestedWithErrors', + /// 'InProgress', 'Invalid', 'WaitingForUpload', 'Unspecified' + /// The number of records in the + /// file. + /// The number of records that have + /// passed validation. + /// The time the files associated + /// with this import are deleted from the storage account. + /// The time the file import + /// record is soft deleted from the database and history. + public FileImport(string ingestionMode, string contentType, FileMetadata importFile, string source, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.DateTime? createdTimeUTC = default(System.DateTime?), FileMetadata errorFile = default(FileMetadata), IList errorsPreview = default(IList), int? ingestedRecordCount = default(int?), string state = default(string), int? totalRecordCount = default(int?), int? validRecordCount = default(int?), System.DateTime? filesValidUntilTimeUTC = default(System.DateTime?), System.DateTime? importValidUntilTimeUTC = default(System.DateTime?)) + : base(id, name, type, systemData) + { + IngestionMode = ingestionMode; + ContentType = contentType; + CreatedTimeUTC = createdTimeUTC; + ErrorFile = errorFile; + ErrorsPreview = errorsPreview; + ImportFile = importFile; + IngestedRecordCount = ingestedRecordCount; + Source = source; + State = state; + TotalRecordCount = totalRecordCount; + ValidRecordCount = validRecordCount; + FilesValidUntilTimeUTC = filesValidUntilTimeUTC; + ImportValidUntilTimeUTC = importValidUntilTimeUTC; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets describes how to ingest the records in the file. + /// Possible values include: 'IngestOnlyIfAllAreValid', + /// 'IngestAnyValidRecords', 'Unspecified' + /// + [JsonProperty(PropertyName = "properties.ingestionMode")] + public string IngestionMode { get; set; } + + /// + /// Gets or sets the content type of this file. Possible values + /// include: 'BasicIndicator', 'StixIndicator', 'Unspecified' + /// + [JsonProperty(PropertyName = "properties.contentType")] + public string ContentType { get; set; } + + /// + /// Gets the time the file was imported. + /// + [JsonProperty(PropertyName = "properties.createdTimeUTC")] + public System.DateTime? CreatedTimeUTC { get; private set; } + + /// + /// Gets represents the error file (if the import was ingested with + /// errors or failed the validation). + /// + [JsonProperty(PropertyName = "properties.errorFile")] + public FileMetadata ErrorFile { get; private set; } + + /// + /// Gets an ordered list of some of the errors that were encountered + /// during validation. + /// + [JsonProperty(PropertyName = "properties.errorsPreview")] + public IList ErrorsPreview { get; private set; } + + /// + /// Gets or sets represents the imported file. + /// + [JsonProperty(PropertyName = "properties.importFile")] + public FileMetadata ImportFile { get; set; } + + /// + /// Gets the number of records that have been successfully ingested. + /// + [JsonProperty(PropertyName = "properties.ingestedRecordCount")] + public int? IngestedRecordCount { get; private set; } + + /// + /// Gets or sets the source for the data in the file. + /// + [JsonProperty(PropertyName = "properties.source")] + public string Source { get; set; } + + /// + /// Gets the state of the file import. Possible values include: + /// 'FatalError', 'Ingested', 'IngestedWithErrors', 'InProgress', + /// 'Invalid', 'WaitingForUpload', 'Unspecified' + /// + [JsonProperty(PropertyName = "properties.state")] + public string State { get; private set; } + + /// + /// Gets the number of records in the file. + /// + [JsonProperty(PropertyName = "properties.totalRecordCount")] + public int? TotalRecordCount { get; private set; } + + /// + /// Gets the number of records that have passed validation. + /// + [JsonProperty(PropertyName = "properties.validRecordCount")] + public int? ValidRecordCount { get; private set; } + + /// + /// Gets the time the files associated with this import are deleted + /// from the storage account. + /// + [JsonProperty(PropertyName = "properties.filesValidUntilTimeUTC")] + public System.DateTime? FilesValidUntilTimeUTC { get; private set; } + + /// + /// Gets the time the file import record is soft deleted from the + /// database and history. + /// + [JsonProperty(PropertyName = "properties.importValidUntilTimeUTC")] + public System.DateTime? ImportValidUntilTimeUTC { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (IngestionMode == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IngestionMode"); + } + if (ContentType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContentType"); + } + if (ImportFile == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ImportFile"); + } + if (Source == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Source"); + } + } + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileImportContentType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileImportContentType.cs new file mode 100644 index 000000000000..25614b0e1d52 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileImportContentType.cs @@ -0,0 +1,33 @@ +// +// 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.SecurityInsights.Models +{ + + /// + /// Defines values for FileImportContentType. + /// + public static class FileImportContentType + { + /// + /// File containing records with the core fields of an indicator, plus + /// the observables to construct the STIX pattern. + /// + public const string BasicIndicator = "BasicIndicator"; + /// + /// File containing STIX indicators. + /// + public const string StixIndicator = "StixIndicator"; + /// + /// File containing other records. + /// + public const string Unspecified = "Unspecified"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileImportState.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileImportState.cs new file mode 100644 index 000000000000..2427dac522d2 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileImportState.cs @@ -0,0 +1,48 @@ +// +// 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.SecurityInsights.Models +{ + + /// + /// Defines values for FileImportState. + /// + public static class FileImportState + { + /// + /// A fatal error has occurred while ingesting the file. + /// + public const string FatalError = "FatalError"; + /// + /// The file has been ingested. + /// + public const string Ingested = "Ingested"; + /// + /// The file has been ingested with errors. + /// + public const string IngestedWithErrors = "IngestedWithErrors"; + /// + /// The file ingestion is in progress. + /// + public const string InProgress = "InProgress"; + /// + /// The file is invalid. + /// + public const string Invalid = "Invalid"; + /// + /// Waiting for the file to be uploaded. + /// + public const string WaitingForUpload = "WaitingForUpload"; + /// + /// Unspecified state. + /// + public const string Unspecified = "Unspecified"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileMetadata.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileMetadata.cs new file mode 100644 index 000000000000..62647329dc17 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileMetadata.cs @@ -0,0 +1,91 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents a file. + /// + public partial class FileMetadata + { + /// + /// Initializes a new instance of the FileMetadata class. + /// + public FileMetadata() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FileMetadata class. + /// + /// The format of the file. Possible values + /// include: 'CSV', 'JSON', 'Unspecified' + /// The name of the file. + /// The size of the file. + /// A URI with a valid SAS token to allow + /// uploading / downloading the file. + /// Indicates whether the file was deleted + /// from the storage account. Possible values include: 'Deleted', + /// 'NotDeleted', 'Unspecified' + public FileMetadata(string fileFormat = default(string), string fileName = default(string), int? fileSize = default(int?), string fileContentUri = default(string), string deleteStatus = default(string)) + { + FileFormat = fileFormat; + FileName = fileName; + FileSize = fileSize; + FileContentUri = fileContentUri; + DeleteStatus = deleteStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the format of the file. Possible values include: + /// 'CSV', 'JSON', 'Unspecified' + /// + [JsonProperty(PropertyName = "fileFormat")] + public string FileFormat { get; set; } + + /// + /// Gets or sets the name of the file. + /// + [JsonProperty(PropertyName = "fileName")] + public string FileName { get; set; } + + /// + /// Gets or sets the size of the file. + /// + [JsonProperty(PropertyName = "fileSize")] + public int? FileSize { get; set; } + + /// + /// Gets a URI with a valid SAS token to allow uploading / downloading + /// the file. + /// + [JsonProperty(PropertyName = "fileContentUri")] + public string FileContentUri { get; private set; } + + /// + /// Gets indicates whether the file was deleted from the storage + /// account. Possible values include: 'Deleted', 'NotDeleted', + /// 'Unspecified' + /// + [JsonProperty(PropertyName = "deleteStatus")] + public string DeleteStatus { get; private set; } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetInsightsError.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetInsightsErrorKind.cs similarity index 83% rename from sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetInsightsError.cs rename to sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetInsightsErrorKind.cs index bd8427d852ea..77fdcb56ecf0 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetInsightsError.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetInsightsErrorKind.cs @@ -17,31 +17,31 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models /// /// GetInsights Query Errors. /// - public partial class GetInsightsError + public partial class GetInsightsErrorKind { /// - /// Initializes a new instance of the GetInsightsError class. + /// Initializes a new instance of the GetInsightsErrorKind class. /// - public GetInsightsError() + public GetInsightsErrorKind() { CustomInit(); } /// - /// Initializes a new instance of the GetInsightsError class. + /// Initializes a new instance of the GetInsightsErrorKind class. /// /// the error message /// the query id - public GetInsightsError(string errorMessage, string queryId = default(string)) + public GetInsightsErrorKind(string errorMessage, string queryId = default(string)) { QueryId = queryId; ErrorMessage = errorMessage; CustomInit(); } /// - /// Static constructor for GetInsightsError class. + /// Static constructor for GetInsightsErrorKind class. /// - static GetInsightsError() + static GetInsightsErrorKind() { Kind = "Insight"; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetInsightsResultsMetadata.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetInsightsResultsMetadata.cs index c8fae0960be3..783e328bd736 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetInsightsResultsMetadata.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetInsightsResultsMetadata.cs @@ -34,7 +34,7 @@ public GetInsightsResultsMetadata() /// the total items found for the insights /// request /// information about the failed queries - public GetInsightsResultsMetadata(int totalCount, IList errors = default(IList)) + public GetInsightsResultsMetadata(int totalCount, IList errors = default(IList)) { TotalCount = totalCount; Errors = errors; @@ -56,7 +56,7 @@ public GetInsightsResultsMetadata() /// Gets or sets information about the failed queries /// [JsonProperty(PropertyName = "errors")] - public IList Errors { get; set; } + public IList Errors { get; set; } /// /// Validate the object. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Identity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Identity.cs new file mode 100644 index 000000000000..f54a5a4d3eed --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Identity.cs @@ -0,0 +1,70 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Identity for the resource. + /// + public partial class Identity + { + /// + /// Initializes a new instance of the Identity class. + /// + public Identity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Identity class. + /// + /// The principal ID of resource + /// identity. + /// The tenant ID of resource. + /// The identity type. Possible values include: + /// 'SystemAssigned' + public Identity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?)) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal ID of resource identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the tenant ID of resource. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets or sets the identity type. Possible values include: + /// 'SystemAssigned' + /// + [JsonProperty(PropertyName = "type")] + public ResourceIdentityType? Type { get; set; } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentEntitiesResultsMetadata.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentEntitiesResultsMetadata.cs index 4731429847eb..347c44efe4d0 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentEntitiesResultsMetadata.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentEntitiesResultsMetadata.cs @@ -40,7 +40,8 @@ public IncidentEntitiesResultsMetadata() /// 'AzureResource', 'CloudApplication', 'DnsResolution', 'FileHash', /// 'Ip', 'Malware', 'Process', 'RegistryKey', 'RegistryValue', /// 'SecurityGroup', 'Url', 'IoTDevice', 'SecurityAlert', 'Bookmark', - /// 'MailCluster', 'MailMessage', 'Mailbox', 'SubmissionMail' + /// 'MailCluster', 'MailMessage', 'Mailbox', 'SubmissionMail', + /// 'Nic' public IncidentEntitiesResultsMetadata(int count, string entityKind) { Count = count; @@ -66,7 +67,7 @@ public IncidentEntitiesResultsMetadata(int count, string entityKind) /// 'CloudApplication', 'DnsResolution', 'FileHash', 'Ip', 'Malware', /// 'Process', 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'Url', /// 'IoTDevice', 'SecurityAlert', 'Bookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' + /// 'MailMessage', 'Mailbox', 'SubmissionMail', 'Nic' /// [JsonProperty(PropertyName = "entityKind")] public string EntityKind { get; set; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentOwnerInfo.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentOwnerInfo.cs index 7f0e76a11915..cf1264ef3ea6 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentOwnerInfo.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentOwnerInfo.cs @@ -81,11 +81,11 @@ public IncidentOwnerInfo() public string UserPrincipalName { get; set; } /// - /// Gets the type of the owner the incident is assigned to. Possible - /// values include: 'Unknown', 'User', 'Group' + /// Gets or sets the type of the owner the incident is assigned to. + /// Possible values include: 'Unknown', 'User', 'Group' /// [JsonProperty(PropertyName = "ownerType")] - public string OwnerType { get; private set; } + public string OwnerType { get; set; } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentPropertiesAction.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentPropertiesAction.cs index bb41a319dd0b..7df695e2eaed 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentPropertiesAction.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentPropertiesAction.cs @@ -39,8 +39,8 @@ public IncidentPropertiesAction() /// 'SuspiciousActivity', 'SuspiciousButExpected', /// 'IncorrectAlertLogic', 'InaccurateData' /// Describes the reason the - /// incident was closed - /// List of labels to add to the incident + /// incident was closed. + /// List of labels to add to the incident. public IncidentPropertiesAction(string severity = default(string), string status = default(string), string classification = default(string), string classificationReason = default(string), string classificationComment = default(string), IncidentOwnerInfo owner = default(IncidentOwnerInfo), IList labels = default(IList)) { Severity = severity; @@ -86,7 +86,7 @@ public IncidentPropertiesAction() public string ClassificationReason { get; set; } /// - /// Gets or sets describes the reason the incident was closed + /// Gets or sets describes the reason the incident was closed. /// [JsonProperty(PropertyName = "classificationComment")] public string ClassificationComment { get; set; } @@ -97,7 +97,7 @@ public IncidentPropertiesAction() public IncidentOwnerInfo Owner { get; set; } /// - /// Gets or sets list of labels to add to the incident + /// Gets or sets list of labels to add to the incident. /// [JsonProperty(PropertyName = "labels")] public IList Labels { get; set; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IngestionMode.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IngestionMode.cs new file mode 100644 index 000000000000..99f446a96a17 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IngestionMode.cs @@ -0,0 +1,33 @@ +// +// 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.SecurityInsights.Models +{ + + /// + /// Defines values for IngestionMode. + /// + public static class IngestionMode + { + /// + /// No records should be ingested when invalid records are detected. + /// + public const string IngestOnlyIfAllAreValid = "IngestOnlyIfAllAreValid"; + /// + /// Valid records should still be ingested when invalid records are + /// detected. + /// + public const string IngestAnyValidRecords = "IngestAnyValidRecords"; + /// + /// Unspecified + /// + public const string Unspecified = "Unspecified"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemProperties.cs index ac1af8ad8233..ac3c42901d4b 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemProperties.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemProperties.cs @@ -37,7 +37,7 @@ public InsightQueryItemProperties() /// 'CloudApplication', 'DNS', 'FileHash', 'IP', 'Malware', 'Process', /// 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'URL', /// 'IoTDevice', 'SecurityAlert', 'HuntingBookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' + /// 'MailMessage', 'Mailbox', 'SubmissionMail', 'Nic' /// Data types for /// template /// The query applied only to entities diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IoTDeviceEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IoTDeviceEntity.cs index bf806cb66aa6..5a7bbc682ebf 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IoTDeviceEntity.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IoTDeviceEntity.cs @@ -74,7 +74,27 @@ public IoTDeviceEntity() /// the IoTDevice entity. /// A list of protocols of the IoTDevice /// entity. - public IoTDeviceEntity(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary additionalData = default(IDictionary), string friendlyName = default(string), string deviceId = default(string), string deviceName = default(string), string source = default(string), System.Guid? iotSecurityAgentId = default(System.Guid?), string deviceType = default(string), string vendor = default(string), string edgeId = default(string), string macAddress = default(string), string model = default(string), string serialNumber = default(string), string firmwareVersion = default(string), string operatingSystem = default(string), string iotHubEntityId = default(string), string hostEntityId = default(string), string ipAddressEntityId = default(string), IList threatIntelligence = default(IList), IList protocols = default(IList)) + /// A list of owners of the IoTDevice + /// entity. + /// A list of Nic entity ids of the + /// IoTDevice entity. + /// The site of the device + /// The zone location of the device within a + /// site + /// The sensor the device is monitored by + /// The subType of the device ('PLC', + /// 'HMI', 'EWS', etc.) + /// Device importance, determines if the + /// device classified as 'crown jewel'. Possible values include: + /// 'Unknown', 'Low', 'Normal', 'High' + /// The Purdue Layer of the device + /// Determines whether the device classified + /// as authorized device + /// Determines whether the device + /// classified as programming device + /// Is the device classified as a scanner + /// device + public IoTDeviceEntity(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary additionalData = default(IDictionary), string friendlyName = default(string), string deviceId = default(string), string deviceName = default(string), string source = default(string), System.Guid? iotSecurityAgentId = default(System.Guid?), string deviceType = default(string), string vendor = default(string), string edgeId = default(string), string macAddress = default(string), string model = default(string), string serialNumber = default(string), string firmwareVersion = default(string), string operatingSystem = default(string), string iotHubEntityId = default(string), string hostEntityId = default(string), string ipAddressEntityId = default(string), IList threatIntelligence = default(IList), IList protocols = default(IList), IList owners = default(IList), IList nicEntityIds = default(IList), string site = default(string), string zone = default(string), string sensor = default(string), string deviceSubType = default(string), string importance = default(string), string purdueLayer = default(string), bool? isAuthorized = default(bool?), bool? isProgramming = default(bool?), bool? isScanner = default(bool?)) : base(id, name, type, systemData) { AdditionalData = additionalData; @@ -96,6 +116,17 @@ public IoTDeviceEntity() IpAddressEntityId = ipAddressEntityId; ThreatIntelligence = threatIntelligence; Protocols = protocols; + Owners = owners; + NicEntityIds = nicEntityIds; + Site = site; + Zone = zone; + Sensor = sensor; + DeviceSubType = deviceSubType; + Importance = importance; + PurdueLayer = purdueLayer; + IsAuthorized = isAuthorized; + IsProgramming = isProgramming; + IsScanner = isScanner; CustomInit(); } @@ -221,5 +252,73 @@ public IoTDeviceEntity() [JsonProperty(PropertyName = "properties.protocols")] public IList Protocols { get; private set; } + /// + /// Gets a list of owners of the IoTDevice entity. + /// + [JsonProperty(PropertyName = "properties.owners")] + public IList Owners { get; private set; } + + /// + /// Gets a list of Nic entity ids of the IoTDevice entity. + /// + [JsonProperty(PropertyName = "properties.nicEntityIds")] + public IList NicEntityIds { get; private set; } + + /// + /// Gets the site of the device + /// + [JsonProperty(PropertyName = "properties.site")] + public string Site { get; private set; } + + /// + /// Gets the zone location of the device within a site + /// + [JsonProperty(PropertyName = "properties.zone")] + public string Zone { get; private set; } + + /// + /// Gets the sensor the device is monitored by + /// + [JsonProperty(PropertyName = "properties.sensor")] + public string Sensor { get; private set; } + + /// + /// Gets the subType of the device ('PLC', 'HMI', 'EWS', etc.) + /// + [JsonProperty(PropertyName = "properties.deviceSubType")] + public string DeviceSubType { get; private set; } + + /// + /// Gets or sets device importance, determines if the device classified + /// as 'crown jewel'. Possible values include: 'Unknown', 'Low', + /// 'Normal', 'High' + /// + [JsonProperty(PropertyName = "properties.importance")] + public string Importance { get; set; } + + /// + /// Gets the Purdue Layer of the device + /// + [JsonProperty(PropertyName = "properties.purdueLayer")] + public string PurdueLayer { get; private set; } + + /// + /// Gets determines whether the device classified as authorized device + /// + [JsonProperty(PropertyName = "properties.isAuthorized")] + public bool? IsAuthorized { get; private set; } + + /// + /// Gets determines whether the device classified as programming device + /// + [JsonProperty(PropertyName = "properties.isProgramming")] + public bool? IsProgramming { get; private set; } + + /// + /// Gets is the device classified as a scanner device + /// + [JsonProperty(PropertyName = "properties.isScanner")] + public bool? IsScanner { get; private set; } + } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ManualTriggerRequestBody.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ManualTriggerRequestBody.cs index c08cd2d0689a..d32c3e5eba86 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ManualTriggerRequestBody.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ManualTriggerRequestBody.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -26,7 +27,7 @@ public ManualTriggerRequestBody() /// /// Initializes a new instance of the ManualTriggerRequestBody class. /// - public ManualTriggerRequestBody(System.Guid? tenantId = default(System.Guid?), string logicAppsResourceId = default(string)) + public ManualTriggerRequestBody(string logicAppsResourceId, System.Guid? tenantId = default(System.Guid?)) { TenantId = tenantId; LogicAppsResourceId = logicAppsResourceId; @@ -48,5 +49,18 @@ public ManualTriggerRequestBody() [JsonProperty(PropertyName = "logicAppsResourceId")] public string LogicAppsResourceId { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (LogicAppsResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "LogicAppsResourceId"); + } + } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/NicEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/NicEntity.cs new file mode 100644 index 000000000000..078164e51848 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/NicEntity.cs @@ -0,0 +1,107 @@ +// +// 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.SecurityInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents an network interface entity. + /// + [Newtonsoft.Json.JsonObject("Nic")] + [Rest.Serialization.JsonTransformation] + public partial class NicEntity : Entity + { + /// + /// Initializes a new instance of the NicEntity class. + /// + public NicEntity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NicEntity class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// A bag of custom fields that should be + /// part of the entity and will be presented to the user. + /// The graph item display name which is a + /// short humanly readable description of the graph item instance. This + /// property is optional and might be system generated. + /// The MAC address of this network + /// interface + /// The IP entity id of this network + /// interface + /// A list of VLANs of the network interface + /// entity. + public NicEntity(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary additionalData = default(IDictionary), string friendlyName = default(string), string macAddress = default(string), string ipAddressEntityId = default(string), IList vlans = default(IList)) + : base(id, name, type, systemData) + { + AdditionalData = additionalData; + FriendlyName = friendlyName; + MacAddress = macAddress; + IpAddressEntityId = ipAddressEntityId; + Vlans = vlans; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets a bag of custom fields that should be part of the entity and + /// will be presented to the user. + /// + [JsonProperty(PropertyName = "properties.additionalData")] + public IDictionary AdditionalData { get; private set; } + + /// + /// Gets the graph item display name which is a short humanly readable + /// description of the graph item instance. This property is optional + /// and might be system generated. + /// + [JsonProperty(PropertyName = "properties.friendlyName")] + public string FriendlyName { get; private set; } + + /// + /// Gets the MAC address of this network interface + /// + [JsonProperty(PropertyName = "properties.macAddress")] + public string MacAddress { get; private set; } + + /// + /// Gets the IP entity id of this network interface + /// + [JsonProperty(PropertyName = "properties.ipAddressEntityId")] + public string IpAddressEntityId { get; private set; } + + /// + /// Gets a list of VLANs of the network interface entity. + /// + [JsonProperty(PropertyName = "properties.vlans")] + public IList Vlans { get; private set; } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/NrtAlertRule.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/NrtAlertRule.cs index 2023fb4b39a0..6d445cf5bb48 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/NrtAlertRule.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/NrtAlertRule.cs @@ -77,7 +77,11 @@ public NrtAlertRule() /// alert rule /// The alert details override /// settings - public NrtAlertRule(string query, string displayName, bool enabled, System.TimeSpan suppressionDuration, bool suppressionEnabled, string severity, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string alertRuleTemplateName = default(string), string templateVersion = default(string), string description = default(string), IList tactics = default(IList), IList techniques = default(IList), System.DateTime? lastModifiedUtc = default(System.DateTime?), IncidentConfiguration incidentConfiguration = default(IncidentConfiguration), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride)) + /// The event grouping + /// settings. + /// Array of the sentinel entity + /// mappings of the alert rule + public NrtAlertRule(string query, string displayName, bool enabled, System.TimeSpan suppressionDuration, bool suppressionEnabled, string severity, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string alertRuleTemplateName = default(string), string templateVersion = default(string), string description = default(string), IList tactics = default(IList), IList techniques = default(IList), System.DateTime? lastModifiedUtc = default(System.DateTime?), IncidentConfiguration incidentConfiguration = default(IncidentConfiguration), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride), EventGroupingSettings eventGroupingSettings = default(EventGroupingSettings), IList sentinelEntitiesMappings = default(IList)) : base(id, name, type, systemData, etag) { AlertRuleTemplateName = alertRuleTemplateName; @@ -96,6 +100,8 @@ public NrtAlertRule() CustomDetails = customDetails; EntityMappings = entityMappings; AlertDetailsOverride = alertDetailsOverride; + EventGroupingSettings = eventGroupingSettings; + SentinelEntitiesMappings = sentinelEntitiesMappings; CustomInit(); } @@ -210,6 +216,19 @@ public NrtAlertRule() [JsonProperty(PropertyName = "properties.alertDetailsOverride")] public AlertDetailsOverride AlertDetailsOverride { get; set; } + /// + /// Gets or sets the event grouping settings. + /// + [JsonProperty(PropertyName = "properties.eventGroupingSettings")] + public EventGroupingSettings EventGroupingSettings { get; set; } + + /// + /// Gets or sets array of the sentinel entity mappings of the alert + /// rule + /// + [JsonProperty(PropertyName = "properties.sentinelEntitiesMappings")] + public IList SentinelEntitiesMappings { get; set; } + /// /// Validate the object. /// diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/NrtAlertRuleTemplate.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/NrtAlertRuleTemplate.cs index f3a0902bd82f..262884dddb84 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/NrtAlertRuleTemplate.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/NrtAlertRuleTemplate.cs @@ -59,7 +59,11 @@ public NrtAlertRuleTemplate() /// alert rule /// The alert details override /// settings - public NrtAlertRuleTemplate(string query, string severity, string version, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IList tactics = default(IList), IList techniques = default(IList), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride)) + /// The event grouping + /// settings. + /// Array of the sentinel entity + /// mappings of the alert rule + public NrtAlertRuleTemplate(string query, string severity, string version, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IList tactics = default(IList), IList techniques = default(IList), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride), EventGroupingSettings eventGroupingSettings = default(EventGroupingSettings), IList sentinelEntitiesMappings = default(IList)) : base(id, name, type, systemData) { Tactics = tactics; @@ -70,6 +74,8 @@ public NrtAlertRuleTemplate() CustomDetails = customDetails; EntityMappings = entityMappings; AlertDetailsOverride = alertDetailsOverride; + EventGroupingSettings = eventGroupingSettings; + SentinelEntitiesMappings = sentinelEntitiesMappings; CustomInit(); } @@ -130,6 +136,19 @@ public NrtAlertRuleTemplate() [JsonProperty(PropertyName = "properties.alertDetailsOverride")] public AlertDetailsOverride AlertDetailsOverride { get; set; } + /// + /// Gets or sets the event grouping settings. + /// + [JsonProperty(PropertyName = "properties.eventGroupingSettings")] + public EventGroupingSettings EventGroupingSettings { get; set; } + + /// + /// Gets or sets array of the sentinel entity mappings of the alert + /// rule + /// + [JsonProperty(PropertyName = "properties.sentinelEntitiesMappings")] + public IList SentinelEntitiesMappings { get; set; } + /// /// Validate the object. /// diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Plan.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Plan.cs new file mode 100644 index 000000000000..4271a69ce8b3 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Plan.cs @@ -0,0 +1,116 @@ +// +// 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.SecurityInsights.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Plan for the resource. + /// + public partial class Plan + { + /// + /// Initializes a new instance of the Plan class. + /// + public Plan() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Plan class. + /// + /// A user defined name of the 3rd Party Artifact + /// that is being procured. + /// The publisher of the 3rd Party Artifact + /// that is being bought. E.g. NewRelic + /// The 3rd Party artifact that is being + /// procured. E.g. NewRelic. Product maps to the OfferID specified for + /// the artifact at the time of Data Market onboarding. + /// A publisher provided promotion code as + /// provisioned in Data Market for the said product/artifact. + /// The version of the desired + /// product/artifact. + public Plan(string name, string publisher, string product, string promotionCode = default(string), string version = default(string)) + { + Name = name; + Publisher = publisher; + Product = product; + PromotionCode = promotionCode; + Version = version; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a user defined name of the 3rd Party Artifact that is + /// being procured. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the publisher of the 3rd Party Artifact that is being + /// bought. E.g. NewRelic + /// + [JsonProperty(PropertyName = "publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets the 3rd Party artifact that is being procured. E.g. + /// NewRelic. Product maps to the OfferID specified for the artifact at + /// the time of Data Market onboarding. + /// + [JsonProperty(PropertyName = "product")] + public string Product { get; set; } + + /// + /// Gets or sets a publisher provided promotion code as provisioned in + /// Data Market for the said product/artifact. + /// + [JsonProperty(PropertyName = "promotionCode")] + public string PromotionCode { get; set; } + + /// + /// Gets or sets the version of the desired product/artifact. + /// + [JsonProperty(PropertyName = "version")] + public string Version { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Publisher == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Publisher"); + } + if (Product == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Product"); + } + } + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PlaybookActionProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PlaybookActionProperties.cs index faab89a24171..e6a9a1582254 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PlaybookActionProperties.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PlaybookActionProperties.cs @@ -27,9 +27,9 @@ public PlaybookActionProperties() /// Initializes a new instance of the PlaybookActionProperties class. /// /// The resource id of the playbook - /// resource + /// resource. /// The tenant id of the playbook - /// resource + /// resource. public PlaybookActionProperties(string logicAppResourceId = default(string), System.Guid? tenantId = default(System.Guid?)) { LogicAppResourceId = logicAppResourceId; @@ -43,13 +43,13 @@ public PlaybookActionProperties() partial void CustomInit(); /// - /// Gets or sets the resource id of the playbook resource + /// Gets or sets the resource id of the playbook resource. /// [JsonProperty(PropertyName = "logicAppResourceId")] public string LogicAppResourceId { get; set; } /// - /// Gets or sets the tenant id of the playbook resource + /// Gets or sets the tenant id of the playbook resource. /// [JsonProperty(PropertyName = "tenantId")] public System.Guid? TenantId { get; set; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PropertyArrayChangedConditionProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PropertyArrayChangedConditionProperties.cs new file mode 100644 index 000000000000..32a4a24a4e5e --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PropertyArrayChangedConditionProperties.cs @@ -0,0 +1,53 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes an automation rule condition that evaluates an array + /// property's value change + /// + [Newtonsoft.Json.JsonObject("PropertyArrayChanged")] + public partial class PropertyArrayChangedConditionProperties : AutomationRuleCondition + { + /// + /// Initializes a new instance of the + /// PropertyArrayChangedConditionProperties class. + /// + public PropertyArrayChangedConditionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// PropertyArrayChangedConditionProperties class. + /// + public PropertyArrayChangedConditionProperties(AutomationRulePropertyArrayChangedValuesCondition conditionProperties = default(AutomationRulePropertyArrayChangedValuesCondition)) + { + ConditionProperties = conditionProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "conditionProperties")] + public AutomationRulePropertyArrayChangedValuesCondition ConditionProperties { get; set; } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PropertyArrayConditionProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PropertyArrayConditionProperties.cs new file mode 100644 index 000000000000..47aa052724dc --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PropertyArrayConditionProperties.cs @@ -0,0 +1,66 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes an automation rule condition that evaluates an array + /// property's value + /// + [Newtonsoft.Json.JsonObject("PropertyArray")] + public partial class PropertyArrayConditionProperties : AutomationRuleCondition + { + /// + /// Initializes a new instance of the PropertyArrayConditionProperties + /// class. + /// + public PropertyArrayConditionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PropertyArrayConditionProperties + /// class. + /// + public PropertyArrayConditionProperties(AutomationRulePropertyArrayValuesCondition conditionProperties = default(AutomationRulePropertyArrayValuesCondition)) + { + ConditionProperties = conditionProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "conditionProperties")] + public AutomationRulePropertyArrayValuesCondition ConditionProperties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ConditionProperties != null) + { + ConditionProperties.Validate(); + } + } + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PropertyChangedConditionProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PropertyChangedConditionProperties.cs new file mode 100644 index 000000000000..0fc93fcda561 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PropertyChangedConditionProperties.cs @@ -0,0 +1,53 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes an automation rule condition that evaluates a property's + /// value change + /// + [Newtonsoft.Json.JsonObject("PropertyChanged")] + public partial class PropertyChangedConditionProperties : AutomationRuleCondition + { + /// + /// Initializes a new instance of the + /// PropertyChangedConditionProperties class. + /// + public PropertyChangedConditionProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// PropertyChangedConditionProperties class. + /// + public PropertyChangedConditionProperties(AutomationRulePropertyValuesChangedCondition conditionProperties = default(AutomationRulePropertyValuesChangedCondition)) + { + ConditionProperties = conditionProperties; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "conditionProperties")] + public AutomationRulePropertyValuesChangedCondition ConditionProperties { get; set; } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/QueryBasedAlertRuleTemplateProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/QueryBasedAlertRuleTemplateProperties.cs index 70048f67373d..d7ab47173e26 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/QueryBasedAlertRuleTemplateProperties.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/QueryBasedAlertRuleTemplateProperties.cs @@ -47,7 +47,11 @@ public QueryBasedAlertRuleTemplateProperties() /// alert rule /// The alert details override /// settings - public QueryBasedAlertRuleTemplateProperties(string query = default(string), string severity = default(string), string version = default(string), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride)) + /// The event grouping + /// settings. + /// Array of the sentinel entity + /// mappings of the alert rule + public QueryBasedAlertRuleTemplateProperties(string query = default(string), string severity = default(string), string version = default(string), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride), EventGroupingSettings eventGroupingSettings = default(EventGroupingSettings), IList sentinelEntitiesMappings = default(IList)) { Query = query; Severity = severity; @@ -55,6 +59,8 @@ public QueryBasedAlertRuleTemplateProperties() CustomDetails = customDetails; EntityMappings = entityMappings; AlertDetailsOverride = alertDetailsOverride; + EventGroupingSettings = eventGroupingSettings; + SentinelEntitiesMappings = sentinelEntitiesMappings; CustomInit(); } @@ -103,5 +109,18 @@ public QueryBasedAlertRuleTemplateProperties() [JsonProperty(PropertyName = "alertDetailsOverride")] public AlertDetailsOverride AlertDetailsOverride { get; set; } + /// + /// Gets or sets the event grouping settings. + /// + [JsonProperty(PropertyName = "eventGroupingSettings")] + public EventGroupingSettings EventGroupingSettings { get; set; } + + /// + /// Gets or sets array of the sentinel entity mappings of the alert + /// rule + /// + [JsonProperty(PropertyName = "sentinelEntitiesMappings")] + public IList SentinelEntitiesMappings { get; set; } + } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceIdentityType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceIdentityType.cs new file mode 100644 index 000000000000..fd0fb89f27be --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceIdentityType.cs @@ -0,0 +1,54 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ResourceIdentityType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ResourceIdentityType + { + [EnumMember(Value = "SystemAssigned")] + SystemAssigned + } + internal static class ResourceIdentityTypeEnumExtension + { + internal static string ToSerializedValue(this ResourceIdentityType? value) + { + return value == null ? null : ((ResourceIdentityType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ResourceIdentityType value) + { + switch( value ) + { + case ResourceIdentityType.SystemAssigned: + return "SystemAssigned"; + } + return null; + } + + internal static ResourceIdentityType? ParseResourceIdentityType(this string value) + { + switch( value ) + { + case "SystemAssigned": + return ResourceIdentityType.SystemAssigned; + } + return null; + } + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceModelWithAllowedPropertySet.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceModelWithAllowedPropertySet.cs new file mode 100644 index 000000000000..d903a06ce496 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceModelWithAllowedPropertySet.cs @@ -0,0 +1,141 @@ +// +// 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.SecurityInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource model definition containing the full set of allowed + /// properties for a resource. Except properties bag, there cannot be a top + /// level property outside of this set. + /// + public partial class ResourceModelWithAllowedPropertySet : IResource + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySet class. + /// + public ResourceModelWithAllowedPropertySet() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySet class. + /// + /// The fully qualified resource ID of the + /// resource that manages this resource. Indicates if this resource is + /// managed by another Azure resource. If this is present, complete + /// mode deployment will not delete the resource if it is removed from + /// the template since it is managed by another resource. + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. + public ResourceModelWithAllowedPropertySet(string managedBy = default(string), string kind = default(string), string etag = default(string), ResourceModelWithAllowedPropertySetIdentity identity = default(ResourceModelWithAllowedPropertySetIdentity), ResourceModelWithAllowedPropertySetSku sku = default(ResourceModelWithAllowedPropertySetSku), ResourceModelWithAllowedPropertySetPlan plan = default(ResourceModelWithAllowedPropertySetPlan)) + { + ManagedBy = managedBy; + Kind = kind; + Etag = etag; + Identity = identity; + Sku = sku; + Plan = plan; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the fully qualified resource ID of the resource that + /// manages this resource. Indicates if this resource is managed by + /// another Azure resource. If this is present, complete mode + /// deployment will not delete the resource if it is removed from the + /// template since it is managed by another resource. + /// + [JsonProperty(PropertyName = "managedBy")] + public string ManagedBy { get; set; } + + /// + /// Gets or sets metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; set; } + + /// + /// Gets the etag field is *not* required. If it is provided in the + /// response body, it must also be provided as a header per the normal + /// etag convention. Entity tags are used for comparing two or more + /// entities from the same requested resource. HTTP/1.1 uses entity + /// tags in the etag (section 14.19), If-Match (section 14.24), + /// If-None-Match (section 14.26), and If-Range (section 14.27) header + /// fields. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "identity")] + public ResourceModelWithAllowedPropertySetIdentity Identity { get; set; } + + /// + /// + [JsonProperty(PropertyName = "sku")] + public ResourceModelWithAllowedPropertySetSku Sku { get; set; } + + /// + /// + [JsonProperty(PropertyName = "plan")] + public ResourceModelWithAllowedPropertySetPlan Plan { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Kind != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Kind, "^[-\\w\\._,\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "Kind", "^[-\\w\\._,\\(\\)]+$"); + } + } + if (Sku != null) + { + Sku.Validate(); + } + if (Plan != null) + { + Plan.Validate(); + } + } + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs new file mode 100644 index 000000000000..57610c8c9027 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs @@ -0,0 +1,47 @@ +// +// 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.SecurityInsights.Models +{ + using System.Linq; + + public partial class ResourceModelWithAllowedPropertySetIdentity : Identity + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetIdentity class. + /// + public ResourceModelWithAllowedPropertySetIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetIdentity class. + /// + /// The principal ID of resource + /// identity. + /// The tenant ID of resource. + /// The identity type. Possible values include: + /// 'SystemAssigned' + public ResourceModelWithAllowedPropertySetIdentity(string principalId = default(string), string tenantId = default(string), ResourceIdentityType? type = default(ResourceIdentityType?)) + : base(principalId, tenantId, type) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs new file mode 100644 index 000000000000..7df5924c4391 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs @@ -0,0 +1,63 @@ +// +// 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.SecurityInsights.Models +{ + using System.Linq; + + public partial class ResourceModelWithAllowedPropertySetPlan : Plan + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetPlan class. + /// + public ResourceModelWithAllowedPropertySetPlan() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetPlan class. + /// + /// A user defined name of the 3rd Party Artifact + /// that is being procured. + /// The publisher of the 3rd Party Artifact + /// that is being bought. E.g. NewRelic + /// The 3rd Party artifact that is being + /// procured. E.g. NewRelic. Product maps to the OfferID specified for + /// the artifact at the time of Data Market onboarding. + /// A publisher provided promotion code as + /// provisioned in Data Market for the said product/artifact. + /// The version of the desired + /// product/artifact. + public ResourceModelWithAllowedPropertySetPlan(string name, string publisher, string product, string promotionCode = default(string), string version = default(string)) + : base(name, publisher, product, promotionCode, version) + { + 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/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs new file mode 100644 index 000000000000..de549fca09e6 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs @@ -0,0 +1,64 @@ +// +// 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.SecurityInsights.Models +{ + using System.Linq; + + public partial class ResourceModelWithAllowedPropertySetSku : Sku + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetSku class. + /// + public ResourceModelWithAllowedPropertySetSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetSku class. + /// + /// The name of the SKU. Ex - P3. It is typically a + /// letter+number code + /// Possible values include: 'Free', 'Basic', + /// 'Standard', 'Premium' + /// The SKU size. When the name field is the + /// combination of tier and some other value, this would be the + /// standalone code. + /// If the service has different generations of + /// hardware, for the same SKU, then that can be captured here. + /// If the SKU supports scale out/in then the + /// capacity integer should be included. If scale out/in is not + /// possible for the resource this may be omitted. + public ResourceModelWithAllowedPropertySetSku(string name, SkuTier? tier = default(SkuTier?), string size = default(string), string family = default(string), int? capacity = default(int?)) + : base(name, tier, size, family, capacity) + { + 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/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ScheduledAlertRule.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ScheduledAlertRule.cs index 4518e25ed679..d113eb7db615 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ScheduledAlertRule.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ScheduledAlertRule.cs @@ -75,6 +75,8 @@ public ScheduledAlertRule() /// alert rule /// The alert details override /// settings + /// Array of the sentinel entity + /// mappings of the alert rule /// The Name of the alert rule /// template used to create this rule. /// The version of the alert rule @@ -88,7 +90,7 @@ public ScheduledAlertRule() /// The techniques of the alert rule /// The settings of the incidents /// that created from alerts triggered by this analytics rule - public ScheduledAlertRule(string displayName, bool enabled, System.TimeSpan suppressionDuration, bool suppressionEnabled, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string query = default(string), System.TimeSpan? queryFrequency = default(System.TimeSpan?), System.TimeSpan? queryPeriod = default(System.TimeSpan?), string severity = default(string), TriggerOperator? triggerOperator = default(TriggerOperator?), int? triggerThreshold = default(int?), EventGroupingSettings eventGroupingSettings = default(EventGroupingSettings), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride), string alertRuleTemplateName = default(string), string templateVersion = default(string), string description = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?), IList tactics = default(IList), IList techniques = default(IList), IncidentConfiguration incidentConfiguration = default(IncidentConfiguration)) + public ScheduledAlertRule(string displayName, bool enabled, System.TimeSpan suppressionDuration, bool suppressionEnabled, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string query = default(string), System.TimeSpan? queryFrequency = default(System.TimeSpan?), System.TimeSpan? queryPeriod = default(System.TimeSpan?), string severity = default(string), TriggerOperator? triggerOperator = default(TriggerOperator?), int? triggerThreshold = default(int?), EventGroupingSettings eventGroupingSettings = default(EventGroupingSettings), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride), IList sentinelEntitiesMappings = default(IList), string alertRuleTemplateName = default(string), string templateVersion = default(string), string description = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?), IList tactics = default(IList), IList techniques = default(IList), IncidentConfiguration incidentConfiguration = default(IncidentConfiguration)) : base(id, name, type, systemData, etag) { Query = query; @@ -101,6 +103,7 @@ public ScheduledAlertRule() CustomDetails = customDetails; EntityMappings = entityMappings; AlertDetailsOverride = alertDetailsOverride; + SentinelEntitiesMappings = sentinelEntitiesMappings; AlertRuleTemplateName = alertRuleTemplateName; TemplateVersion = templateVersion; Description = description; @@ -186,6 +189,13 @@ public ScheduledAlertRule() [JsonProperty(PropertyName = "properties.alertDetailsOverride")] public AlertDetailsOverride AlertDetailsOverride { get; set; } + /// + /// Gets or sets array of the sentinel entity mappings of the alert + /// rule + /// + [JsonProperty(PropertyName = "properties.sentinelEntitiesMappings")] + public IList SentinelEntitiesMappings { get; set; } + /// /// Gets or sets the Name of the alert rule template used to create /// this rule. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ScheduledAlertRuleCommonProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ScheduledAlertRuleCommonProperties.cs index d6a8f789913c..69637900320b 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ScheduledAlertRuleCommonProperties.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ScheduledAlertRuleCommonProperties.cs @@ -55,7 +55,9 @@ public ScheduledAlertRuleCommonProperties() /// alert rule /// The alert details override /// settings - public ScheduledAlertRuleCommonProperties(string query = default(string), System.TimeSpan? queryFrequency = default(System.TimeSpan?), System.TimeSpan? queryPeriod = default(System.TimeSpan?), string severity = default(string), TriggerOperator? triggerOperator = default(TriggerOperator?), int? triggerThreshold = default(int?), EventGroupingSettings eventGroupingSettings = default(EventGroupingSettings), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride)) + /// Array of the sentinel entity + /// mappings of the alert rule + public ScheduledAlertRuleCommonProperties(string query = default(string), System.TimeSpan? queryFrequency = default(System.TimeSpan?), System.TimeSpan? queryPeriod = default(System.TimeSpan?), string severity = default(string), TriggerOperator? triggerOperator = default(TriggerOperator?), int? triggerThreshold = default(int?), EventGroupingSettings eventGroupingSettings = default(EventGroupingSettings), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride), IList sentinelEntitiesMappings = default(IList)) { Query = query; QueryFrequency = queryFrequency; @@ -67,6 +69,7 @@ public ScheduledAlertRuleCommonProperties() CustomDetails = customDetails; EntityMappings = entityMappings; AlertDetailsOverride = alertDetailsOverride; + SentinelEntitiesMappings = sentinelEntitiesMappings; CustomInit(); } @@ -141,5 +144,12 @@ public ScheduledAlertRuleCommonProperties() [JsonProperty(PropertyName = "alertDetailsOverride")] public AlertDetailsOverride AlertDetailsOverride { get; set; } + /// + /// Gets or sets array of the sentinel entity mappings of the alert + /// rule + /// + [JsonProperty(PropertyName = "sentinelEntitiesMappings")] + public IList SentinelEntitiesMappings { get; set; } + } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ScheduledAlertRuleTemplate.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ScheduledAlertRuleTemplate.cs index e6c733f2362b..15fdf961e3c2 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ScheduledAlertRuleTemplate.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ScheduledAlertRuleTemplate.cs @@ -85,7 +85,9 @@ public ScheduledAlertRuleTemplate() /// alert rule /// The alert details override /// settings - public ScheduledAlertRuleTemplate(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), int? alertRulesCreatedByTemplateCount = default(int?), System.DateTime? createdDateUTC = default(System.DateTime?), System.DateTime? lastUpdatedDateUTC = default(System.DateTime?), string description = default(string), string displayName = default(string), IList requiredDataConnectors = default(IList), string status = default(string), string query = default(string), System.TimeSpan? queryFrequency = default(System.TimeSpan?), System.TimeSpan? queryPeriod = default(System.TimeSpan?), string severity = default(string), TriggerOperator? triggerOperator = default(TriggerOperator?), int? triggerThreshold = default(int?), IList tactics = default(IList), IList techniques = default(IList), string version = default(string), EventGroupingSettings eventGroupingSettings = default(EventGroupingSettings), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride)) + /// Array of the sentinel entity + /// mappings of the alert rule + public ScheduledAlertRuleTemplate(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), int? alertRulesCreatedByTemplateCount = default(int?), System.DateTime? createdDateUTC = default(System.DateTime?), System.DateTime? lastUpdatedDateUTC = default(System.DateTime?), string description = default(string), string displayName = default(string), IList requiredDataConnectors = default(IList), string status = default(string), string query = default(string), System.TimeSpan? queryFrequency = default(System.TimeSpan?), System.TimeSpan? queryPeriod = default(System.TimeSpan?), string severity = default(string), TriggerOperator? triggerOperator = default(TriggerOperator?), int? triggerThreshold = default(int?), IList tactics = default(IList), IList techniques = default(IList), string version = default(string), EventGroupingSettings eventGroupingSettings = default(EventGroupingSettings), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride), IList sentinelEntitiesMappings = default(IList)) : base(id, name, type, systemData) { AlertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; @@ -108,6 +110,7 @@ public ScheduledAlertRuleTemplate() CustomDetails = customDetails; EntityMappings = entityMappings; AlertDetailsOverride = alertDetailsOverride; + SentinelEntitiesMappings = sentinelEntitiesMappings; CustomInit(); } @@ -246,5 +249,12 @@ public ScheduledAlertRuleTemplate() [JsonProperty(PropertyName = "properties.alertDetailsOverride")] public AlertDetailsOverride AlertDetailsOverride { get; set; } + /// + /// Gets or sets array of the sentinel entity mappings of the alert + /// rule + /// + [JsonProperty(PropertyName = "properties.sentinelEntitiesMappings")] + public IList SentinelEntitiesMappings { get; set; } + } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityAlertTimelineItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityAlertTimelineItem.cs index 76eecbbfbd76..be6080456abb 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityAlertTimelineItem.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityAlertTimelineItem.cs @@ -12,6 +12,8 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { using Microsoft.Rest; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -41,7 +43,13 @@ public SecurityAlertTimelineItem() /// The name of the alert type. /// The alert product name. /// The alert description. - public SecurityAlertTimelineItem(string azureResourceId, string displayName, string severity, System.DateTime endTimeUtc, System.DateTime startTimeUtc, System.DateTime timeGenerated, string alertType, string productName = default(string), string description = default(string)) + /// The intent of the alert. Possible values + /// include: 'Unknown', 'Probing', 'Exploitation', 'Persistence', + /// 'PrivilegeEscalation', 'DefenseEvasion', 'CredentialAccess', + /// 'Discovery', 'LateralMovement', 'Execution', 'Collection', + /// 'Exfiltration', 'CommandAndControl', 'Impact' + /// The techniques of the alert. + public SecurityAlertTimelineItem(string azureResourceId, string displayName, string severity, System.DateTime endTimeUtc, System.DateTime startTimeUtc, System.DateTime timeGenerated, string alertType, string productName = default(string), string description = default(string), string intent = default(string), IList techniques = default(IList)) { AzureResourceId = azureResourceId; ProductName = productName; @@ -52,6 +60,8 @@ public SecurityAlertTimelineItem() StartTimeUtc = startTimeUtc; TimeGenerated = timeGenerated; AlertType = alertType; + Intent = intent; + Techniques = techniques; CustomInit(); } @@ -115,6 +125,22 @@ public SecurityAlertTimelineItem() [JsonProperty(PropertyName = "alertType")] public string AlertType { get; set; } + /// + /// Gets the intent of the alert. Possible values include: 'Unknown', + /// 'Probing', 'Exploitation', 'Persistence', 'PrivilegeEscalation', + /// 'DefenseEvasion', 'CredentialAccess', 'Discovery', + /// 'LateralMovement', 'Execution', 'Collection', 'Exfiltration', + /// 'CommandAndControl', 'Impact' + /// + [JsonProperty(PropertyName = "intent")] + public string Intent { get; private set; } + + /// + /// Gets or sets the techniques of the alert. + /// + [JsonProperty(PropertyName = "techniques")] + public IList Techniques { get; set; } + /// /// Validate the object. /// diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityMLAnalyticsSetting.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityMLAnalyticsSetting.cs new file mode 100644 index 000000000000..267912cf84a1 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityMLAnalyticsSetting.cs @@ -0,0 +1,52 @@ +// +// 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.SecurityInsights.Models +{ + using System.Linq; + + /// + /// Security ML Analytics Setting + /// + public partial class SecurityMLAnalyticsSetting : ResourceWithEtag + { + /// + /// Initializes a new instance of the SecurityMLAnalyticsSetting class. + /// + public SecurityMLAnalyticsSetting() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecurityMLAnalyticsSetting class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// Etag of the azure resource + public SecurityMLAnalyticsSetting(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string)) + : base(id, name, type, systemData, etag) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityMLAnalyticsSettingsDataSource.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityMLAnalyticsSettingsDataSource.cs new file mode 100644 index 000000000000..333031d73728 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityMLAnalyticsSettingsDataSource.cs @@ -0,0 +1,67 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// security ml analytics settings data sources + /// + public partial class SecurityMLAnalyticsSettingsDataSource + { + /// + /// Initializes a new instance of the + /// SecurityMLAnalyticsSettingsDataSource class. + /// + public SecurityMLAnalyticsSettingsDataSource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SecurityMLAnalyticsSettingsDataSource class. + /// + /// The connector id that provides the + /// following data types + /// The data types used by the security ml + /// analytics settings + public SecurityMLAnalyticsSettingsDataSource(string connectorId = default(string), IList dataTypes = default(IList)) + { + ConnectorId = connectorId; + DataTypes = dataTypes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the connector id that provides the following data + /// types + /// + [JsonProperty(PropertyName = "connectorId")] + public string ConnectorId { get; set; } + + /// + /// Gets or sets the data types used by the security ml analytics + /// settings + /// + [JsonProperty(PropertyName = "dataTypes")] + public IList DataTypes { get; set; } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SkuKind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityMLAnalyticsSettingsKind.cs similarity index 71% rename from sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SkuKind.cs rename to sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityMLAnalyticsSettingsKind.cs index bba13758ad26..f248fc74e5cf 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SkuKind.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityMLAnalyticsSettingsKind.cs @@ -12,11 +12,10 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { /// - /// Defines values for SkuKind. + /// Defines values for SecurityMLAnalyticsSettingsKind. /// - public static class SkuKind + public static class SecurityMLAnalyticsSettingsKind { - public const string PerGB = "PerGB"; - public const string CapacityReservation = "CapacityReservation"; + public const string Anomaly = "Anomaly"; } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SentinelEntityMapping.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SentinelEntityMapping.cs new file mode 100644 index 000000000000..310f1e6b14ae --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SentinelEntityMapping.cs @@ -0,0 +1,52 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// A single sentinel entity mapping + /// + public partial class SentinelEntityMapping + { + /// + /// Initializes a new instance of the SentinelEntityMapping class. + /// + public SentinelEntityMapping() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SentinelEntityMapping class. + /// + /// the column name to be mapped to the + /// SentinelEntities + public SentinelEntityMapping(string columnName = default(string)) + { + ColumnName = columnName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the column name to be mapped to the SentinelEntities + /// + [JsonProperty(PropertyName = "columnName")] + public string ColumnName { get; set; } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SettingsStatus.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SettingsStatus.cs new file mode 100644 index 000000000000..5e53628f62de --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SettingsStatus.cs @@ -0,0 +1,28 @@ +// +// 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.SecurityInsights.Models +{ + + /// + /// Defines values for SettingsStatus. + /// + public static class SettingsStatus + { + /// + /// Anomaly settings status in Production mode + /// + public const string Production = "Production"; + /// + /// Anomaly settings status in Flighting mode + /// + public const string Flighting = "Flighting"; + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Sku.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Sku.cs index 9a17eef0feac..2794b9d1868b 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Sku.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Sku.cs @@ -10,11 +10,12 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// - /// The pricing tier of the solution + /// The resource model definition representing SKU /// public partial class Sku { @@ -29,14 +30,25 @@ public Sku() /// /// Initializes a new instance of the Sku class. /// - /// The kind of the tier. Possible values include: - /// 'PerGB', 'CapacityReservation' - /// The amount of reservation - /// level - public Sku(string name = default(string), int? capacityReservationLevel = default(int?)) + /// The name of the SKU. Ex - P3. It is typically a + /// letter+number code + /// Possible values include: 'Free', 'Basic', + /// 'Standard', 'Premium' + /// The SKU size. When the name field is the + /// combination of tier and some other value, this would be the + /// standalone code. + /// If the service has different generations of + /// hardware, for the same SKU, then that can be captured here. + /// If the SKU supports scale out/in then the + /// capacity integer should be included. If scale out/in is not + /// possible for the resource this may be omitted. + public Sku(string name, SkuTier? tier = default(SkuTier?), string size = default(string), string family = default(string), int? capacity = default(int?)) { Name = name; - CapacityReservationLevel = capacityReservationLevel; + Tier = tier; + Size = size; + Family = family; + Capacity = capacity; CustomInit(); } @@ -46,17 +58,53 @@ public Sku() partial void CustomInit(); /// - /// Gets or sets the kind of the tier. Possible values include: - /// 'PerGB', 'CapacityReservation' + /// Gets or sets the name of the SKU. Ex - P3. It is typically a + /// letter+number code /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// - /// Gets or sets the amount of reservation level + /// Gets or sets possible values include: 'Free', 'Basic', 'Standard', + /// 'Premium' /// - [JsonProperty(PropertyName = "capacityReservationLevel")] - public int? CapacityReservationLevel { get; set; } + [JsonProperty(PropertyName = "tier")] + public SkuTier? Tier { get; set; } + /// + /// Gets or sets the SKU size. When the name field is the combination + /// of tier and some other value, this would be the standalone code. + /// + [JsonProperty(PropertyName = "size")] + public string Size { get; set; } + + /// + /// Gets or sets if the service has different generations of hardware, + /// for the same SKU, then that can be captured here. + /// + [JsonProperty(PropertyName = "family")] + public string Family { get; set; } + + /// + /// Gets or sets if the SKU supports scale out/in then the capacity + /// integer should be included. If scale out/in is not possible for the + /// resource this may be omitted. + /// + [JsonProperty(PropertyName = "capacity")] + public int? Capacity { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SkuTier.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SkuTier.cs new file mode 100644 index 000000000000..451302be485a --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SkuTier.cs @@ -0,0 +1,72 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for SkuTier. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum SkuTier + { + [EnumMember(Value = "Free")] + Free, + [EnumMember(Value = "Basic")] + Basic, + [EnumMember(Value = "Standard")] + Standard, + [EnumMember(Value = "Premium")] + Premium + } + internal static class SkuTierEnumExtension + { + internal static string ToSerializedValue(this SkuTier? value) + { + return value == null ? null : ((SkuTier)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SkuTier value) + { + switch( value ) + { + case SkuTier.Free: + return "Free"; + case SkuTier.Basic: + return "Basic"; + case SkuTier.Standard: + return "Standard"; + case SkuTier.Premium: + return "Premium"; + } + return null; + } + + internal static SkuTier? ParseSkuTier(this string value) + { + switch( value ) + { + case "Free": + return SkuTier.Free; + case "Basic": + return SkuTier.Basic; + case "Standard": + return SkuTier.Standard; + case "Premium": + return SkuTier.Premium; + } + return null; + } + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TimelineAggregation.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TimelineAggregation.cs index 79b0193c3ad0..7735337ef98f 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TimelineAggregation.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TimelineAggregation.cs @@ -32,7 +32,7 @@ public TimelineAggregation() /// /// the total items found for a kind /// the query kind. Possible values include: - /// 'Activity', 'Bookmark', 'SecurityAlert' + /// 'Activity', 'Bookmark', 'SecurityAlert', 'Anomaly' public TimelineAggregation(int count, string kind) { Count = count; @@ -53,7 +53,7 @@ public TimelineAggregation(int count, string kind) /// /// Gets or sets the query kind. Possible values include: 'Activity', - /// 'Bookmark', 'SecurityAlert' + /// 'Bookmark', 'SecurityAlert', 'Anomaly' /// [JsonProperty(PropertyName = "kind")] public string Kind { get; set; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TimelineError.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TimelineError.cs index 90d64f7d80d9..7a93205428a3 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TimelineError.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TimelineError.cs @@ -31,7 +31,7 @@ public TimelineError() /// Initializes a new instance of the TimelineError class. /// /// the query kind. Possible values include: - /// 'Activity', 'Bookmark', 'SecurityAlert' + /// 'Activity', 'Bookmark', 'SecurityAlert', 'Anomaly' /// the error message /// the query id public TimelineError(string kind, string errorMessage, string queryId = default(string)) @@ -49,7 +49,7 @@ public TimelineError() /// /// Gets or sets the query kind. Possible values include: 'Activity', - /// 'Bookmark', 'SecurityAlert' + /// 'Bookmark', 'SecurityAlert', 'Anomaly' /// [JsonProperty(PropertyName = "kind")] public string Kind { get; set; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TriggersOn.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TriggersOn.cs index ae772b63d87d..37f90f2c4478 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TriggersOn.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TriggersOn.cs @@ -20,5 +20,9 @@ public static class TriggersOn /// Trigger on Incidents /// public const string Incidents = "Incidents"; + /// + /// Trigger on Alerts + /// + public const string Alerts = "Alerts"; } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TriggersWhen.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TriggersWhen.cs index a840362759d8..26504ceba80b 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TriggersWhen.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TriggersWhen.cs @@ -20,5 +20,9 @@ public static class TriggersWhen /// Trigger on created objects /// public const string Created = "Created"; + /// + /// Trigger on updated objects + /// + public const string Updated = "Updated"; } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ValidationError.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ValidationError.cs new file mode 100644 index 000000000000..5e1194bdb64a --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ValidationError.cs @@ -0,0 +1,63 @@ +// +// 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.SecurityInsights.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes an error encountered in the file during validation. + /// + public partial class ValidationError + { + /// + /// Initializes a new instance of the ValidationError class. + /// + public ValidationError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ValidationError class. + /// + /// The number of the record that has the + /// error. + /// A list of descriptions of the + /// error. + public ValidationError(int? recordIndex = default(int?), IList errorMessages = default(IList)) + { + RecordIndex = recordIndex; + ErrorMessages = errorMessages; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the number of the record that has the error. + /// + [JsonProperty(PropertyName = "recordIndex")] + public int? RecordIndex { get; set; } + + /// + /// Gets a list of descriptions of the error. + /// + [JsonProperty(PropertyName = "errorMessages")] + public IList ErrorMessages { get; private set; } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/WatchlistItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/WatchlistItem.cs index 161d2e5d31bc..520137054097 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/WatchlistItem.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/WatchlistItem.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -61,7 +63,7 @@ public WatchlistItem() /// item /// key-value pairs for a watchlist item /// entity mapping - public WatchlistItem(object itemsKeyValue, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string watchlistItemType = default(string), string watchlistItemId = default(string), string tenantId = default(string), bool? isDeleted = default(bool?), System.DateTime? created = default(System.DateTime?), System.DateTime? updated = default(System.DateTime?), UserInfo createdBy = default(UserInfo), UserInfo updatedBy = default(UserInfo), object entityMapping = default(object)) + public WatchlistItem(IDictionary itemsKeyValue, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string watchlistItemType = default(string), string watchlistItemId = default(string), string tenantId = default(string), bool? isDeleted = default(bool?), System.DateTime? created = default(System.DateTime?), System.DateTime? updated = default(System.DateTime?), UserInfo createdBy = default(UserInfo), UserInfo updatedBy = default(UserInfo), IDictionary entityMapping = default(IDictionary)) : base(id, name, type, systemData, etag) { WatchlistItemType = watchlistItemType; @@ -135,13 +137,13 @@ public WatchlistItem() /// Gets or sets key-value pairs for a watchlist item /// [JsonProperty(PropertyName = "properties.itemsKeyValue")] - public object ItemsKeyValue { get; set; } + public IDictionary ItemsKeyValue { get; set; } /// /// Gets or sets key-value pairs for a watchlist item entity mapping /// [JsonProperty(PropertyName = "properties.entityMapping")] - public object EntityMapping { get; set; } + public IDictionary EntityMapping { get; set; } /// /// Validate the object. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/WorkspaceManagerGroup.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/WorkspaceManagerGroup.cs new file mode 100644 index 000000000000..3919fb896c17 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/WorkspaceManagerGroup.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.SecurityInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The workspace manager group + /// + [Rest.Serialization.JsonTransformation] + public partial class WorkspaceManagerGroup : AzureEntityResource + { + /// + /// Initializes a new instance of the WorkspaceManagerGroup class. + /// + public WorkspaceManagerGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceManagerGroup class. + /// + /// The display name of the workspace manager + /// group + /// The names of the workspace + /// manager members participating in this group. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// Resource Etag. + /// The description of the workspace manager + /// group + public WorkspaceManagerGroup(string displayName, IList memberResourceNames, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string description = default(string)) + : base(id, name, type, systemData, etag) + { + Description = description; + DisplayName = displayName; + MemberResourceNames = memberResourceNames; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the description of the workspace manager group + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets the display name of the workspace manager group + /// + [JsonProperty(PropertyName = "properties.displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets the names of the workspace manager members + /// participating in this group. + /// + [JsonProperty(PropertyName = "properties.memberResourceNames")] + public IList MemberResourceNames { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DisplayName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); + } + if (MemberResourceNames == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "MemberResourceNames"); + } + } + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/OfficeConsentsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/OfficeConsentsOperations.cs index 5300acb5198b..0c82ac338ab2 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/OfficeConsentsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/OfficeConsentsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// OfficeConsentsOperations operations. /// - internal partial class OfficeConsentsOperations : IServiceOperations, IOfficeConsentsOperations + internal partial class OfficeConsentsOperations : IServiceOperations, IOfficeConsentsOperations { /// /// Initializes a new instance of the OfficeConsentsOperations class. @@ -36,7 +36,7 @@ internal partial class OfficeConsentsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal OfficeConsentsOperations(SecurityInsights client) + internal OfficeConsentsOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal OfficeConsentsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all office365 consents. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Operations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Operations.cs index 13edbb9da26f..817cb31f1651 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Operations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Operations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// Operations operations. /// - internal partial class Operations : IServiceOperations, IOperations + internal partial class Operations : IServiceOperations, IOperations { /// /// Initializes a new instance of the Operations class. @@ -36,7 +36,7 @@ internal partial class Operations : IServiceOperations, IOpera /// /// Thrown when a required parameter is null /// - internal Operations(SecurityInsights client) + internal Operations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal Operations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Lists all operations available Azure Security Insights Resource Provider. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ProductSettingsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ProductSettingsOperations.cs index acdfcbab4ada..17cab90b475e 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ProductSettingsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ProductSettingsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// ProductSettingsOperations operations. /// - internal partial class ProductSettingsOperations : IServiceOperations, IProductSettingsOperations + internal partial class ProductSettingsOperations : IServiceOperations, IProductSettingsOperations { /// /// Initializes a new instance of the ProductSettingsOperations class. @@ -36,7 +36,7 @@ internal partial class ProductSettingsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal ProductSettingsOperations(SecurityInsights client) + internal ProductSettingsOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal ProductSettingsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// List of all the settings diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SdkInfo_SecurityInsights.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SdkInfo_SecurityInsights.cs index 60d9df8c0677..980c626f84d8 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SdkInfo_SecurityInsights.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SdkInfo_SecurityInsights.cs @@ -19,51 +19,43 @@ public static IEnumerable> ApiInfo_SecurityInsight { return new Tuple[] { - new Tuple("OperationalInsights", "Actions", "2022-01-01-preview"), - new Tuple("OperationalInsights", "AlertRuleTemplates", "2022-01-01-preview"), - new Tuple("OperationalInsights", "AlertRules", "2022-01-01-preview"), - new Tuple("OperationalInsights", "AutomationRules", "2022-01-01-preview"), - new Tuple("OperationalInsights", "Bookmark", "2022-01-01-preview"), - new Tuple("OperationalInsights", "BookmarkRelations", "2022-01-01-preview"), - new Tuple("OperationalInsights", "Bookmarks", "2022-01-01-preview"), - new Tuple("OperationalInsights", "DataConnectors", "2022-01-01-preview"), - new Tuple("OperationalInsights", "DataConnectorsCheckRequirements", "2022-01-01-preview"), - new Tuple("OperationalInsights", "Entities", "2022-01-01-preview"), - new Tuple("OperationalInsights", "EntitiesGetTimeline", "2022-01-01-preview"), - new Tuple("OperationalInsights", "EntitiesRelations", "2022-01-01-preview"), - new Tuple("OperationalInsights", "EntityQueries", "2022-01-01-preview"), - new Tuple("OperationalInsights", "EntityQueryTemplates", "2022-01-01-preview"), - new Tuple("OperationalInsights", "EntityRelations", "2022-01-01-preview"), - new Tuple("OperationalInsights", "IncidentComments", "2022-01-01-preview"), - new Tuple("OperationalInsights", "IncidentRelations", "2022-01-01-preview"), - new Tuple("OperationalInsights", "Incidents", "2022-01-01-preview"), - new Tuple("OperationalInsights", "Metadata", "2022-01-01-preview"), - new Tuple("OperationalInsights", "OfficeConsents", "2022-01-01-preview"), - new Tuple("OperationalInsights", "ProductSettings", "2022-01-01-preview"), - new Tuple("OperationalInsights", "SentinelOnboardingStates", "2022-01-01-preview"), - new Tuple("OperationalInsights", "SourceControl", "2022-01-01-preview"), - new Tuple("OperationalInsights", "SourceControls", "2022-01-01-preview"), - new Tuple("OperationalInsights", "ThreatIntelligenceIndicator", "2022-01-01-preview"), - new Tuple("OperationalInsights", "ThreatIntelligenceIndicatorMetrics", "2022-01-01-preview"), - new Tuple("OperationalInsights", "ThreatIntelligenceIndicators", "2022-01-01-preview"), - new Tuple("OperationalInsights", "WatchlistItems", "2022-01-01-preview"), - new Tuple("OperationalInsights", "Watchlists", "2022-01-01-preview"), - new Tuple("SecurityInsights", "DomainWhois", "2022-01-01-preview"), - new Tuple("SecurityInsights", "IPGeodata", "2022-01-01-preview"), - new Tuple("SecurityInsights", "Operations", "2022-01-01-preview"), + new Tuple("OperationalInsights", "Actions", "2023-03-01-preview"), + new Tuple("OperationalInsights", "AlertRuleTemplates", "2023-03-01-preview"), + new Tuple("OperationalInsights", "AlertRules", "2023-03-01-preview"), + new Tuple("OperationalInsights", "AutomationRules", "2023-03-01-preview"), + new Tuple("OperationalInsights", "Bookmark", "2023-03-01-preview"), + new Tuple("OperationalInsights", "BookmarkRelations", "2023-03-01-preview"), + new Tuple("OperationalInsights", "Bookmarks", "2023-03-01-preview"), + new Tuple("OperationalInsights", "DataConnectors", "2023-03-01-preview"), + new Tuple("OperationalInsights", "DataConnectorsCheckRequirements", "2023-03-01-preview"), + new Tuple("OperationalInsights", "Entities", "2023-03-01-preview"), + new Tuple("OperationalInsights", "EntitiesGetTimeline", "2023-03-01-preview"), + new Tuple("OperationalInsights", "EntitiesRelations", "2023-03-01-preview"), + new Tuple("OperationalInsights", "EntityQueries", "2023-03-01-preview"), + new Tuple("OperationalInsights", "EntityQueryTemplates", "2023-03-01-preview"), + new Tuple("OperationalInsights", "EntityRelations", "2023-03-01-preview"), + new Tuple("OperationalInsights", "FileImports", "2023-03-01-preview"), + new Tuple("OperationalInsights", "IncidentComments", "2023-03-01-preview"), + new Tuple("OperationalInsights", "IncidentRelations", "2023-03-01-preview"), + new Tuple("OperationalInsights", "Incidents", "2023-03-01-preview"), + new Tuple("OperationalInsights", "Metadata", "2023-03-01-preview"), + new Tuple("OperationalInsights", "OfficeConsents", "2023-03-01-preview"), + new Tuple("OperationalInsights", "ProductSettings", "2023-03-01-preview"), + new Tuple("OperationalInsights", "SecurityMLAnalyticsSettings", "2023-03-01-preview"), + new Tuple("OperationalInsights", "SentinelOnboardingStates", "2023-03-01-preview"), + new Tuple("OperationalInsights", "SourceControl", "2023-03-01-preview"), + new Tuple("OperationalInsights", "SourceControls", "2023-03-01-preview"), + new Tuple("OperationalInsights", "ThreatIntelligenceIndicator", "2023-03-01-preview"), + new Tuple("OperationalInsights", "ThreatIntelligenceIndicatorMetrics", "2023-03-01-preview"), + new Tuple("OperationalInsights", "ThreatIntelligenceIndicators", "2023-03-01-preview"), + new Tuple("OperationalInsights", "WatchlistItems", "2023-03-01-preview"), + new Tuple("OperationalInsights", "Watchlists", "2023-03-01-preview"), + new Tuple("OperationalInsights", "WorkspaceManagerGroups", "2023-03-01-preview"), + new Tuple("SecurityInsights", "DomainWhois", "2023-03-01-preview"), + new Tuple("SecurityInsights", "IPGeodata", "2023-03-01-preview"), + new Tuple("SecurityInsights", "Operations", "2023-03-01-preview"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "2.0.4421"; - public static readonly String AutoRestBootStrapperVersion = "autorest@3.5.1"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/securityinsights/resource-manager/readme.md --csharp --version=2.0.4421 --reflect-api-versions --csharp-sdks-folder=C:\\One\\azure\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "main"; - public static readonly String GithubCommidId = "96da969aa75e2beb27c3dbc2d69a76900856cc52"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityInsights.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityInsightsClient.cs similarity index 86% rename from sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityInsights.cs rename to sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityInsightsClient.cs index 349e1e2ffd27..be5efd46a249 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityInsights.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityInsightsClient.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// API spec for Microsoft.SecurityInsights (Azure Security Insights) /// resource provider /// - public partial class SecurityInsights : ServiceClient, ISecurityInsights, IAzureClient + public partial class SecurityInsightsClient : ServiceClient, ISecurityInsightsClient, IAzureClient { /// /// The base URI of the service. @@ -155,6 +155,11 @@ public partial class SecurityInsights : ServiceClient, ISecuri /// public virtual IEntityQueryTemplatesOperations EntityQueryTemplates { get; private set; } + /// + /// Gets the IFileImportsOperations. + /// + public virtual IFileImportsOperations FileImports { get; private set; } + /// /// Gets the IIncidentCommentsOperations. /// @@ -180,6 +185,11 @@ public partial class SecurityInsights : ServiceClient, ISecuri /// public virtual ISentinelOnboardingStatesOperations SentinelOnboardingStates { get; private set; } + /// + /// Gets the ISecurityMLAnalyticsSettingsOperations. + /// + public virtual ISecurityMLAnalyticsSettingsOperations SecurityMLAnalyticsSettings { get; private set; } + /// /// Gets the IProductSettingsOperations. /// @@ -220,6 +230,11 @@ public partial class SecurityInsights : ServiceClient, ISecuri /// public virtual IWatchlistItemsOperations WatchlistItems { get; private set; } + /// + /// Gets the IWorkspaceManagerGroupsOperations. + /// + public virtual IWorkspaceManagerGroupsOperations WorkspaceManagerGroups { get; private set; } + /// /// Gets the IDataConnectorsOperations. /// @@ -236,31 +251,31 @@ public partial class SecurityInsights : ServiceClient, ISecuri public virtual IOperations Operations { get; private set; } /// - /// Initializes a new instance of the SecurityInsights class. + /// Initializes a new instance of the SecurityInsightsClient class. /// /// /// HttpClient to be used /// /// - /// True: will dispose the provided httpClient on calling SecurityInsights.Dispose(). False: will not dispose provided httpClient - protected SecurityInsights(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + /// True: will dispose the provided httpClient on calling SecurityInsightsClient.Dispose(). False: will not dispose provided httpClient + protected SecurityInsightsClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { Initialize(); } /// - /// Initializes a new instance of the SecurityInsights class. + /// Initializes a new instance of the SecurityInsightsClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected SecurityInsights(params DelegatingHandler[] handlers) : base(handlers) + protected SecurityInsightsClient(params DelegatingHandler[] handlers) : base(handlers) { Initialize(); } /// - /// Initializes a new instance of the SecurityInsights class. + /// Initializes a new instance of the SecurityInsightsClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -268,13 +283,13 @@ protected SecurityInsights(params DelegatingHandler[] handlers) : base(handlers) /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected SecurityInsights(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected SecurityInsightsClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { Initialize(); } /// - /// Initializes a new instance of the SecurityInsights class. + /// Initializes a new instance of the SecurityInsightsClient class. /// /// /// Optional. The base URI of the service. @@ -285,7 +300,7 @@ protected SecurityInsights(HttpClientHandler rootHandler, params DelegatingHandl /// /// Thrown when a required parameter is null /// - protected SecurityInsights(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected SecurityInsightsClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -295,7 +310,7 @@ protected SecurityInsights(System.Uri baseUri, params DelegatingHandler[] handle } /// - /// Initializes a new instance of the SecurityInsights class. + /// Initializes a new instance of the SecurityInsightsClient class. /// /// /// Optional. The base URI of the service. @@ -309,7 +324,7 @@ protected SecurityInsights(System.Uri baseUri, params DelegatingHandler[] handle /// /// Thrown when a required parameter is null /// - protected SecurityInsights(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected SecurityInsightsClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -319,7 +334,7 @@ protected SecurityInsights(System.Uri baseUri, HttpClientHandler rootHandler, pa } /// - /// Initializes a new instance of the SecurityInsights class. + /// Initializes a new instance of the SecurityInsightsClient class. /// /// /// Required. Credentials needed for the client to connect to Azure. @@ -330,7 +345,7 @@ protected SecurityInsights(System.Uri baseUri, HttpClientHandler rootHandler, pa /// /// Thrown when a required parameter is null /// - public SecurityInsights(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public SecurityInsightsClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { @@ -344,7 +359,7 @@ public SecurityInsights(ServiceClientCredentials credentials, params DelegatingH } /// - /// Initializes a new instance of the SecurityInsights class. + /// Initializes a new instance of the SecurityInsightsClient class. /// /// /// Required. Credentials needed for the client to connect to Azure. @@ -353,11 +368,11 @@ public SecurityInsights(ServiceClientCredentials credentials, params DelegatingH /// HttpClient to be used /// /// - /// True: will dispose the provided httpClient on calling SecurityInsights.Dispose(). False: will not dispose provided httpClient + /// True: will dispose the provided httpClient on calling SecurityInsightsClient.Dispose(). False: will not dispose provided httpClient /// /// Thrown when a required parameter is null /// - public SecurityInsights(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public SecurityInsightsClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { @@ -371,7 +386,7 @@ public SecurityInsights(ServiceClientCredentials credentials, HttpClient httpCli } /// - /// Initializes a new instance of the SecurityInsights class. + /// Initializes a new instance of the SecurityInsightsClient class. /// /// /// Required. Credentials needed for the client to connect to Azure. @@ -385,7 +400,7 @@ public SecurityInsights(ServiceClientCredentials credentials, HttpClient httpCli /// /// Thrown when a required parameter is null /// - public SecurityInsights(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public SecurityInsightsClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { @@ -399,7 +414,7 @@ public SecurityInsights(ServiceClientCredentials credentials, HttpClientHandler } /// - /// Initializes a new instance of the SecurityInsights class. + /// Initializes a new instance of the SecurityInsightsClient class. /// /// /// Optional. The base URI of the service. @@ -413,7 +428,7 @@ public SecurityInsights(ServiceClientCredentials credentials, HttpClientHandler /// /// Thrown when a required parameter is null /// - public SecurityInsights(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public SecurityInsightsClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -432,7 +447,7 @@ public SecurityInsights(System.Uri baseUri, ServiceClientCredentials credentials } /// - /// Initializes a new instance of the SecurityInsights class. + /// Initializes a new instance of the SecurityInsightsClient class. /// /// /// Optional. The base URI of the service. @@ -449,7 +464,7 @@ public SecurityInsights(System.Uri baseUri, ServiceClientCredentials credentials /// /// Thrown when a required parameter is null /// - public SecurityInsights(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public SecurityInsightsClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -492,11 +507,13 @@ private void Initialize() EntityRelations = new EntityRelationsOperations(this); EntityQueries = new EntityQueriesOperations(this); EntityQueryTemplates = new EntityQueryTemplatesOperations(this); + FileImports = new FileImportsOperations(this); IncidentComments = new IncidentCommentsOperations(this); IncidentRelations = new IncidentRelationsOperations(this); Metadata = new MetadataOperations(this); OfficeConsents = new OfficeConsentsOperations(this); SentinelOnboardingStates = new SentinelOnboardingStatesOperations(this); + SecurityMLAnalyticsSettings = new SecurityMLAnalyticsSettingsOperations(this); ProductSettings = new ProductSettingsOperations(this); SourceControl = new SourceControlOperations(this); SourceControls = new SourceControlsOperations(this); @@ -505,11 +522,12 @@ private void Initialize() ThreatIntelligenceIndicatorMetrics = new ThreatIntelligenceIndicatorMetricsOperations(this); Watchlists = new WatchlistsOperations(this); WatchlistItems = new WatchlistItemsOperations(this); + WorkspaceManagerGroups = new WorkspaceManagerGroupsOperations(this); DataConnectors = new DataConnectorsOperations(this); DataConnectorsCheckRequirements = new DataConnectorsCheckRequirementsOperations(this); Operations = new Operations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2022-01-01-preview"; + ApiVersion = "2023-03-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -559,6 +577,8 @@ private void Initialize() DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); 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("kind")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityMLAnalyticsSettingsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityMLAnalyticsSettingsOperations.cs new file mode 100644 index 000000000000..03c67e33475d --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityMLAnalyticsSettingsOperations.cs @@ -0,0 +1,1193 @@ +// +// 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.SecurityInsights +{ + 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; + + /// + /// SecurityMLAnalyticsSettingsOperations operations. + /// + internal partial class SecurityMLAnalyticsSettingsOperations : IServiceOperations, ISecurityMLAnalyticsSettingsOperations + { + /// + /// Initializes a new instance of the SecurityMLAnalyticsSettingsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SecurityMLAnalyticsSettingsOperations(SecurityInsightsClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityInsightsClient + /// + public SecurityInsightsClient Client { get; private set; } + + /// + /// Gets all Security ML Analytics Settings. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// 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 resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 90); + } + if (workspaceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + } + + /// + /// Gets the Security ML Analytics Settings. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Security ML Analytics Settings resource name + /// + /// + /// 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 resourceGroupName, string workspaceName, string settingsResourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 90); + } + if (workspaceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 1); + } + } + if (settingsResourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "settingsResourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("settingsResourceName", settingsResourceName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{settingsResourceName}", System.Uri.EscapeDataString(settingsResourceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + } + + /// + /// Creates or updates the Security ML Analytics Settings. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Security ML Analytics Settings resource name + /// + /// + /// The security ML Analytics setting + /// + /// + /// 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 resourceGroupName, string workspaceName, string settingsResourceName, SecurityMLAnalyticsSetting securityMLAnalyticsSetting, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 90); + } + if (workspaceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 1); + } + } + if (settingsResourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "settingsResourceName"); + } + if (securityMLAnalyticsSetting == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securityMLAnalyticsSetting"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("settingsResourceName", settingsResourceName); + tracingParameters.Add("securityMLAnalyticsSetting", securityMLAnalyticsSetting); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{settingsResourceName}", System.Uri.EscapeDataString(settingsResourceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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(securityMLAnalyticsSetting != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(securityMLAnalyticsSetting, 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 the Security ML Analytics Settings. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Security ML Analytics Settings resource name + /// + /// + /// 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 resourceGroupName, string workspaceName, string settingsResourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 90); + } + if (workspaceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 1); + } + } + if (settingsResourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "settingsResourceName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("settingsResourceName", settingsResourceName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{settingsResourceName}", System.Uri.EscapeDataString(settingsResourceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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; + } + + /// + /// Gets all Security ML Analytics Settings. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + 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; + } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityMLAnalyticsSettingsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityMLAnalyticsSettingsOperationsExtensions.cs new file mode 100644 index 000000000000..090746ea5297 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityMLAnalyticsSettingsOperationsExtensions.cs @@ -0,0 +1,240 @@ +// +// 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.SecurityInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SecurityMLAnalyticsSettingsOperations. + /// + public static partial class SecurityMLAnalyticsSettingsOperationsExtensions + { + /// + /// Gets all Security ML Analytics Settings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + public static IPage List(this ISecurityMLAnalyticsSettingsOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets all Security ML Analytics Settings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ISecurityMLAnalyticsSettingsOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the Security ML Analytics Settings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Security ML Analytics Settings resource name + /// + public static SecurityMLAnalyticsSetting Get(this ISecurityMLAnalyticsSettingsOperations operations, string resourceGroupName, string workspaceName, string settingsResourceName) + { + return operations.GetAsync(resourceGroupName, workspaceName, settingsResourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the Security ML Analytics Settings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Security ML Analytics Settings resource name + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISecurityMLAnalyticsSettingsOperations operations, string resourceGroupName, string workspaceName, string settingsResourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, settingsResourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates the Security ML Analytics Settings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Security ML Analytics Settings resource name + /// + /// + /// The security ML Analytics setting + /// + public static SecurityMLAnalyticsSetting CreateOrUpdate(this ISecurityMLAnalyticsSettingsOperations operations, string resourceGroupName, string workspaceName, string settingsResourceName, SecurityMLAnalyticsSetting securityMLAnalyticsSetting) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, settingsResourceName, securityMLAnalyticsSetting).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates the Security ML Analytics Settings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Security ML Analytics Settings resource name + /// + /// + /// The security ML Analytics setting + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISecurityMLAnalyticsSettingsOperations operations, string resourceGroupName, string workspaceName, string settingsResourceName, SecurityMLAnalyticsSetting securityMLAnalyticsSetting, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, settingsResourceName, securityMLAnalyticsSetting, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete the Security ML Analytics Settings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Security ML Analytics Settings resource name + /// + public static void Delete(this ISecurityMLAnalyticsSettingsOperations operations, string resourceGroupName, string workspaceName, string settingsResourceName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, settingsResourceName).GetAwaiter().GetResult(); + } + + /// + /// Delete the Security ML Analytics Settings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Security ML Analytics Settings resource name + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISecurityMLAnalyticsSettingsOperations operations, string resourceGroupName, string workspaceName, string settingsResourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, settingsResourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets all Security ML Analytics Settings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this ISecurityMLAnalyticsSettingsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all Security ML Analytics Settings. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this ISecurityMLAnalyticsSettingsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SentinelOnboardingStatesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SentinelOnboardingStatesOperations.cs index 6d5ad39e9e51..18e1fb271655 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SentinelOnboardingStatesOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SentinelOnboardingStatesOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// SentinelOnboardingStatesOperations operations. /// - internal partial class SentinelOnboardingStatesOperations : IServiceOperations, ISentinelOnboardingStatesOperations + internal partial class SentinelOnboardingStatesOperations : IServiceOperations, ISentinelOnboardingStatesOperations { /// /// Initializes a new instance of the SentinelOnboardingStatesOperations class. @@ -36,7 +36,7 @@ internal partial class SentinelOnboardingStatesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SentinelOnboardingStatesOperations(SecurityInsights client) + internal SentinelOnboardingStatesOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal SentinelOnboardingStatesOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Get Sentinel onboarding state diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlOperations.cs index 940c11eb6cba..52efe50962bc 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// SourceControlOperations operations. /// - internal partial class SourceControlOperations : IServiceOperations, ISourceControlOperations + internal partial class SourceControlOperations : IServiceOperations, ISourceControlOperations { /// /// Initializes a new instance of the SourceControlOperations class. @@ -36,7 +36,7 @@ internal partial class SourceControlOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SourceControlOperations(SecurityInsights client) + internal SourceControlOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal SourceControlOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets a list of repositories metadata. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlsOperations.cs index 8f6d46fb0e0a..8cec74d24f47 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// SourceControlsOperations operations. /// - internal partial class SourceControlsOperations : IServiceOperations, ISourceControlsOperations + internal partial class SourceControlsOperations : IServiceOperations, ISourceControlsOperations { /// /// Initializes a new instance of the SourceControlsOperations class. @@ -36,7 +36,7 @@ internal partial class SourceControlsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SourceControlsOperations(SecurityInsights client) + internal SourceControlsOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal SourceControlsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all source controls, without source control items. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorMetricsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorMetricsOperations.cs index 928943cb7e0e..4eb4dd4f4c81 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorMetricsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorMetricsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// ThreatIntelligenceIndicatorMetricsOperations operations. /// - internal partial class ThreatIntelligenceIndicatorMetricsOperations : IServiceOperations, IThreatIntelligenceIndicatorMetricsOperations + internal partial class ThreatIntelligenceIndicatorMetricsOperations : IServiceOperations, IThreatIntelligenceIndicatorMetricsOperations { /// /// Initializes a new instance of the ThreatIntelligenceIndicatorMetricsOperations class. @@ -36,7 +36,7 @@ internal partial class ThreatIntelligenceIndicatorMetricsOperations : IServiceOp /// /// Thrown when a required parameter is null /// - internal ThreatIntelligenceIndicatorMetricsOperations(SecurityInsights client) + internal ThreatIntelligenceIndicatorMetricsOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal ThreatIntelligenceIndicatorMetricsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Get threat intelligence indicators metrics (Indicators counts by Type, diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorOperations.cs index a7cd32a0efab..42afaf85d02c 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// ThreatIntelligenceIndicatorOperations operations. /// - internal partial class ThreatIntelligenceIndicatorOperations : IServiceOperations, IThreatIntelligenceIndicatorOperations + internal partial class ThreatIntelligenceIndicatorOperations : IServiceOperations, IThreatIntelligenceIndicatorOperations { /// /// Initializes a new instance of the ThreatIntelligenceIndicatorOperations class. @@ -36,7 +36,7 @@ internal partial class ThreatIntelligenceIndicatorOperations : IServiceOperation /// /// Thrown when a required parameter is null /// - internal ThreatIntelligenceIndicatorOperations(SecurityInsights client) + internal ThreatIntelligenceIndicatorOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal ThreatIntelligenceIndicatorOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Create a new threat intelligence indicator. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorsOperations.cs index faf1dd210e16..19ef9d524c63 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// ThreatIntelligenceIndicatorsOperations operations. /// - internal partial class ThreatIntelligenceIndicatorsOperations : IServiceOperations, IThreatIntelligenceIndicatorsOperations + internal partial class ThreatIntelligenceIndicatorsOperations : IServiceOperations, IThreatIntelligenceIndicatorsOperations { /// /// Initializes a new instance of the ThreatIntelligenceIndicatorsOperations class. @@ -36,7 +36,7 @@ internal partial class ThreatIntelligenceIndicatorsOperations : IServiceOperatio /// /// Thrown when a required parameter is null /// - internal ThreatIntelligenceIndicatorsOperations(SecurityInsights client) + internal ThreatIntelligenceIndicatorsOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal ThreatIntelligenceIndicatorsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Get all threat intelligence indicators. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistItemsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistItemsOperations.cs index 1ccd4616a230..58c6792a1111 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistItemsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistItemsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// WatchlistItemsOperations operations. /// - internal partial class WatchlistItemsOperations : IServiceOperations, IWatchlistItemsOperations + internal partial class WatchlistItemsOperations : IServiceOperations, IWatchlistItemsOperations { /// /// Initializes a new instance of the WatchlistItemsOperations class. @@ -36,7 +36,7 @@ internal partial class WatchlistItemsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal WatchlistItemsOperations(SecurityInsights client) + internal WatchlistItemsOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal WatchlistItemsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all watchlist Items. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistsOperations.cs index d18692182c5d..09bf62598c93 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistsOperations.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights /// /// WatchlistsOperations operations. /// - internal partial class WatchlistsOperations : IServiceOperations, IWatchlistsOperations + internal partial class WatchlistsOperations : IServiceOperations, IWatchlistsOperations { /// /// Initializes a new instance of the WatchlistsOperations class. @@ -36,7 +36,7 @@ internal partial class WatchlistsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal WatchlistsOperations(SecurityInsights client) + internal WatchlistsOperations(SecurityInsightsClient client) { if (client == null) { @@ -46,9 +46,9 @@ internal WatchlistsOperations(SecurityInsights client) } /// - /// Gets a reference to the SecurityInsights + /// Gets a reference to the SecurityInsightsClient /// - public SecurityInsights Client { get; private set; } + public SecurityInsightsClient Client { get; private set; } /// /// Gets all watchlists, without watchlist items. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WorkspaceManagerGroupsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WorkspaceManagerGroupsOperations.cs new file mode 100644 index 000000000000..9c8e5a46bd90 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WorkspaceManagerGroupsOperations.cs @@ -0,0 +1,1199 @@ +// +// 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.SecurityInsights +{ + 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; + + /// + /// WorkspaceManagerGroupsOperations operations. + /// + internal partial class WorkspaceManagerGroupsOperations : IServiceOperations, IWorkspaceManagerGroupsOperations + { + /// + /// Initializes a new instance of the WorkspaceManagerGroupsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal WorkspaceManagerGroupsOperations(SecurityInsightsClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityInsightsClient + /// + public SecurityInsightsClient Client { get; private set; } + + /// + /// Gets all workspace manager groups in the Sentinel workspace manager + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Sorts the results. Optional. + /// + /// + /// Returns only the first n results. Optional. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls. Optional. + /// + /// + /// 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 resourceGroupName, string workspaceName, string orderby = default(string), int? top = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 90); + } + if (workspaceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("orderby", orderby); + tracingParameters.Add("top", top); + tracingParameters.Add("skipToken", skipToken); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerGroups").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } + if (top != null) + { + _queryParameters.Add(string.Format("$top={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(top, Client.SerializationSettings).Trim('"')))); + } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Gets a workspace manager group + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the workspace manager group + /// + /// + /// 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 resourceGroupName, string workspaceName, string workspaceManagerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 90); + } + if (workspaceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 1); + } + } + if (workspaceManagerGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceManagerGroupName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("workspaceManagerGroupName", workspaceManagerGroupName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerGroups/{workspaceManagerGroupName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{workspaceManagerGroupName}", System.Uri.EscapeDataString(workspaceManagerGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Creates or updates a workspace manager group. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the workspace manager group + /// + /// + /// The workspace manager group object + /// + /// + /// 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 resourceGroupName, string workspaceName, string workspaceManagerGroupName, WorkspaceManagerGroup workspaceManagerGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 90); + } + if (workspaceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 1); + } + } + if (workspaceManagerGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceManagerGroupName"); + } + if (workspaceManagerGroup == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceManagerGroup"); + } + if (workspaceManagerGroup != null) + { + workspaceManagerGroup.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("workspaceManagerGroupName", workspaceManagerGroupName); + tracingParameters.Add("workspaceManagerGroup", workspaceManagerGroup); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerGroups/{workspaceManagerGroupName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{workspaceManagerGroupName}", System.Uri.EscapeDataString(workspaceManagerGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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(workspaceManagerGroup != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(workspaceManagerGroup, 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Deletes a workspace manager group + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the workspace manager group + /// + /// + /// 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 resourceGroupName, string workspaceName, string workspaceManagerGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 90); + } + if (workspaceName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 1); + } + } + if (workspaceManagerGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceManagerGroupName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("workspaceManagerGroupName", workspaceManagerGroupName); + 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("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/workspaceManagerGroups/{workspaceManagerGroupName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); + _url = _url.Replace("{workspaceManagerGroupName}", System.Uri.EscapeDataString(workspaceManagerGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Gets all workspace manager groups in the Sentinel workspace manager + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + 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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WorkspaceManagerGroupsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WorkspaceManagerGroupsOperationsExtensions.cs new file mode 100644 index 000000000000..18bd684aea35 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WorkspaceManagerGroupsOperationsExtensions.cs @@ -0,0 +1,264 @@ +// +// 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.SecurityInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for WorkspaceManagerGroupsOperations. + /// + public static partial class WorkspaceManagerGroupsOperationsExtensions + { + /// + /// Gets all workspace manager groups in the Sentinel workspace manager + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Sorts the results. Optional. + /// + /// + /// Returns only the first n results. Optional. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls. Optional. + /// + public static IPage List(this IWorkspaceManagerGroupsOperations operations, string resourceGroupName, string workspaceName, string orderby = default(string), int? top = default(int?), string skipToken = default(string)) + { + return operations.ListAsync(resourceGroupName, workspaceName, orderby, top, skipToken).GetAwaiter().GetResult(); + } + + /// + /// Gets all workspace manager groups in the Sentinel workspace manager + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// Sorts the results. Optional. + /// + /// + /// Returns only the first n results. Optional. + /// + /// + /// Skiptoken is only used if a previous operation returned a partial result. + /// If a previous response contains a nextLink element, the value of the + /// nextLink element will include a skiptoken parameter that specifies a + /// starting point to use for subsequent calls. Optional. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IWorkspaceManagerGroupsOperations operations, string resourceGroupName, string workspaceName, string orderby = default(string), int? top = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, orderby, top, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a workspace manager group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the workspace manager group + /// + public static WorkspaceManagerGroup Get(this IWorkspaceManagerGroupsOperations operations, string resourceGroupName, string workspaceName, string workspaceManagerGroupName) + { + return operations.GetAsync(resourceGroupName, workspaceName, workspaceManagerGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets a workspace manager group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the workspace manager group + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IWorkspaceManagerGroupsOperations operations, string resourceGroupName, string workspaceName, string workspaceManagerGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, workspaceManagerGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a workspace manager group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the workspace manager group + /// + /// + /// The workspace manager group object + /// + public static WorkspaceManagerGroup CreateOrUpdate(this IWorkspaceManagerGroupsOperations operations, string resourceGroupName, string workspaceName, string workspaceManagerGroupName, WorkspaceManagerGroup workspaceManagerGroup) + { + return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, workspaceManagerGroupName, workspaceManagerGroup).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a workspace manager group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the workspace manager group + /// + /// + /// The workspace manager group object + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IWorkspaceManagerGroupsOperations operations, string resourceGroupName, string workspaceName, string workspaceManagerGroupName, WorkspaceManagerGroup workspaceManagerGroup, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, workspaceManagerGroupName, workspaceManagerGroup, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a workspace manager group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the workspace manager group + /// + public static void Delete(this IWorkspaceManagerGroupsOperations operations, string resourceGroupName, string workspaceName, string workspaceManagerGroupName) + { + operations.DeleteAsync(resourceGroupName, workspaceName, workspaceManagerGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a workspace manager group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the workspace manager group + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IWorkspaceManagerGroupsOperations operations, string resourceGroupName, string workspaceName, string workspaceManagerGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, workspaceManagerGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets all workspace manager groups in the Sentinel workspace manager + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IWorkspaceManagerGroupsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all workspace manager groups in the Sentinel workspace manager + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IWorkspaceManagerGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +}