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 2b96c54e0bc51..8c0055f2654db 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ActionsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ActionsOperations.cs @@ -54,7 +54,8 @@ internal ActionsOperations(SecurityInsightsClient client) /// Gets all actions of alert rule. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -85,26 +86,15 @@ internal ActionsOperations(SecurityInsightsClient client) /// public async Task>> ListByAlertRuleWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string ruleId, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -121,6 +111,10 @@ internal ActionsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -295,7 +289,8 @@ internal ActionsOperations(SecurityInsightsClient client) /// Gets the action of alert rule. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -329,26 +324,15 @@ internal ActionsOperations(SecurityInsightsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string ruleId, string actionId, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -365,6 +349,10 @@ internal ActionsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -545,7 +533,8 @@ internal ActionsOperations(SecurityInsightsClient client) /// Creates or updates the action of alert rule. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -582,26 +571,15 @@ internal ActionsOperations(SecurityInsightsClient client) /// public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string ruleId, string actionId, ActionRequest action, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -618,6 +596,10 @@ internal ActionsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -831,7 +813,8 @@ internal ActionsOperations(SecurityInsightsClient client) /// Delete the action of alert rule. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -862,26 +845,15 @@ internal ActionsOperations(SecurityInsightsClient client) /// public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string ruleId, string actionId, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -898,6 +870,10 @@ internal ActionsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ActionsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ActionsOperationsExtensions.cs index acea07a714f04..2d58d876af271 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ActionsOperationsExtensions.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ActionsOperationsExtensions.cs @@ -28,7 +28,8 @@ public static partial class ActionsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -48,7 +49,8 @@ public static IPage ListByAlertRule(this IActionsOperations oper /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -74,7 +76,8 @@ public static IPage ListByAlertRule(this IActionsOperations oper /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -97,7 +100,8 @@ public static ActionResponse Get(this IActionsOperations operations, string reso /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -126,7 +130,8 @@ public static ActionResponse Get(this IActionsOperations operations, string reso /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -152,7 +157,8 @@ public static ActionResponse CreateOrUpdate(this IActionsOperations operations, /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -184,7 +190,8 @@ public static ActionResponse CreateOrUpdate(this IActionsOperations operations, /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -207,7 +214,8 @@ public static void Delete(this IActionsOperations operations, string resourceGro /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. 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 f17c3df4d9fca..f7c4e5f1d8e1e 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRuleTemplatesOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRuleTemplatesOperations.cs @@ -54,7 +54,8 @@ internal AlertRuleTemplatesOperations(SecurityInsightsClient client) /// Gets all alert rule templates. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -82,26 +83,15 @@ internal AlertRuleTemplatesOperations(SecurityInsightsClient client) /// 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -118,6 +108,10 @@ internal AlertRuleTemplatesOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -286,7 +280,8 @@ internal AlertRuleTemplatesOperations(SecurityInsightsClient client) /// Gets the alert rule template. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -317,26 +312,15 @@ internal AlertRuleTemplatesOperations(SecurityInsightsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string alertRuleTemplateId, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -353,6 +337,10 @@ internal AlertRuleTemplatesOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRuleTemplatesOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRuleTemplatesOperationsExtensions.cs index fdd5d9d5f7e8c..8db2e5377500c 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRuleTemplatesOperationsExtensions.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRuleTemplatesOperationsExtensions.cs @@ -28,7 +28,8 @@ public static partial class AlertRuleTemplatesOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -45,7 +46,8 @@ public static IPage List(this IAlertRuleTemplatesOperations o /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -68,7 +70,8 @@ public static IPage List(this IAlertRuleTemplatesOperations o /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -88,7 +91,8 @@ public static AlertRuleTemplate Get(this IAlertRuleTemplatesOperations operation /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. 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 a0fef971c4042..81b3fcd83e961 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRulesOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRulesOperations.cs @@ -54,7 +54,8 @@ internal AlertRulesOperations(SecurityInsightsClient client) /// Gets all alert rules. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -82,26 +83,15 @@ internal AlertRulesOperations(SecurityInsightsClient client) /// 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -118,6 +108,10 @@ internal AlertRulesOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -286,7 +280,8 @@ internal AlertRulesOperations(SecurityInsightsClient client) /// Gets the alert rule. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -317,26 +312,15 @@ internal AlertRulesOperations(SecurityInsightsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string ruleId, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -353,6 +337,10 @@ internal AlertRulesOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -527,7 +515,8 @@ internal AlertRulesOperations(SecurityInsightsClient client) /// Creates or updates the alert rule. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -561,26 +550,15 @@ internal AlertRulesOperations(SecurityInsightsClient client) /// public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string ruleId, AlertRule alertRule, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -597,6 +575,10 @@ internal AlertRulesOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -800,7 +782,8 @@ internal AlertRulesOperations(SecurityInsightsClient client) /// Delete the alert rule. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -828,26 +811,15 @@ internal AlertRulesOperations(SecurityInsightsClient client) /// public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string ruleId, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -864,6 +836,10 @@ internal AlertRulesOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRulesOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRulesOperationsExtensions.cs index a6cb51c14cabe..9aa94cc42f9dd 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRulesOperationsExtensions.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRulesOperationsExtensions.cs @@ -28,7 +28,8 @@ public static partial class AlertRulesOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -45,7 +46,8 @@ public static IPage List(this IAlertRulesOperations operations, strin /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -68,7 +70,8 @@ public static IPage List(this IAlertRulesOperations operations, strin /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -88,7 +91,8 @@ public static AlertRule Get(this IAlertRulesOperations operations, string resour /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -114,7 +118,8 @@ public static AlertRule Get(this IAlertRulesOperations operations, string resour /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -137,7 +142,8 @@ public static AlertRule CreateOrUpdate(this IAlertRulesOperations operations, st /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -166,7 +172,8 @@ public static AlertRule CreateOrUpdate(this IAlertRulesOperations operations, st /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -186,7 +193,8 @@ public static void Delete(this IAlertRulesOperations operations, string resource /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AutomationRulesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AutomationRulesOperations.cs deleted file mode 100644 index 9349b9a661b72..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AutomationRulesOperations.cs +++ /dev/null @@ -1,1197 +0,0 @@ -// -// 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; - - /// - /// AutomationRulesOperations operations. - /// - internal partial class AutomationRulesOperations : IServiceOperations, IAutomationRulesOperations - { - /// - /// Initializes a new instance of the AutomationRulesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal AutomationRulesOperations(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 automation rules. - /// - /// - /// 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/automationRules").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 automation rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Automation rule 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 automationRuleId, 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 (automationRuleId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "automationRuleId"); - } - // 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("automationRuleId", automationRuleId); - 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/automationRules/{automationRuleId}").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("{automationRuleId}", System.Uri.EscapeDataString(automationRuleId)); - 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 automation rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Automation rule ID - /// - /// - /// The automation rule - /// - /// - /// 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 automationRuleId, AutomationRule automationRule, 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 (automationRuleId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "automationRuleId"); - } - if (automationRule == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "automationRule"); - } - if (automationRule != null) - { - automationRule.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("automationRuleId", automationRuleId); - tracingParameters.Add("automationRule", automationRule); - 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/automationRules/{automationRuleId}").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("{automationRuleId}", System.Uri.EscapeDataString(automationRuleId)); - 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(automationRule != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(automationRule, 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 automation rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Automation rule ID - /// - /// - /// 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 automationRuleId, 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 (automationRuleId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "automationRuleId"); - } - // 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("automationRuleId", automationRuleId); - 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/automationRules/{automationRuleId}").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("{automationRuleId}", System.Uri.EscapeDataString(automationRuleId)); - 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 automation rules. - /// - /// - /// 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/AutomationRulesOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AutomationRulesOperationsExtensions.cs deleted file mode 100644 index 6ec53c6c198b1..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AutomationRulesOperationsExtensions.cs +++ /dev/null @@ -1,240 +0,0 @@ -// -// 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 AutomationRulesOperations. - /// - public static partial class AutomationRulesOperationsExtensions - { - /// - /// Gets all automation rules. - /// - /// - /// 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 IAutomationRulesOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } - - /// - /// Gets all automation rules. - /// - /// - /// 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 IAutomationRulesOperations 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 automation rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Automation rule ID - /// - public static AutomationRule Get(this IAutomationRulesOperations operations, string resourceGroupName, string workspaceName, string automationRuleId) - { - return operations.GetAsync(resourceGroupName, workspaceName, automationRuleId).GetAwaiter().GetResult(); - } - - /// - /// Gets the automation rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Automation rule ID - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IAutomationRulesOperations operations, string resourceGroupName, string workspaceName, string automationRuleId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, automationRuleId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates the automation rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Automation rule ID - /// - /// - /// The automation rule - /// - public static AutomationRule CreateOrUpdate(this IAutomationRulesOperations operations, string resourceGroupName, string workspaceName, string automationRuleId, AutomationRule automationRule) - { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, automationRuleId, automationRule).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates the automation rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Automation rule ID - /// - /// - /// The automation rule - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IAutomationRulesOperations operations, string resourceGroupName, string workspaceName, string automationRuleId, AutomationRule automationRule, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, automationRuleId, automationRule, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete the automation rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Automation rule ID - /// - public static void Delete(this IAutomationRulesOperations operations, string resourceGroupName, string workspaceName, string automationRuleId) - { - operations.DeleteAsync(resourceGroupName, workspaceName, automationRuleId).GetAwaiter().GetResult(); - } - - /// - /// Delete the automation rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Automation rule ID - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IAutomationRulesOperations operations, string resourceGroupName, string workspaceName, string automationRuleId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, automationRuleId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets all automation rules. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IAutomationRulesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all automation rules. - /// - /// - /// 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 IAutomationRulesOperations 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/BookmarkOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkOperations.cs deleted file mode 100644 index 8fa86232487fd..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkOperations.cs +++ /dev/null @@ -1,310 +0,0 @@ -// -// 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; - - /// - /// BookmarkOperations operations. - /// - internal partial class BookmarkOperations : IServiceOperations, IBookmarkOperations - { - /// - /// Initializes a new instance of the BookmarkOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal BookmarkOperations(SecurityInsightsClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityInsightsClient - /// - public SecurityInsightsClient Client { get; private set; } - - /// - /// Expand an bookmark - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// The parameters required to execute an expand operation on the given - /// bookmark. - /// - /// - /// 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> ExpandWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string bookmarkId, BookmarkExpandParameters parameters, 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 (bookmarkId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "bookmarkId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - // 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("bookmarkId", bookmarkId); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Expand", 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/bookmarks/{bookmarkId}/expand").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("{bookmarkId}", System.Uri.EscapeDataString(bookmarkId)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) - { - 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/BookmarkOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkOperationsExtensions.cs deleted file mode 100644 index 510ff0b89b066..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkOperationsExtensions.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -// 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 BookmarkOperations. - /// - public static partial class BookmarkOperationsExtensions - { - /// - /// Expand an bookmark - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// The parameters required to execute an expand operation on the given - /// bookmark. - /// - public static BookmarkExpandResponse Expand(this IBookmarkOperations operations, string resourceGroupName, string workspaceName, string bookmarkId, BookmarkExpandParameters parameters) - { - return operations.ExpandAsync(resourceGroupName, workspaceName, bookmarkId, parameters).GetAwaiter().GetResult(); - } - - /// - /// Expand an bookmark - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// The parameters required to execute an expand operation on the given - /// bookmark. - /// - /// - /// The cancellation token. - /// - public static async Task ExpandAsync(this IBookmarkOperations operations, string resourceGroupName, string workspaceName, string bookmarkId, BookmarkExpandParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ExpandWithHttpMessagesAsync(resourceGroupName, workspaceName, bookmarkId, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkRelationsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkRelationsOperations.cs deleted file mode 100644 index 8e2e841bdba35..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkRelationsOperations.cs +++ /dev/null @@ -1,1262 +0,0 @@ -// -// 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 Microsoft.Rest.Azure.OData; - 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; - - /// - /// BookmarkRelationsOperations operations. - /// - internal partial class BookmarkRelationsOperations : IServiceOperations, IBookmarkRelationsOperations - { - /// - /// Initializes a new instance of the BookmarkRelationsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal BookmarkRelationsOperations(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 bookmark relations. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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 bookmarkId, ODataQuery odataQuery = default(ODataQuery), 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); - } - } - if (bookmarkId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "bookmarkId"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("workspaceName", workspaceName); - tracingParameters.Add("bookmarkId", bookmarkId); - 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/bookmarks/{bookmarkId}/relations").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("{bookmarkId}", System.Uri.EscapeDataString(bookmarkId)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - 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 bookmark relation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// Relation 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 bookmarkId, string relationName, 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 (bookmarkId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "bookmarkId"); - } - if (relationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relationName"); - } - // 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("bookmarkId", bookmarkId); - tracingParameters.Add("relationName", relationName); - 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/bookmarks/{bookmarkId}/relations/{relationName}").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("{bookmarkId}", System.Uri.EscapeDataString(bookmarkId)); - _url = _url.Replace("{relationName}", System.Uri.EscapeDataString(relationName)); - 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 bookmark relation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// Relation Name - /// - /// - /// The resource ID of the related resource - /// - /// - /// Etag of the azure resource - /// - /// - /// 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 bookmarkId, string relationName, string relatedResourceId, string etag = 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); - } - } - if (bookmarkId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "bookmarkId"); - } - if (relationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relationName"); - } - if (relatedResourceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relatedResourceId"); - } - Relation relation = new Relation(); - if (etag != null || relatedResourceId != null) - { - relation.Etag = etag; - relation.RelatedResourceId = relatedResourceId; - } - // 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("bookmarkId", bookmarkId); - tracingParameters.Add("relationName", relationName); - tracingParameters.Add("relation", relation); - 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/bookmarks/{bookmarkId}/relations/{relationName}").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("{bookmarkId}", System.Uri.EscapeDataString(bookmarkId)); - _url = _url.Replace("{relationName}", System.Uri.EscapeDataString(relationName)); - 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(relation != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(relation, 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 bookmark relation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// Relation 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 bookmarkId, string relationName, 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 (bookmarkId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "bookmarkId"); - } - if (relationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relationName"); - } - // 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("bookmarkId", bookmarkId); - tracingParameters.Add("relationName", relationName); - 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/bookmarks/{bookmarkId}/relations/{relationName}").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("{bookmarkId}", System.Uri.EscapeDataString(bookmarkId)); - _url = _url.Replace("{relationName}", System.Uri.EscapeDataString(relationName)); - 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 bookmark relations. - /// - /// - /// 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/BookmarkRelationsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkRelationsOperationsExtensions.cs deleted file mode 100644 index c8e0f576d30b5..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarkRelationsOperationsExtensions.cs +++ /dev/null @@ -1,289 +0,0 @@ -// -// 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 Microsoft.Rest.Azure.OData; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for BookmarkRelationsOperations. - /// - public static partial class BookmarkRelationsOperationsExtensions - { - /// - /// Gets all bookmark relations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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 IBookmarkRelationsOperations operations, string resourceGroupName, string workspaceName, string bookmarkId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) - { - return operations.ListAsync(resourceGroupName, workspaceName, bookmarkId, odataQuery, skipToken).GetAwaiter().GetResult(); - } - - /// - /// Gets all bookmark relations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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 IBookmarkRelationsOperations operations, string resourceGroupName, string workspaceName, string bookmarkId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, bookmarkId, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a bookmark relation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// Relation Name - /// - public static Relation Get(this IBookmarkRelationsOperations operations, string resourceGroupName, string workspaceName, string bookmarkId, string relationName) - { - return operations.GetAsync(resourceGroupName, workspaceName, bookmarkId, relationName).GetAwaiter().GetResult(); - } - - /// - /// Gets a bookmark relation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// Relation Name - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IBookmarkRelationsOperations operations, string resourceGroupName, string workspaceName, string bookmarkId, string relationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, bookmarkId, relationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates the bookmark relation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// Relation Name - /// - /// - /// The resource ID of the related resource - /// - /// - /// Etag of the azure resource - /// - public static Relation CreateOrUpdate(this IBookmarkRelationsOperations operations, string resourceGroupName, string workspaceName, string bookmarkId, string relationName, string relatedResourceId, string etag = default(string)) - { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, bookmarkId, relationName, relatedResourceId, etag).GetAwaiter().GetResult(); - } - - /// - /// Creates the bookmark relation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// Relation Name - /// - /// - /// The resource ID of the related resource - /// - /// - /// Etag of the azure resource - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IBookmarkRelationsOperations operations, string resourceGroupName, string workspaceName, string bookmarkId, string relationName, string relatedResourceId, string etag = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, bookmarkId, relationName, relatedResourceId, etag, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete the bookmark relation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// Relation Name - /// - public static void Delete(this IBookmarkRelationsOperations operations, string resourceGroupName, string workspaceName, string bookmarkId, string relationName) - { - operations.DeleteAsync(resourceGroupName, workspaceName, bookmarkId, relationName).GetAwaiter().GetResult(); - } - - /// - /// Delete the bookmark relation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// Relation Name - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IBookmarkRelationsOperations operations, string resourceGroupName, string workspaceName, string bookmarkId, string relationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, bookmarkId, relationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets all bookmark relations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IBookmarkRelationsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all bookmark relations. - /// - /// - /// 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 IBookmarkRelationsOperations 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/BookmarksOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarksOperations.cs index 6448169b72188..d5543ca885972 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarksOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarksOperations.cs @@ -54,7 +54,8 @@ internal BookmarksOperations(SecurityInsightsClient client) /// Gets all bookmarks. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -82,26 +83,15 @@ internal BookmarksOperations(SecurityInsightsClient client) /// 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -118,6 +108,10 @@ internal BookmarksOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -286,7 +280,8 @@ internal BookmarksOperations(SecurityInsightsClient client) /// Gets a bookmark. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -317,26 +312,15 @@ internal BookmarksOperations(SecurityInsightsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string bookmarkId, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -353,6 +337,10 @@ internal BookmarksOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -527,7 +515,8 @@ internal BookmarksOperations(SecurityInsightsClient client) /// Creates or updates the bookmark. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -561,26 +550,15 @@ internal BookmarksOperations(SecurityInsightsClient client) /// public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string bookmarkId, Bookmark bookmark, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -597,6 +575,10 @@ internal BookmarksOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -804,7 +786,8 @@ internal BookmarksOperations(SecurityInsightsClient client) /// Delete the bookmark. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -832,26 +815,15 @@ internal BookmarksOperations(SecurityInsightsClient client) /// public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string bookmarkId, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -868,6 +840,10 @@ internal BookmarksOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarksOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarksOperationsExtensions.cs index 1a35080305131..00b4bf29cc5ad 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarksOperationsExtensions.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/BookmarksOperationsExtensions.cs @@ -28,7 +28,8 @@ public static partial class BookmarksOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -45,7 +46,8 @@ public static IPage List(this IBookmarksOperations operations, string /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -68,7 +70,8 @@ public static IPage List(this IBookmarksOperations operations, string /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -88,7 +91,8 @@ public static Bookmark Get(this IBookmarksOperations operations, string resource /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -114,7 +118,8 @@ public static Bookmark Get(this IBookmarksOperations operations, string resource /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -137,7 +142,8 @@ public static Bookmark CreateOrUpdate(this IBookmarksOperations operations, stri /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -166,7 +172,8 @@ public static Bookmark CreateOrUpdate(this IBookmarksOperations operations, stri /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -186,7 +193,8 @@ public static void Delete(this IBookmarksOperations operations, string resourceG /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsCheckRequirementsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsCheckRequirementsOperations.cs deleted file mode 100644 index dc2808839a068..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsCheckRequirementsOperations.cs +++ /dev/null @@ -1,300 +0,0 @@ -// -// 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; - - /// - /// DataConnectorsCheckRequirementsOperations operations. - /// - internal partial class DataConnectorsCheckRequirementsOperations : IServiceOperations, IDataConnectorsCheckRequirementsOperations - { - /// - /// Initializes a new instance of the DataConnectorsCheckRequirementsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal DataConnectorsCheckRequirementsOperations(SecurityInsightsClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityInsightsClient - /// - public SecurityInsightsClient Client { get; private set; } - - /// - /// Get requirements state for a data connector type. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The parameters for requirements check message - /// - /// - /// 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> PostWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataConnectorsCheckRequirements dataConnectorsCheckRequirements, 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 (dataConnectorsCheckRequirements == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dataConnectorsCheckRequirements"); - } - // 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("dataConnectorsCheckRequirements", dataConnectorsCheckRequirements); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Post", 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/dataConnectorsCheckRequirements").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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(dataConnectorsCheckRequirements != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(dataConnectorsCheckRequirements, 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) - { - 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/DataConnectorsCheckRequirementsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsCheckRequirementsOperationsExtensions.cs deleted file mode 100644 index 39c8150de1954..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsCheckRequirementsOperationsExtensions.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// 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 DataConnectorsCheckRequirementsOperations. - /// - public static partial class DataConnectorsCheckRequirementsOperationsExtensions - { - /// - /// Get requirements state for a data connector type. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The parameters for requirements check message - /// - public static DataConnectorRequirementsState Post(this IDataConnectorsCheckRequirementsOperations operations, string resourceGroupName, string workspaceName, DataConnectorsCheckRequirements dataConnectorsCheckRequirements) - { - return operations.PostAsync(resourceGroupName, workspaceName, dataConnectorsCheckRequirements).GetAwaiter().GetResult(); - } - - /// - /// Get requirements state for a data connector type. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The parameters for requirements check message - /// - /// - /// The cancellation token. - /// - public static async Task PostAsync(this IDataConnectorsCheckRequirementsOperations operations, string resourceGroupName, string workspaceName, DataConnectorsCheckRequirements dataConnectorsCheckRequirements, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.PostWithHttpMessagesAsync(resourceGroupName, workspaceName, dataConnectorsCheckRequirements, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} 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 9a8435f958dbf..bd4235e711488 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsOperations.cs @@ -54,7 +54,8 @@ internal DataConnectorsOperations(SecurityInsightsClient client) /// Gets all data connectors. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -82,26 +83,15 @@ internal DataConnectorsOperations(SecurityInsightsClient client) /// 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -118,6 +108,10 @@ internal DataConnectorsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -286,7 +280,8 @@ internal DataConnectorsOperations(SecurityInsightsClient client) /// Gets a data connector. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -317,26 +312,15 @@ internal DataConnectorsOperations(SecurityInsightsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataConnectorId, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -353,6 +337,10 @@ internal DataConnectorsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -527,7 +515,8 @@ internal DataConnectorsOperations(SecurityInsightsClient client) /// Creates or updates the data connector. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -561,26 +550,15 @@ internal DataConnectorsOperations(SecurityInsightsClient client) /// public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataConnectorId, DataConnector dataConnector, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -597,6 +575,10 @@ internal DataConnectorsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -800,7 +782,8 @@ internal DataConnectorsOperations(SecurityInsightsClient client) /// Delete the data connector. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -828,26 +811,15 @@ internal DataConnectorsOperations(SecurityInsightsClient client) /// public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataConnectorId, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -864,6 +836,10 @@ internal DataConnectorsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -1016,450 +992,6 @@ internal DataConnectorsOperations(SecurityInsightsClient client) return _result; } - /// - /// Connects a data connector. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Connector ID - /// - /// - /// The data connector - /// - /// - /// 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 ConnectWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataConnectorId, DataConnectorConnectBody connectBody, 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 (dataConnectorId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dataConnectorId"); - } - if (connectBody == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "connectBody"); - } - // 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("dataConnectorId", dataConnectorId); - tracingParameters.Add("connectBody", connectBody); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Connect", 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/dataConnectors/{dataConnectorId}/connect").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("{dataConnectorId}", System.Uri.EscapeDataString(dataConnectorId)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(connectBody != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(connectBody, 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) - { - 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; - } - - /// - /// Disconnect a data connector. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Connector ID - /// - /// - /// 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 DisconnectWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataConnectorId, 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 (dataConnectorId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "dataConnectorId"); - } - // 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("dataConnectorId", dataConnectorId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Disconnect", 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/dataConnectors/{dataConnectorId}/disconnect").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("{dataConnectorId}", System.Uri.EscapeDataString(dataConnectorId)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new 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 data connectors. /// diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsOperationsExtensions.cs index d82bdfccd72cc..63790d1dae244 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsOperationsExtensions.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DataConnectorsOperationsExtensions.cs @@ -28,7 +28,8 @@ public static partial class DataConnectorsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -45,7 +46,8 @@ public static IPage List(this IDataConnectorsOperations operation /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -68,7 +70,8 @@ public static IPage List(this IDataConnectorsOperations operation /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -88,7 +91,8 @@ public static DataConnector Get(this IDataConnectorsOperations operations, strin /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -114,7 +118,8 @@ public static DataConnector Get(this IDataConnectorsOperations operations, strin /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -137,7 +142,8 @@ public static DataConnector CreateOrUpdate(this IDataConnectorsOperations operat /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -166,7 +172,8 @@ public static DataConnector CreateOrUpdate(this IDataConnectorsOperations operat /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -186,7 +193,8 @@ public static void Delete(this IDataConnectorsOperations operations, string reso /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -202,98 +210,6 @@ public static void Delete(this IDataConnectorsOperations operations, string reso (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataConnectorId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// Connects a data connector. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Connector ID - /// - /// - /// The data connector - /// - public static void Connect(this IDataConnectorsOperations operations, string resourceGroupName, string workspaceName, string dataConnectorId, DataConnectorConnectBody connectBody) - { - operations.ConnectAsync(resourceGroupName, workspaceName, dataConnectorId, connectBody).GetAwaiter().GetResult(); - } - - /// - /// Connects a data connector. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Connector ID - /// - /// - /// The data connector - /// - /// - /// The cancellation token. - /// - public static async Task ConnectAsync(this IDataConnectorsOperations operations, string resourceGroupName, string workspaceName, string dataConnectorId, DataConnectorConnectBody connectBody, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.ConnectWithHttpMessagesAsync(resourceGroupName, workspaceName, dataConnectorId, connectBody, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Disconnect a data connector. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Connector ID - /// - public static void Disconnect(this IDataConnectorsOperations operations, string resourceGroupName, string workspaceName, string dataConnectorId) - { - operations.DisconnectAsync(resourceGroupName, workspaceName, dataConnectorId).GetAwaiter().GetResult(); - } - - /// - /// Disconnect a data connector. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Connector ID - /// - /// - /// The cancellation token. - /// - public static async Task DisconnectAsync(this IDataConnectorsOperations operations, string resourceGroupName, string workspaceName, string dataConnectorId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DisconnectWithHttpMessagesAsync(resourceGroupName, workspaceName, dataConnectorId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - /// /// 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 deleted file mode 100644 index 4e8e6ef93d310..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DomainWhoisOperations.cs +++ /dev/null @@ -1,278 +0,0 @@ -// -// 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; - - /// - /// DomainWhoisOperations operations. - /// - internal partial class DomainWhoisOperations : IServiceOperations, IDomainWhoisOperations - { - /// - /// Initializes a new instance of the DomainWhoisOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal DomainWhoisOperations(SecurityInsightsClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityInsightsClient - /// - public SecurityInsightsClient Client { get; private set; } - - /// - /// Get whois information for a single domain name - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Domain name to be enriched - /// - /// - /// 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 domain, 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 (domain == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "domain"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("domain", domain); - 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.SecurityInsights/enrichment/domain/whois/").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (domain != null) - { - _queryParameters.Add(string.Format("domain={0}", System.Uri.EscapeDataString(domain))); - } - 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/DomainWhoisOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DomainWhoisOperationsExtensions.cs deleted file mode 100644 index 592a6ba7a9d10..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/DomainWhoisOperationsExtensions.cs +++ /dev/null @@ -1,65 +0,0 @@ -// -// 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 DomainWhoisOperations. - /// - public static partial class DomainWhoisOperationsExtensions - { - /// - /// Get whois information for a single domain name - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Domain name to be enriched - /// - public static EnrichmentDomainWhois Get(this IDomainWhoisOperations operations, string resourceGroupName, string domain) - { - return operations.GetAsync(resourceGroupName, domain).GetAwaiter().GetResult(); - } - - /// - /// Get whois information for a single domain name - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Domain name to be enriched - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IDomainWhoisOperations operations, string resourceGroupName, string domain, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, domain, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesGetTimelineOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesGetTimelineOperations.cs deleted file mode 100644 index a8199a33ed666..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesGetTimelineOperations.cs +++ /dev/null @@ -1,314 +0,0 @@ -// -// 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; - - /// - /// EntitiesGetTimelineOperations operations. - /// - internal partial class EntitiesGetTimelineOperations : IServiceOperations, IEntitiesGetTimelineOperations - { - /// - /// Initializes a new instance of the EntitiesGetTimelineOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal EntitiesGetTimelineOperations(SecurityInsightsClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityInsightsClient - /// - public SecurityInsightsClient Client { get; private set; } - - /// - /// Timeline for an entity. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// The parameters required to execute an timeline operation on the given - /// entity. - /// - /// - /// 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 entityId, EntityTimelineParameters parameters, 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 (entityId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.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("entityId", entityId); - tracingParameters.Add("parameters", parameters); - 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/entities/{entityId}/getTimeline").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("{entityId}", System.Uri.EscapeDataString(entityId)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) - { - 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/EntitiesGetTimelineOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesGetTimelineOperationsExtensions.cs deleted file mode 100644 index 4c85c68a6dfab..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesGetTimelineOperationsExtensions.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -// 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 EntitiesGetTimelineOperations. - /// - public static partial class EntitiesGetTimelineOperationsExtensions - { - /// - /// Timeline for an entity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// The parameters required to execute an timeline operation on the given - /// entity. - /// - public static EntityTimelineResponse List(this IEntitiesGetTimelineOperations operations, string resourceGroupName, string workspaceName, string entityId, EntityTimelineParameters parameters) - { - return operations.ListAsync(resourceGroupName, workspaceName, entityId, parameters).GetAwaiter().GetResult(); - } - - /// - /// Timeline for an entity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// The parameters required to execute an timeline operation on the given - /// entity. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IEntitiesGetTimelineOperations operations, string resourceGroupName, string workspaceName, string entityId, EntityTimelineParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, entityId, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesOperations.cs deleted file mode 100644 index 887590e35c205..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesOperations.cs +++ /dev/null @@ -1,1461 +0,0 @@ -// -// 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; - - /// - /// EntitiesOperations operations. - /// - internal partial class EntitiesOperations : IServiceOperations, IEntitiesOperations - { - /// - /// Initializes a new instance of the EntitiesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal EntitiesOperations(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 entities. - /// - /// - /// 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/entities").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 an entity. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity 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 entityId, 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 (entityId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityId"); - } - // 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("entityId", entityId); - 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/entities/{entityId}").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("{entityId}", System.Uri.EscapeDataString(entityId)); - 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; - } - - /// - /// Expands an entity. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// The parameters required to execute an expand operation on the given entity. - /// - /// - /// 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> ExpandWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string entityId, EntityExpandParameters parameters, 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 (entityId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - // 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("entityId", entityId); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Expand", 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/entities/{entityId}/expand").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("{entityId}", System.Uri.EscapeDataString(entityId)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get Insights and Activities for an entity. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity 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> QueriesWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string entityId, 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 (entityId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityId"); - } - string kind = "Insight"; - // 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("entityId", entityId); - tracingParameters.Add("kind", kind); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Queries", 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/entities/{entityId}/queries").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("{entityId}", System.Uri.EscapeDataString(entityId)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (kind != null) - { - _queryParameters.Add(string.Format("kind={0}", System.Uri.EscapeDataString(kind))); - } - 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; - } - - /// - /// Execute Insights for an entity. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// The parameters required to execute insights on the given entity. - /// - /// - /// 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> GetInsightsWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string entityId, EntityGetInsightsParameters parameters, 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 (entityId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.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("entityId", entityId); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetInsights", 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/entities/{entityId}/getInsights").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("{entityId}", System.Uri.EscapeDataString(entityId)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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) - { - 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 all entities. - /// - /// - /// 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/EntitiesOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesOperationsExtensions.cs deleted file mode 100644 index 945be484aa608..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesOperationsExtensions.cs +++ /dev/null @@ -1,295 +0,0 @@ -// -// 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 EntitiesOperations. - /// - public static partial class EntitiesOperationsExtensions - { - /// - /// Gets all entities. - /// - /// - /// 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 IEntitiesOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } - - /// - /// Gets all entities. - /// - /// - /// 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 IEntitiesOperations 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 an entity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - public static Entity Get(this IEntitiesOperations operations, string resourceGroupName, string workspaceName, string entityId) - { - return operations.GetAsync(resourceGroupName, workspaceName, entityId).GetAwaiter().GetResult(); - } - - /// - /// Gets an entity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IEntitiesOperations operations, string resourceGroupName, string workspaceName, string entityId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, entityId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Expands an entity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// The parameters required to execute an expand operation on the given entity. - /// - public static EntityExpandResponse Expand(this IEntitiesOperations operations, string resourceGroupName, string workspaceName, string entityId, EntityExpandParameters parameters) - { - return operations.ExpandAsync(resourceGroupName, workspaceName, entityId, parameters).GetAwaiter().GetResult(); - } - - /// - /// Expands an entity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// The parameters required to execute an expand operation on the given entity. - /// - /// - /// The cancellation token. - /// - public static async Task ExpandAsync(this IEntitiesOperations operations, string resourceGroupName, string workspaceName, string entityId, EntityExpandParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ExpandWithHttpMessagesAsync(resourceGroupName, workspaceName, entityId, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get Insights and Activities for an entity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - public static GetQueriesResponse Queries(this IEntitiesOperations operations, string resourceGroupName, string workspaceName, string entityId) - { - return operations.QueriesAsync(resourceGroupName, workspaceName, entityId).GetAwaiter().GetResult(); - } - - /// - /// Get Insights and Activities for an entity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// The cancellation token. - /// - public static async Task QueriesAsync(this IEntitiesOperations operations, string resourceGroupName, string workspaceName, string entityId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.QueriesWithHttpMessagesAsync(resourceGroupName, workspaceName, entityId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Execute Insights for an entity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// The parameters required to execute insights on the given entity. - /// - public static EntityGetInsightsResponse GetInsights(this IEntitiesOperations operations, string resourceGroupName, string workspaceName, string entityId, EntityGetInsightsParameters parameters) - { - return operations.GetInsightsAsync(resourceGroupName, workspaceName, entityId, parameters).GetAwaiter().GetResult(); - } - - /// - /// Execute Insights for an entity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// The parameters required to execute insights on the given entity. - /// - /// - /// The cancellation token. - /// - public static async Task GetInsightsAsync(this IEntitiesOperations operations, string resourceGroupName, string workspaceName, string entityId, EntityGetInsightsParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetInsightsWithHttpMessagesAsync(resourceGroupName, workspaceName, entityId, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all entities. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IEntitiesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all entities. - /// - /// - /// 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 IEntitiesOperations 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/EntitiesRelationsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesRelationsOperations.cs deleted file mode 100644 index 6c37b03fc81f9..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesRelationsOperations.cs +++ /dev/null @@ -1,492 +0,0 @@ -// -// 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 Microsoft.Rest.Azure.OData; - 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; - - /// - /// EntitiesRelationsOperations operations. - /// - internal partial class EntitiesRelationsOperations : IServiceOperations, IEntitiesRelationsOperations - { - /// - /// Initializes a new instance of the EntitiesRelationsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal EntitiesRelationsOperations(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 relations of an entity. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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 entityId, ODataQuery odataQuery = default(ODataQuery), 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); - } - } - if (entityId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityId"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("workspaceName", workspaceName); - tracingParameters.Add("entityId", entityId); - 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/entities/{entityId}/relations").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("{entityId}", System.Uri.EscapeDataString(entityId)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - 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 all relations of an entity. - /// - /// - /// 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/EntitiesRelationsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesRelationsOperationsExtensions.cs deleted file mode 100644 index 9ccf2101ec47b..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntitiesRelationsOperationsExtensions.cs +++ /dev/null @@ -1,124 +0,0 @@ -// -// 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 Microsoft.Rest.Azure.OData; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for EntitiesRelationsOperations. - /// - public static partial class EntitiesRelationsOperationsExtensions - { - /// - /// Gets all relations of an entity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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 IEntitiesRelationsOperations operations, string resourceGroupName, string workspaceName, string entityId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) - { - return operations.ListAsync(resourceGroupName, workspaceName, entityId, odataQuery, skipToken).GetAwaiter().GetResult(); - } - - /// - /// Gets all relations of an entity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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 IEntitiesRelationsOperations operations, string resourceGroupName, string workspaceName, string entityId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, entityId, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all relations of an entity. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IEntitiesRelationsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all relations of an entity. - /// - /// - /// 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 IEntitiesRelationsOperations 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/EntityQueriesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueriesOperations.cs deleted file mode 100644 index b15302ace52c4..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueriesOperations.cs +++ /dev/null @@ -1,1202 +0,0 @@ -// -// 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; - - /// - /// EntityQueriesOperations operations. - /// - internal partial class EntityQueriesOperations : IServiceOperations, IEntityQueriesOperations - { - /// - /// Initializes a new instance of the EntityQueriesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal EntityQueriesOperations(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 entity queries. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The entity query kind we want to fetch. Possible values include: - /// 'Expansion', 'Activity' - /// - /// - /// 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 kind = 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("kind", kind); - 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/entityQueries").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 (kind != null) - { - _queryParameters.Add(string.Format("kind={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(kind, Client.SerializationSettings).Trim('"')))); - } - 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 an entity query. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query 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 entityQueryId, 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 (entityQueryId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityQueryId"); - } - // 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("entityQueryId", entityQueryId); - 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/entityQueries/{entityQueryId}").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("{entityQueryId}", System.Uri.EscapeDataString(entityQueryId)); - 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 entity query. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query ID - /// - /// - /// The entity query we want to create or update - /// - /// - /// 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 entityQueryId, CustomEntityQuery entityQuery, 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 (entityQueryId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityQueryId"); - } - if (entityQuery == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityQuery"); - } - // 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("entityQueryId", entityQueryId); - tracingParameters.Add("entityQuery", entityQuery); - 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/entityQueries/{entityQueryId}").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("{entityQueryId}", System.Uri.EscapeDataString(entityQueryId)); - 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(entityQuery != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(entityQuery, 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 entity query. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query ID - /// - /// - /// 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 entityQueryId, 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 (entityQueryId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityQueryId"); - } - // 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("entityQueryId", entityQueryId); - 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/entityQueries/{entityQueryId}").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("{entityQueryId}", System.Uri.EscapeDataString(entityQueryId)); - 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 entity queries. - /// - /// - /// 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/EntityQueriesOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueriesOperationsExtensions.cs deleted file mode 100644 index b84201f7531ef..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueriesOperationsExtensions.cs +++ /dev/null @@ -1,248 +0,0 @@ -// -// 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 EntityQueriesOperations. - /// - public static partial class EntityQueriesOperationsExtensions - { - /// - /// Gets all entity queries. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The entity query kind we want to fetch. Possible values include: - /// 'Expansion', 'Activity' - /// - public static IPage List(this IEntityQueriesOperations operations, string resourceGroupName, string workspaceName, string kind = default(string)) - { - return operations.ListAsync(resourceGroupName, workspaceName, kind).GetAwaiter().GetResult(); - } - - /// - /// Gets all entity queries. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The entity query kind we want to fetch. Possible values include: - /// 'Expansion', 'Activity' - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IEntityQueriesOperations operations, string resourceGroupName, string workspaceName, string kind = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, kind, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets an entity query. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query ID - /// - public static EntityQuery Get(this IEntityQueriesOperations operations, string resourceGroupName, string workspaceName, string entityQueryId) - { - return operations.GetAsync(resourceGroupName, workspaceName, entityQueryId).GetAwaiter().GetResult(); - } - - /// - /// Gets an entity query. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query ID - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IEntityQueriesOperations operations, string resourceGroupName, string workspaceName, string entityQueryId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, entityQueryId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates the entity query. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query ID - /// - /// - /// The entity query we want to create or update - /// - public static EntityQuery CreateOrUpdate(this IEntityQueriesOperations operations, string resourceGroupName, string workspaceName, string entityQueryId, CustomEntityQuery entityQuery) - { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, entityQueryId, entityQuery).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates the entity query. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query ID - /// - /// - /// The entity query we want to create or update - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IEntityQueriesOperations operations, string resourceGroupName, string workspaceName, string entityQueryId, CustomEntityQuery entityQuery, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, entityQueryId, entityQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete the entity query. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query ID - /// - public static void Delete(this IEntityQueriesOperations operations, string resourceGroupName, string workspaceName, string entityQueryId) - { - operations.DeleteAsync(resourceGroupName, workspaceName, entityQueryId).GetAwaiter().GetResult(); - } - - /// - /// Delete the entity query. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query ID - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IEntityQueriesOperations operations, string resourceGroupName, string workspaceName, string entityQueryId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, entityQueryId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets all entity queries. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IEntityQueriesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all entity queries. - /// - /// - /// 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 IEntityQueriesOperations 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/EntityQueryTemplatesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueryTemplatesOperations.cs deleted file mode 100644 index 2b0938cb95f2d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueryTemplatesOperations.cs +++ /dev/null @@ -1,709 +0,0 @@ -// -// 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; - - /// - /// EntityQueryTemplatesOperations operations. - /// - internal partial class EntityQueryTemplatesOperations : IServiceOperations, IEntityQueryTemplatesOperations - { - /// - /// Initializes a new instance of the EntityQueryTemplatesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal EntityQueryTemplatesOperations(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 entity query templates. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The entity template query kind we want to fetch. Possible values include: - /// 'Activity' - /// - /// - /// 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 kind = 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("kind", kind); - 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/entityQueryTemplates").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 (kind != null) - { - _queryParameters.Add(string.Format("kind={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(kind, Client.SerializationSettings).Trim('"')))); - } - 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 an entity query. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query template 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 entityQueryTemplateId, 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 (entityQueryTemplateId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityQueryTemplateId"); - } - // 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("entityQueryTemplateId", entityQueryTemplateId); - 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/entityQueryTemplates/{entityQueryTemplateId}").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("{entityQueryTemplateId}", System.Uri.EscapeDataString(entityQueryTemplateId)); - 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 all entity query templates. - /// - /// - /// 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/EntityQueryTemplatesOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueryTemplatesOperationsExtensions.cs deleted file mode 100644 index fd670bd827f41..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityQueryTemplatesOperationsExtensions.cs +++ /dev/null @@ -1,153 +0,0 @@ -// -// 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 EntityQueryTemplatesOperations. - /// - public static partial class EntityQueryTemplatesOperationsExtensions - { - /// - /// Gets all entity query templates. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The entity template query kind we want to fetch. Possible values include: - /// 'Activity' - /// - public static IPage List(this IEntityQueryTemplatesOperations operations, string resourceGroupName, string workspaceName, string kind = default(string)) - { - return operations.ListAsync(resourceGroupName, workspaceName, kind).GetAwaiter().GetResult(); - } - - /// - /// Gets all entity query templates. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The entity template query kind we want to fetch. Possible values include: - /// 'Activity' - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IEntityQueryTemplatesOperations operations, string resourceGroupName, string workspaceName, string kind = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, kind, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets an entity query. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query template ID - /// - public static EntityQueryTemplate Get(this IEntityQueryTemplatesOperations operations, string resourceGroupName, string workspaceName, string entityQueryTemplateId) - { - return operations.GetAsync(resourceGroupName, workspaceName, entityQueryTemplateId).GetAwaiter().GetResult(); - } - - /// - /// Gets an entity query. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query template ID - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IEntityQueryTemplatesOperations operations, string resourceGroupName, string workspaceName, string entityQueryTemplateId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, entityQueryTemplateId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all entity query templates. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IEntityQueryTemplatesOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all entity query templates. - /// - /// - /// 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 IEntityQueryTemplatesOperations 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/EntityRelationsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityRelationsOperations.cs deleted file mode 100644 index 0dcd0ca2c60bb..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityRelationsOperations.cs +++ /dev/null @@ -1,304 +0,0 @@ -// -// 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; - - /// - /// EntityRelationsOperations operations. - /// - internal partial class EntityRelationsOperations : IServiceOperations, IEntityRelationsOperations - { - /// - /// Initializes a new instance of the EntityRelationsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal EntityRelationsOperations(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 an entity relation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// Relation 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> GetRelationWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string entityId, string relationName, 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 (entityId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "entityId"); - } - if (relationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relationName"); - } - // 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("entityId", entityId); - tracingParameters.Add("relationName", relationName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetRelation", 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/entities/{entityId}/relations/{relationName}").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("{entityId}", System.Uri.EscapeDataString(entityId)); - _url = _url.Replace("{relationName}", System.Uri.EscapeDataString(relationName)); - 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; - } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityRelationsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityRelationsOperationsExtensions.cs deleted file mode 100644 index ce9a35a4a2fd3..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/EntityRelationsOperationsExtensions.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -// 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 EntityRelationsOperations. - /// - public static partial class EntityRelationsOperationsExtensions - { - /// - /// Gets an entity relation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// Relation Name - /// - public static Relation GetRelation(this IEntityRelationsOperations operations, string resourceGroupName, string workspaceName, string entityId, string relationName) - { - return operations.GetRelationAsync(resourceGroupName, workspaceName, entityId, relationName).GetAwaiter().GetResult(); - } - - /// - /// Gets an entity relation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// Relation Name - /// - /// - /// The cancellation token. - /// - public static async Task GetRelationAsync(this IEntityRelationsOperations operations, string resourceGroupName, string workspaceName, string entityId, string relationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetRelationWithHttpMessagesAsync(resourceGroupName, workspaceName, entityId, relationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IActionsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IActionsOperations.cs index f404b7abdebd6..f42d11eaf67f9 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IActionsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IActionsOperations.cs @@ -27,7 +27,8 @@ public partial interface IActionsOperations /// Gets all actions of alert rule. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -55,7 +56,8 @@ public partial interface IActionsOperations /// Gets the action of alert rule. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -86,7 +88,8 @@ public partial interface IActionsOperations /// Creates or updates the action of alert rule. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -120,7 +123,8 @@ public partial interface IActionsOperations /// Delete the action of alert rule. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IAlertRuleTemplatesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IAlertRuleTemplatesOperations.cs index f004ecd61df61..0ad2eb676cff9 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IAlertRuleTemplatesOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IAlertRuleTemplatesOperations.cs @@ -27,7 +27,8 @@ public partial interface IAlertRuleTemplatesOperations /// Gets all alert rule templates. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -52,7 +53,8 @@ public partial interface IAlertRuleTemplatesOperations /// Gets the alert rule template. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IAlertRulesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IAlertRulesOperations.cs index e2a0fb3c27452..cf07ca8d976fa 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IAlertRulesOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IAlertRulesOperations.cs @@ -27,7 +27,8 @@ public partial interface IAlertRulesOperations /// Gets all alert rules. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -52,7 +53,8 @@ public partial interface IAlertRulesOperations /// Gets the alert rule. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -80,7 +82,8 @@ public partial interface IAlertRulesOperations /// Creates or updates the alert rule. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -111,7 +114,8 @@ public partial interface IAlertRulesOperations /// Delete the alert rule. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IAutomationRulesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IAutomationRulesOperations.cs deleted file mode 100644 index c0a65056b9e39..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IAutomationRulesOperations.cs +++ /dev/null @@ -1,158 +0,0 @@ -// -// 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; - - /// - /// AutomationRulesOperations operations. - /// - public partial interface IAutomationRulesOperations - { - /// - /// Gets all automation rules. - /// - /// - /// 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 automation rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Automation rule 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 automationRuleId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates the automation rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Automation rule ID - /// - /// - /// The automation rule - /// - /// - /// 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 automationRuleId, AutomationRule automationRule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete the automation rule. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Automation rule ID - /// - /// - /// 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 automationRuleId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all automation rules. - /// - /// - /// 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/IBookmarkOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IBookmarkOperations.cs deleted file mode 100644 index 5e888c72e2465..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IBookmarkOperations.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// 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; - - /// - /// BookmarkOperations operations. - /// - public partial interface IBookmarkOperations - { - /// - /// Expand an bookmark - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// The parameters required to execute an expand operation on the given - /// bookmark. - /// - /// - /// 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> ExpandWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string bookmarkId, BookmarkExpandParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IBookmarkRelationsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IBookmarkRelationsOperations.cs deleted file mode 100644 index 6c5a2d2bb1da3..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IBookmarkRelationsOperations.cs +++ /dev/null @@ -1,184 +0,0 @@ -// -// 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 Microsoft.Rest.Azure.OData; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// BookmarkRelationsOperations operations. - /// - public partial interface IBookmarkRelationsOperations - { - /// - /// Gets all bookmark relations. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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 bookmarkId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a bookmark relation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// Relation 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 bookmarkId, string relationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates the bookmark relation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// Relation Name - /// - /// - /// The resource ID of the related resource - /// - /// - /// Etag of the azure resource - /// - /// - /// 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 bookmarkId, string relationName, string relatedResourceId, string etag = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete the bookmark relation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Bookmark ID - /// - /// - /// Relation 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 bookmarkId, string relationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all bookmark relations. - /// - /// - /// 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/IBookmarksOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IBookmarksOperations.cs index acda2e8484a35..13d1d9379a05e 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IBookmarksOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IBookmarksOperations.cs @@ -27,7 +27,8 @@ public partial interface IBookmarksOperations /// Gets all bookmarks. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -52,7 +53,8 @@ public partial interface IBookmarksOperations /// Gets a bookmark. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -80,7 +82,8 @@ public partial interface IBookmarksOperations /// Creates or updates the bookmark. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -111,7 +114,8 @@ public partial interface IBookmarksOperations /// Delete the bookmark. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IDataConnectorsCheckRequirementsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IDataConnectorsCheckRequirementsOperations.cs deleted file mode 100644 index 0046fdadc774c..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IDataConnectorsCheckRequirementsOperations.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// 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; - - /// - /// DataConnectorsCheckRequirementsOperations operations. - /// - public partial interface IDataConnectorsCheckRequirementsOperations - { - /// - /// Get requirements state for a data connector type. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The parameters for requirements check message - /// - /// - /// 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> PostWithHttpMessagesAsync(string resourceGroupName, string workspaceName, DataConnectorsCheckRequirements dataConnectorsCheckRequirements, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IDataConnectorsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IDataConnectorsOperations.cs index fdcb66d7941bf..22ae7053616e8 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IDataConnectorsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IDataConnectorsOperations.cs @@ -27,7 +27,8 @@ public partial interface IDataConnectorsOperations /// Gets all data connectors. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -52,7 +53,8 @@ public partial interface IDataConnectorsOperations /// Gets a data connector. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -80,7 +82,8 @@ public partial interface IDataConnectorsOperations /// Creates or updates the data connector. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -111,7 +114,8 @@ public partial interface IDataConnectorsOperations /// Delete the data connector. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -133,59 +137,6 @@ public partial interface IDataConnectorsOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataConnectorId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Connects a data connector. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Connector ID - /// - /// - /// The data connector - /// - /// - /// 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 ConnectWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataConnectorId, DataConnectorConnectBody connectBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Disconnect a data connector. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Connector ID - /// - /// - /// 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 DisconnectWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataConnectorId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all data connectors. /// /// diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IDomainWhoisOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IDomainWhoisOperations.cs deleted file mode 100644 index 973e79f84f89a..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IDomainWhoisOperations.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// 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; - - /// - /// DomainWhoisOperations operations. - /// - public partial interface IDomainWhoisOperations - { - /// - /// Get whois information for a single domain name - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// Domain name to be enriched - /// - /// - /// 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 domain, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IEntitiesGetTimelineOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IEntitiesGetTimelineOperations.cs deleted file mode 100644 index a44caf37e1fa8..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IEntitiesGetTimelineOperations.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// 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; - - /// - /// EntitiesGetTimelineOperations operations. - /// - public partial interface IEntitiesGetTimelineOperations - { - /// - /// Timeline for an entity. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// The parameters required to execute an timeline operation on the - /// given entity. - /// - /// - /// 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 entityId, EntityTimelineParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IEntitiesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IEntitiesOperations.cs deleted file mode 100644 index a124a9ada8279..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IEntitiesOperations.cs +++ /dev/null @@ -1,193 +0,0 @@ -// -// 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; - - /// - /// EntitiesOperations operations. - /// - public partial interface IEntitiesOperations - { - /// - /// Gets all entities. - /// - /// - /// 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 an entity. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity 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 entityId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Expands an entity. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// The parameters required to execute an expand operation on the given - /// entity. - /// - /// - /// 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> ExpandWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string entityId, EntityExpandParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get Insights and Activities for an entity. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity 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> QueriesWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string entityId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Execute Insights for an entity. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// The parameters required to execute insights on the given entity. - /// - /// - /// 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> GetInsightsWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string entityId, EntityGetInsightsParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all entities. - /// - /// - /// 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/IEntitiesRelationsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IEntitiesRelationsOperations.cs deleted file mode 100644 index f4b99d294269b..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IEntitiesRelationsOperations.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// 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 Microsoft.Rest.Azure.OData; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// EntitiesRelationsOperations operations. - /// - public partial interface IEntitiesRelationsOperations - { - /// - /// Gets all relations of an entity. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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 entityId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all relations of an entity. - /// - /// - /// 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/IEntityQueriesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IEntityQueriesOperations.cs deleted file mode 100644 index 06e5a5ffd4ebf..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IEntityQueriesOperations.cs +++ /dev/null @@ -1,162 +0,0 @@ -// -// 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; - - /// - /// EntityQueriesOperations operations. - /// - public partial interface IEntityQueriesOperations - { - /// - /// Gets all entity queries. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The entity query kind we want to fetch. Possible values include: - /// 'Expansion', 'Activity' - /// - /// - /// 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 kind = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets an entity query. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query 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 entityQueryId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates the entity query. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query ID - /// - /// - /// The entity query we want to create or update - /// - /// - /// 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 entityQueryId, CustomEntityQuery entityQuery, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete the entity query. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query ID - /// - /// - /// 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 entityQueryId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all entity queries. - /// - /// - /// 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/IEntityQueryTemplatesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IEntityQueryTemplatesOperations.cs deleted file mode 100644 index f4227ba5d6a14..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IEntityQueryTemplatesOperations.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -// 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; - - /// - /// EntityQueryTemplatesOperations operations. - /// - public partial interface IEntityQueryTemplatesOperations - { - /// - /// Gets all entity query templates. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The entity template query kind we want to fetch. Possible values - /// include: 'Activity' - /// - /// - /// 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 kind = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets an entity query. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity query template 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 entityQueryTemplateId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all entity query templates. - /// - /// - /// 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/IEntityRelationsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IEntityRelationsOperations.cs deleted file mode 100644 index 2327e9e21585a..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IEntityRelationsOperations.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// 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; - - /// - /// EntityRelationsOperations operations. - /// - public partial interface IEntityRelationsOperations - { - /// - /// Gets an entity relation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// entity ID - /// - /// - /// Relation 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> GetRelationWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string entityId, string relationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIPGeodataOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIPGeodataOperations.cs deleted file mode 100644 index 2976916878e57..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIPGeodataOperations.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// 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; - - /// - /// IPGeodataOperations operations. - /// - public partial interface IIPGeodataOperations - { - /// - /// Get geodata for a single IP address - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// IP address (v4 or v6) to be enriched - /// - /// - /// 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 ipAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIncidentCommentsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIncidentCommentsOperations.cs index 106eec83a124e..b631e37547e1e 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIncidentCommentsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIncidentCommentsOperations.cs @@ -28,7 +28,8 @@ public partial interface IIncidentCommentsOperations /// Gets all incident comments. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -61,12 +62,13 @@ public partial interface IIncidentCommentsOperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByIncidentWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets an incident comment. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -94,10 +96,11 @@ public partial interface IIncidentCommentsOperations /// Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, string incidentCommentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates the incident comment. + /// Creates the incident comment. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -111,9 +114,6 @@ public partial interface IIncidentCommentsOperations /// /// The comment message /// - /// - /// Etag of the azure resource - /// /// /// The headers that will be added to request. /// @@ -129,35 +129,7 @@ public partial interface IIncidentCommentsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, string incidentCommentId, string message, string etag = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete the incident comment. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Incident comment ID - /// - /// - /// 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 incidentId, string incidentCommentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateCommentWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, string incidentCommentId, string message, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets all incident comments. /// @@ -179,6 +151,6 @@ public partial interface IIncidentCommentsOperations /// /// Thrown when a required parameter is null /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByIncidentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIncidentRelationsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIncidentRelationsOperations.cs deleted file mode 100644 index cb998bfce8c3e..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIncidentRelationsOperations.cs +++ /dev/null @@ -1,184 +0,0 @@ -// -// 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 Microsoft.Rest.Azure.OData; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// IncidentRelationsOperations operations. - /// - public partial interface IIncidentRelationsOperations - { - /// - /// Gets all incident relations. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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 incidentId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets an incident relation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Relation 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 incidentId, string relationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates the incident relation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Relation Name - /// - /// - /// The resource ID of the related resource - /// - /// - /// Etag of the azure resource - /// - /// - /// 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 incidentId, string relationName, string relatedResourceId, string etag = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete the incident relation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Relation 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 incidentId, string relationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all incident relations. - /// - /// - /// 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 4c9f9b49e8cfd..ff001b53476e0 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIncidentsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IIncidentsOperations.cs @@ -27,7 +27,8 @@ public partial interface IIncidentsOperations /// Gets all incidents. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -68,7 +69,8 @@ public partial interface IIncidentsOperations /// Gets an incident. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -96,7 +98,8 @@ public partial interface IIncidentsOperations /// Creates or updates the incident. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -127,7 +130,8 @@ public partial interface IIncidentsOperations /// Delete the incident. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. /// /// /// The name of the workspace. @@ -149,122 +153,6 @@ public partial interface IIncidentsOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates a Microsoft team to investigate the incident by sharing - /// information and insights between participants. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Team properties - /// - /// - /// 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> CreateTeamWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, TeamProperties teamProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all incident alerts. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident 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> ListAlertsWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all incident bookmarks. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident 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> ListBookmarksWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all incident related entities. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident 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> ListEntitiesWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Gets all incidents. /// /// diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IMetadataOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IMetadataOperations.cs deleted file mode 100644 index ee00376f1e77c..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IMetadataOperations.cs +++ /dev/null @@ -1,202 +0,0 @@ -// -// 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; - - /// - /// MetadataOperations operations. - /// - public partial interface IMetadataOperations - { - /// - /// List of all metadata - /// - /// - /// 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. - /// - /// - /// Used to skip n elements in the OData query (offset). Returns a - /// nextLink to the next page of results if there are any left. - /// - /// - /// 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?), int? skip = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get a Metadata. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata 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 metadataName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete a Metadata. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata 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 metadataName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Create a Metadata. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata name. - /// - /// - /// Metadata resource. - /// - /// - /// 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 metadataName, MetadataModel metadata, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Update an existing Metadata. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata name. - /// - /// - /// Partial metadata request. - /// - /// - /// 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string metadataName, MetadataPatch metadataPatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// List of all metadata - /// - /// - /// 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/IOfficeConsentsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IOfficeConsentsOperations.cs deleted file mode 100644 index 7240c468adfe5..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IOfficeConsentsOperations.cs +++ /dev/null @@ -1,127 +0,0 @@ -// -// 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; - - /// - /// OfficeConsentsOperations operations. - /// - public partial interface IOfficeConsentsOperations - { - /// - /// Gets all office365 consents. - /// - /// - /// 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 an office365 consent. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// consent 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 consentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete the office365 consent. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// consent ID - /// - /// - /// 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 consentId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all office365 consents. - /// - /// - /// 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/IPGeodataOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IPGeodataOperations.cs deleted file mode 100644 index e1a36829d4b5c..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IPGeodataOperations.cs +++ /dev/null @@ -1,278 +0,0 @@ -// -// 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; - - /// - /// IPGeodataOperations operations. - /// - internal partial class IPGeodataOperations : IServiceOperations, IIPGeodataOperations - { - /// - /// Initializes a new instance of the IPGeodataOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal IPGeodataOperations(SecurityInsightsClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityInsightsClient - /// - public SecurityInsightsClient Client { get; private set; } - - /// - /// Get geodata for a single IP address - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// IP address (v4 or v6) to be enriched - /// - /// - /// 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 ipAddress, 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 (ipAddress == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ipAddress"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("ipAddress", ipAddress); - 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.SecurityInsights/enrichment/ip/geodata/").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (ipAddress != null) - { - _queryParameters.Add(string.Format("ipAddress={0}", System.Uri.EscapeDataString(ipAddress))); - } - 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/IPGeodataOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IPGeodataOperationsExtensions.cs deleted file mode 100644 index 398f6f9cac951..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IPGeodataOperationsExtensions.cs +++ /dev/null @@ -1,65 +0,0 @@ -// -// 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 IPGeodataOperations. - /// - public static partial class IPGeodataOperationsExtensions - { - /// - /// Get geodata for a single IP address - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// IP address (v4 or v6) to be enriched - /// - public static EnrichmentIpGeodata Get(this IIPGeodataOperations operations, string resourceGroupName, string ipAddress) - { - return operations.GetAsync(resourceGroupName, ipAddress).GetAwaiter().GetResult(); - } - - /// - /// Get geodata for a single IP address - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// IP address (v4 or v6) to be enriched - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IIPGeodataOperations operations, string resourceGroupName, string ipAddress, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, ipAddress, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IProductSettingsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IProductSettingsOperations.cs deleted file mode 100644 index 07f6ac3da8edd..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IProductSettingsOperations.cs +++ /dev/null @@ -1,139 +0,0 @@ -// -// 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; - - /// - /// ProductSettingsOperations operations. - /// - public partial interface IProductSettingsOperations - { - /// - /// List of all the 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 a setting. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, - /// Ueba - /// - /// - /// 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 settingsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete setting of the product. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, - /// Ueba - /// - /// - /// 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 settingsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates setting. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, - /// Ueba - /// - /// - /// The 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string settingsName, Settings settings, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISecurityInsightsClient.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISecurityInsightsClient.cs index 27a082817ee66..6ea69098d011d 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISecurityInsightsClient.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISecurityInsightsClient.cs @@ -42,12 +42,12 @@ public partial interface ISecurityInsightsClient : System.IDisposable ServiceClientCredentials Credentials { get; } /// - /// The ID of the target subscription. + /// Azure subscription ID /// string SubscriptionId { get; set; } /// - /// The API version to use for this operation. + /// API version for the operation /// string ApiVersion { get; } @@ -85,150 +85,30 @@ public partial interface ISecurityInsightsClient : System.IDisposable /// IAlertRuleTemplatesOperations AlertRuleTemplates { get; } - /// - /// Gets the IAutomationRulesOperations. - /// - IAutomationRulesOperations AutomationRules { get; } - /// /// Gets the IBookmarksOperations. /// IBookmarksOperations Bookmarks { get; } - /// - /// Gets the IBookmarkRelationsOperations. - /// - IBookmarkRelationsOperations BookmarkRelations { get; } - - /// - /// Gets the IBookmarkOperations. - /// - IBookmarkOperations Bookmark { get; } - - /// - /// Gets the IIPGeodataOperations. - /// - IIPGeodataOperations IPGeodata { get; } - - /// - /// Gets the IDomainWhoisOperations. - /// - IDomainWhoisOperations DomainWhois { get; } - - /// - /// Gets the IEntityQueriesOperations. - /// - IEntityQueriesOperations EntityQueries { get; } - - /// - /// Gets the IEntitiesOperations. - /// - IEntitiesOperations Entities { get; } - - /// - /// Gets the IEntitiesGetTimelineOperations. - /// - IEntitiesGetTimelineOperations EntitiesGetTimeline { get; } - - /// - /// Gets the IEntitiesRelationsOperations. - /// - IEntitiesRelationsOperations EntitiesRelations { get; } - - /// - /// Gets the IEntityRelationsOperations. - /// - IEntityRelationsOperations EntityRelations { get; } - - /// - /// Gets the IIncidentsOperations. - /// - IIncidentsOperations Incidents { get; } - - /// - /// Gets the IIncidentCommentsOperations. - /// - IIncidentCommentsOperations IncidentComments { get; } - - /// - /// Gets the IIncidentRelationsOperations. - /// - IIncidentRelationsOperations IncidentRelations { get; } - - /// - /// Gets the IMetadataOperations. - /// - IMetadataOperations Metadata { get; } - - /// - /// Gets the ISentinelOnboardingStatesOperations. - /// - ISentinelOnboardingStatesOperations SentinelOnboardingStates { get; } - - /// - /// Gets the IProductSettingsOperations. - /// - IProductSettingsOperations ProductSettings { get; } - - /// - /// Gets the ISourceControlOperations. - /// - ISourceControlOperations SourceControl { get; } - - /// - /// Gets the ISourceControlsOperations. - /// - ISourceControlsOperations SourceControls { get; } - - /// - /// Gets the IWatchlistsOperations. - /// - IWatchlistsOperations Watchlists { get; } - - /// - /// Gets the IWatchlistItemsOperations. - /// - IWatchlistItemsOperations WatchlistItems { get; } - /// /// Gets the IDataConnectorsOperations. /// IDataConnectorsOperations DataConnectors { get; } - /// - /// Gets the IDataConnectorsCheckRequirementsOperations. - /// - IDataConnectorsCheckRequirementsOperations DataConnectorsCheckRequirements { get; } - - /// - /// Gets the IThreatIntelligenceIndicatorOperations. - /// - IThreatIntelligenceIndicatorOperations ThreatIntelligenceIndicator { get; } - - /// - /// Gets the IThreatIntelligenceIndicatorsOperations. - /// - IThreatIntelligenceIndicatorsOperations ThreatIntelligenceIndicators { get; } - - /// - /// Gets the IThreatIntelligenceIndicatorMetricsOperations. - /// - IThreatIntelligenceIndicatorMetricsOperations ThreatIntelligenceIndicatorMetrics { get; } - /// /// Gets the IOperations. /// IOperations Operations { get; } /// - /// Gets the IOfficeConsentsOperations. + /// Gets the IIncidentsOperations. /// - IOfficeConsentsOperations OfficeConsents { get; } + IIncidentsOperations Incidents { get; } /// - /// Gets the IEntityQueryTemplatesOperations. + /// Gets the IIncidentCommentsOperations. /// - IEntityQueryTemplatesOperations EntityQueryTemplates { get; } + IIncidentCommentsOperations IncidentComments { get; } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISentinelOnboardingStatesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISentinelOnboardingStatesOperations.cs deleted file mode 100644 index cb94dcb2845d0..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISentinelOnboardingStatesOperations.cs +++ /dev/null @@ -1,139 +0,0 @@ -// -// 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; - - /// - /// SentinelOnboardingStatesOperations operations. - /// - public partial interface ISentinelOnboardingStatesOperations - { - /// - /// Get Sentinel onboarding state - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Sentinel onboarding state name. Supports - default - /// - /// - /// 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 sentinelOnboardingStateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Create Sentinel onboarding state - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Sentinel onboarding state name. Supports - default - /// - /// - /// Etag of the azure resource - /// - /// - /// Flag that indicates the status of the CMK 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> CreateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sentinelOnboardingStateName, string etag = default(string), bool? customerManagedKey = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete Sentinel onboarding state - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Sentinel onboarding state name. Supports - default - /// - /// - /// 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 sentinelOnboardingStateName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all Sentinel onboarding states - /// - /// - /// 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)); - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISourceControlOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISourceControlOperations.cs deleted file mode 100644 index 36b54b12ffb40..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISourceControlOperations.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -// 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; - - /// - /// SourceControlOperations operations. - /// - public partial interface ISourceControlOperations - { - /// - /// Gets a list of repositories metadata. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The repo type. Possible values include: 'Github', 'DevOps' - /// - /// - /// 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>> ListRepositoriesWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string repoType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a list of repositories metadata. - /// - /// - /// 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>> ListRepositoriesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISourceControlsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISourceControlsOperations.cs deleted file mode 100644 index bf036e3388e6a..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ISourceControlsOperations.cs +++ /dev/null @@ -1,158 +0,0 @@ -// -// 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; - - /// - /// SourceControlsOperations operations. - /// - public partial interface ISourceControlsOperations - { - /// - /// Gets all source controls, without source control items. - /// - /// - /// 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 a source control byt its identifier. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Source control 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 sourceControlId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete a source control. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Source control Id - /// - /// - /// 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 sourceControlId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates a source control. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Source control Id - /// - /// - /// The SourceControl - /// - /// - /// 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 sourceControlId, SourceControl sourceControl, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all source controls, without source control items. - /// - /// - /// 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/IThreatIntelligenceIndicatorMetricsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IThreatIntelligenceIndicatorMetricsOperations.cs deleted file mode 100644 index 7dee556751ea8..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IThreatIntelligenceIndicatorMetricsOperations.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// 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; - - /// - /// ThreatIntelligenceIndicatorMetricsOperations operations. - /// - public partial interface IThreatIntelligenceIndicatorMetricsOperations - { - /// - /// Get threat intelligence indicators metrics (Indicators counts by - /// Type, Threat Type, Source). - /// - /// - /// 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)); - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IThreatIntelligenceIndicatorOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IThreatIntelligenceIndicatorOperations.cs deleted file mode 100644 index ae2d6998b4110..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IThreatIntelligenceIndicatorOperations.cs +++ /dev/null @@ -1,248 +0,0 @@ -// -// 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; - - /// - /// ThreatIntelligenceIndicatorOperations operations. - /// - public partial interface IThreatIntelligenceIndicatorOperations - { - /// - /// Create a new threat intelligence indicator. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Properties of threat intelligence indicators to create and update. - /// - /// - /// 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> CreateIndicatorWithHttpMessagesAsync(string resourceGroupName, string workspaceName, ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// View a threat intelligence indicator by name. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// 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 name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Update a threat Intelligence indicator. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// Properties of threat intelligence indicators to create and update. - /// - /// - /// 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 name, ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete a threat intelligence indicator. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// 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 name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Query threat intelligence indicators as per filtering criteria. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Filtering criteria for querying threat intelligence indicators. - /// - /// - /// 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>> QueryIndicatorsWithHttpMessagesAsync(string resourceGroupName, string workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Append tags to a threat intelligence indicator. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// List of tags to be appended. - /// - /// - /// 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 AppendTagsWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string name, IList threatIntelligenceTags = default(IList), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Replace tags added to a threat intelligence indicator. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// Tags in the threat intelligence indicator to be replaced. - /// - /// - /// 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> ReplaceTagsWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string name, ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Query threat intelligence indicators as per filtering criteria. - /// - /// - /// 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>> QueryIndicatorsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IThreatIntelligenceIndicatorsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IThreatIntelligenceIndicatorsOperations.cs deleted file mode 100644 index 8b6f8e4bbbe93..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IThreatIntelligenceIndicatorsOperations.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -// 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; - - /// - /// ThreatIntelligenceIndicatorsOperations operations. - /// - public partial interface IThreatIntelligenceIndicatorsOperations - { - /// - /// Get all threat intelligence indicators. - /// - /// - /// 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)); - /// - /// Get all threat intelligence indicators. - /// - /// - /// 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/IWatchlistItemsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IWatchlistItemsOperations.cs deleted file mode 100644 index c1ba1495ce662..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IWatchlistItemsOperations.cs +++ /dev/null @@ -1,170 +0,0 @@ -// -// 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; - - /// - /// WatchlistItemsOperations operations. - /// - public partial interface IWatchlistItemsOperations - { - /// - /// Gets all watchlist Items. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// 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 watchlistAlias, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets a watchlist, without its watchlist items. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// Watchlist Item Id (GUID) - /// - /// - /// 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 watchlistAlias, string watchlistItemId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete a watchlist item. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// Watchlist Item Id (GUID) - /// - /// - /// 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 watchlistAlias, string watchlistItemId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates a watchlist item. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// Watchlist Item Id (GUID) - /// - /// - /// The watchlist item - /// - /// - /// 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 watchlistAlias, string watchlistItemId, WatchlistItem watchlistItem, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all watchlist Items. - /// - /// - /// 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/IWatchlistsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IWatchlistsOperations.cs deleted file mode 100644 index 0fb9b8cad0696..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IWatchlistsOperations.cs +++ /dev/null @@ -1,161 +0,0 @@ -// -// 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; - - /// - /// WatchlistsOperations operations. - /// - public partial interface IWatchlistsOperations - { - /// - /// Gets all watchlists, without watchlist items. - /// - /// - /// 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 a watchlist, without its watchlist items. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// 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 watchlistAlias, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete a watchlist. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// 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 watchlistAlias, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates or updates a watchlist and its watchlist items (bulk - /// creation, e.g. through text/csv content type). To create a - /// Watchlist and its items, we should call this endpoint with - /// rawContent and contentType properties. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// The watchlist - /// - /// - /// 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 watchlistAlias, Watchlist watchlist, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets all watchlists, without watchlist items. - /// - /// - /// 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 8d71938579691..f41d71bf75ab6 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentCommentsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentCommentsOperations.cs @@ -55,7 +55,8 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) /// Gets all incident comments. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -93,28 +94,17 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByIncidentWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, ODataQuery odataQuery = default(ODataQuery), 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -131,6 +121,10 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -164,7 +158,7 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) tracingParameters.Add("incidentId", incidentId); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByIncident", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -319,7 +313,8 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) /// Gets an incident comment. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -353,26 +348,15 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, string incidentCommentId, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -389,6 +373,10 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -566,10 +554,11 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) } /// - /// Creates or updates the incident comment. + /// Creates the incident comment. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -583,9 +572,6 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) /// /// The comment message /// - /// - /// Etag of the azure resource - /// /// /// Headers that will be added to request. /// @@ -607,28 +593,17 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, string incidentCommentId, string message, string etag = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateCommentWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, string incidentCommentId, string message, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -645,6 +620,10 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -674,9 +653,8 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) throw new ValidationException(ValidationRules.CannotBeNull, "message"); } IncidentComment incidentComment = new IncidentComment(); - if (etag != null || message != null) + if (message != null) { - incidentComment.Etag = etag; incidentComment.Message = message; } // Tracing @@ -692,7 +670,7 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) tracingParameters.Add("incidentCommentId", incidentCommentId); tracingParameters.Add("incidentComment", incidentComment); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateComment", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -771,7 +749,7 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 201) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -814,24 +792,6 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) _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); @@ -856,235 +816,6 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) return _result; } - /// - /// Delete the incident comment. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Incident comment ID - /// - /// - /// 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 incidentId, string incidentCommentId, 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 (incidentId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "incidentId"); - } - if (incidentCommentId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "incidentCommentId"); - } - // 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("incidentId", incidentId); - tracingParameters.Add("incidentCommentId", incidentCommentId); - 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/incidents/{incidentId}/comments/{incidentCommentId}").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("{incidentId}", System.Uri.EscapeDataString(incidentId)); - _url = _url.Replace("{incidentCommentId}", System.Uri.EscapeDataString(incidentCommentId)); - 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 incident comments. /// @@ -1112,7 +843,7 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByIncidentNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1127,7 +858,7 @@ internal IncidentCommentsOperations(SecurityInsightsClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByIncidentNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentCommentsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentCommentsOperationsExtensions.cs index 4092f845a6fb1..753d695eeb08f 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentCommentsOperationsExtensions.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentCommentsOperationsExtensions.cs @@ -29,7 +29,8 @@ public static partial class IncidentCommentsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -46,9 +47,9 @@ public static partial class IncidentCommentsOperationsExtensions /// nextLink element will include a skiptoken parameter that specifies a /// starting point to use for subsequent calls. Optional. /// - public static IPage List(this IIncidentCommentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + public static IPage ListByIncident(this IIncidentCommentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) { - return operations.ListAsync(resourceGroupName, workspaceName, incidentId, odataQuery, skipToken).GetAwaiter().GetResult(); + return operations.ListByIncidentAsync(resourceGroupName, workspaceName, incidentId, odataQuery, skipToken).GetAwaiter().GetResult(); } /// @@ -58,7 +59,8 @@ public static partial class IncidentCommentsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -78,9 +80,9 @@ public static partial class IncidentCommentsOperationsExtensions /// /// The cancellation token. /// - public static async Task> ListAsync(this IIncidentCommentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByIncidentAsync(this IIncidentCommentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentId, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByIncidentWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentId, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -93,7 +95,8 @@ public static partial class IncidentCommentsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -116,7 +119,8 @@ public static IncidentComment Get(this IIncidentCommentsOperations operations, s /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -139,13 +143,14 @@ public static IncidentComment Get(this IIncidentCommentsOperations operations, s } /// - /// Creates or updates the incident comment. + /// Creates the incident comment. /// /// /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -159,22 +164,20 @@ public static IncidentComment Get(this IIncidentCommentsOperations operations, s /// /// The comment message /// - /// - /// Etag of the azure resource - /// - public static IncidentComment CreateOrUpdate(this IIncidentCommentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, string incidentCommentId, string message, string etag = default(string)) + public static IncidentComment CreateComment(this IIncidentCommentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, string incidentCommentId, string message) { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, message, etag).GetAwaiter().GetResult(); + return operations.CreateCommentAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, message).GetAwaiter().GetResult(); } /// - /// Creates or updates the incident comment. + /// Creates the incident comment. /// /// /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -188,69 +191,17 @@ public static IncidentComment Get(this IIncidentCommentsOperations operations, s /// /// The comment message /// - /// - /// Etag of the azure resource - /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IIncidentCommentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, string incidentCommentId, string message, string etag = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateCommentAsync(this IIncidentCommentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, string incidentCommentId, string message, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, message, etag, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateCommentWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, message, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } - /// - /// Delete the incident comment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Incident comment ID - /// - public static void Delete(this IIncidentCommentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, string incidentCommentId) - { - operations.DeleteAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId).GetAwaiter().GetResult(); - } - - /// - /// Delete the incident comment. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Incident comment ID - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IIncidentCommentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, string incidentCommentId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentId, incidentCommentId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - /// /// Gets all incident comments. /// @@ -260,9 +211,9 @@ public static void Delete(this IIncidentCommentsOperations operations, string re /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IIncidentCommentsOperations operations, string nextPageLink) + public static IPage ListByIncidentNext(this IIncidentCommentsOperations operations, string nextPageLink) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByIncidentNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -277,9 +228,9 @@ public static IPage ListNext(this IIncidentCommentsOperations o /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IIncidentCommentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByIncidentNextAsync(this IIncidentCommentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByIncidentNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentRelationsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentRelationsOperations.cs deleted file mode 100644 index 8420c69cd761d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentRelationsOperations.cs +++ /dev/null @@ -1,1262 +0,0 @@ -// -// 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 Microsoft.Rest.Azure.OData; - 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; - - /// - /// IncidentRelationsOperations operations. - /// - internal partial class IncidentRelationsOperations : IServiceOperations, IIncidentRelationsOperations - { - /// - /// Initializes a new instance of the IncidentRelationsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal IncidentRelationsOperations(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 incident relations. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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 incidentId, ODataQuery odataQuery = default(ODataQuery), 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); - } - } - if (incidentId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "incidentId"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("workspaceName", workspaceName); - tracingParameters.Add("incidentId", incidentId); - 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/incidents/{incidentId}/relations").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("{incidentId}", System.Uri.EscapeDataString(incidentId)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - 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 an incident relation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Relation 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 incidentId, string relationName, 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 (incidentId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "incidentId"); - } - if (relationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relationName"); - } - // 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("incidentId", incidentId); - tracingParameters.Add("relationName", relationName); - 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/incidents/{incidentId}/relations/{relationName}").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("{incidentId}", System.Uri.EscapeDataString(incidentId)); - _url = _url.Replace("{relationName}", System.Uri.EscapeDataString(relationName)); - 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 incident relation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Relation Name - /// - /// - /// The resource ID of the related resource - /// - /// - /// Etag of the azure resource - /// - /// - /// 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 incidentId, string relationName, string relatedResourceId, string etag = 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); - } - } - if (incidentId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "incidentId"); - } - if (relationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relationName"); - } - if (relatedResourceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relatedResourceId"); - } - Relation relation = new Relation(); - if (etag != null || relatedResourceId != null) - { - relation.Etag = etag; - relation.RelatedResourceId = relatedResourceId; - } - // 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("incidentId", incidentId); - tracingParameters.Add("relationName", relationName); - tracingParameters.Add("relation", relation); - 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/incidents/{incidentId}/relations/{relationName}").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("{incidentId}", System.Uri.EscapeDataString(incidentId)); - _url = _url.Replace("{relationName}", System.Uri.EscapeDataString(relationName)); - 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(relation != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(relation, 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 incident relation. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Relation 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 incidentId, string relationName, 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 (incidentId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "incidentId"); - } - if (relationName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "relationName"); - } - // 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("incidentId", incidentId); - tracingParameters.Add("relationName", relationName); - 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/incidents/{incidentId}/relations/{relationName}").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("{incidentId}", System.Uri.EscapeDataString(incidentId)); - _url = _url.Replace("{relationName}", System.Uri.EscapeDataString(relationName)); - 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 incident relations. - /// - /// - /// 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/IncidentRelationsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentRelationsOperationsExtensions.cs deleted file mode 100644 index 55b7fcf2aa7d7..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentRelationsOperationsExtensions.cs +++ /dev/null @@ -1,289 +0,0 @@ -// -// 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 Microsoft.Rest.Azure.OData; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for IncidentRelationsOperations. - /// - public static partial class IncidentRelationsOperationsExtensions - { - /// - /// Gets all incident relations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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 IIncidentRelationsOperations operations, string resourceGroupName, string workspaceName, string incidentId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) - { - return operations.ListAsync(resourceGroupName, workspaceName, incidentId, odataQuery, skipToken).GetAwaiter().GetResult(); - } - - /// - /// Gets all incident relations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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 IIncidentRelationsOperations operations, string resourceGroupName, string workspaceName, string incidentId, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentId, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets an incident relation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Relation Name - /// - public static Relation Get(this IIncidentRelationsOperations operations, string resourceGroupName, string workspaceName, string incidentId, string relationName) - { - return operations.GetAsync(resourceGroupName, workspaceName, incidentId, relationName).GetAwaiter().GetResult(); - } - - /// - /// Gets an incident relation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Relation Name - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IIncidentRelationsOperations operations, string resourceGroupName, string workspaceName, string incidentId, string relationName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentId, relationName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Creates or updates the incident relation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Relation Name - /// - /// - /// The resource ID of the related resource - /// - /// - /// Etag of the azure resource - /// - public static Relation CreateOrUpdate(this IIncidentRelationsOperations operations, string resourceGroupName, string workspaceName, string incidentId, string relationName, string relatedResourceId, string etag = default(string)) - { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, incidentId, relationName, relatedResourceId, etag).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates the incident relation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Relation Name - /// - /// - /// The resource ID of the related resource - /// - /// - /// Etag of the azure resource - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IIncidentRelationsOperations operations, string resourceGroupName, string workspaceName, string incidentId, string relationName, string relatedResourceId, string etag = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentId, relationName, relatedResourceId, etag, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete the incident relation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Relation Name - /// - public static void Delete(this IIncidentRelationsOperations operations, string resourceGroupName, string workspaceName, string incidentId, string relationName) - { - operations.DeleteAsync(resourceGroupName, workspaceName, incidentId, relationName).GetAwaiter().GetResult(); - } - - /// - /// Delete the incident relation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Relation Name - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IIncidentRelationsOperations operations, string resourceGroupName, string workspaceName, string incidentId, string relationName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentId, relationName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets all incident relations. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IIncidentRelationsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all incident relations. - /// - /// - /// 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 IIncidentRelationsOperations 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/IncidentsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentsOperations.cs index 207a7a572ed30..ce19d6fbf1998 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentsOperations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentsOperations.cs @@ -54,7 +54,8 @@ internal IncidentsOperations(SecurityInsightsClient client) /// Gets all incidents. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -97,26 +98,15 @@ internal IncidentsOperations(SecurityInsightsClient client) /// 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -133,6 +123,10 @@ internal IncidentsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -321,7 +315,8 @@ internal IncidentsOperations(SecurityInsightsClient client) /// Gets an incident. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -352,26 +347,15 @@ internal IncidentsOperations(SecurityInsightsClient client) /// public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -388,6 +372,10 @@ internal IncidentsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -562,7 +550,8 @@ internal IncidentsOperations(SecurityInsightsClient client) /// Creates or updates the incident. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -596,26 +585,15 @@ internal IncidentsOperations(SecurityInsightsClient client) /// public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, Incident incident, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -632,6 +610,10 @@ internal IncidentsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -839,7 +821,8 @@ internal IncidentsOperations(SecurityInsightsClient client) /// Delete the incident. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -867,26 +850,15 @@ internal IncidentsOperations(SecurityInsightsClient client) /// public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, 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) + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); } } if (resourceGroupName == null) @@ -903,6 +875,10 @@ internal IncidentsOperations(SecurityInsightsClient client) { throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } } if (workspaceName == null) { @@ -1055,989 +1031,6 @@ internal IncidentsOperations(SecurityInsightsClient client) return _result; } - /// - /// Creates a Microsoft team to investigate the incident by sharing information - /// and insights between participants. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Team properties - /// - /// - /// 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> CreateTeamWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, TeamProperties teamProperties, 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 (incidentId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "incidentId"); - } - if (teamProperties == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "teamProperties"); - } - if (teamProperties != null) - { - teamProperties.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("incidentId", incidentId); - tracingParameters.Add("teamProperties", teamProperties); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateTeam", 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/incidents/{incidentId}/createTeam").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("{incidentId}", System.Uri.EscapeDataString(incidentId)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(teamProperties != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(teamProperties, 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) - { - 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 all incident alerts. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident 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> ListAlertsWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, 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 (incidentId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "incidentId"); - } - // 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("incidentId", incidentId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAlerts", 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/incidents/{incidentId}/alerts").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("{incidentId}", System.Uri.EscapeDataString(incidentId)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // 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 all incident bookmarks. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident 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> ListBookmarksWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, 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 (incidentId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "incidentId"); - } - // 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("incidentId", incidentId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBookmarks", 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/incidents/{incidentId}/bookmarks").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("{incidentId}", System.Uri.EscapeDataString(incidentId)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // 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 all incident related entities. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident 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> ListEntitiesWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string incidentId, 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 (incidentId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "incidentId"); - } - // 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("incidentId", incidentId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListEntities", 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/incidents/{incidentId}/entities").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("{incidentId}", System.Uri.EscapeDataString(incidentId)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // 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 all incidents. /// 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 62860986030b3..0a6828e63fefc 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentsOperationsExtensions.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/IncidentsOperationsExtensions.cs @@ -28,7 +28,8 @@ public static partial class IncidentsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -60,7 +61,8 @@ public static partial class IncidentsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -98,7 +100,8 @@ public static partial class IncidentsOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -118,7 +121,8 @@ public static Incident Get(this IIncidentsOperations operations, string resource /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -144,7 +148,8 @@ public static Incident Get(this IIncidentsOperations operations, string resource /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -167,7 +172,8 @@ public static Incident CreateOrUpdate(this IIncidentsOperations operations, stri /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -196,7 +202,8 @@ public static Incident CreateOrUpdate(this IIncidentsOperations operations, stri /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -216,7 +223,8 @@ public static void Delete(this IIncidentsOperations operations, string resourceG /// The operations group for this extension method. /// /// - /// The name of the resource group. The name is case insensitive. + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. /// /// /// The name of the workspace. @@ -232,198 +240,6 @@ public static void Delete(this IIncidentsOperations operations, string resourceG (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// Creates a Microsoft team to investigate the incident by sharing information - /// and insights between participants. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Team properties - /// - public static TeamInformation CreateTeam(this IIncidentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, TeamProperties teamProperties) - { - return operations.CreateTeamAsync(resourceGroupName, workspaceName, incidentId, teamProperties).GetAwaiter().GetResult(); - } - - /// - /// Creates a Microsoft team to investigate the incident by sharing information - /// and insights between participants. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// Team properties - /// - /// - /// The cancellation token. - /// - public static async Task CreateTeamAsync(this IIncidentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, TeamProperties teamProperties, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateTeamWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentId, teamProperties, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all incident alerts. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - public static IncidentAlertList ListAlerts(this IIncidentsOperations operations, string resourceGroupName, string workspaceName, string incidentId) - { - return operations.ListAlertsAsync(resourceGroupName, workspaceName, incidentId).GetAwaiter().GetResult(); - } - - /// - /// Gets all incident alerts. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// The cancellation token. - /// - public static async Task ListAlertsAsync(this IIncidentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAlertsWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all incident bookmarks. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - public static IncidentBookmarkList ListBookmarks(this IIncidentsOperations operations, string resourceGroupName, string workspaceName, string incidentId) - { - return operations.ListBookmarksAsync(resourceGroupName, workspaceName, incidentId).GetAwaiter().GetResult(); - } - - /// - /// Gets all incident bookmarks. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// The cancellation token. - /// - public static async Task ListBookmarksAsync(this IIncidentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBookmarksWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all incident related entities. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - public static IncidentEntitiesResponse ListEntities(this IIncidentsOperations operations, string resourceGroupName, string workspaceName, string incidentId) - { - return operations.ListEntitiesAsync(resourceGroupName, workspaceName, incidentId).GetAwaiter().GetResult(); - } - - /// - /// Gets all incident related entities. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Incident ID - /// - /// - /// The cancellation token. - /// - public static async Task ListEntitiesAsync(this IIncidentsOperations operations, string resourceGroupName, string workspaceName, string incidentId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListEntitiesWithHttpMessagesAsync(resourceGroupName, workspaceName, incidentId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Gets all incidents. /// diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/MetadataOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/MetadataOperations.cs deleted file mode 100644 index fa9c23e4bcf0b..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/MetadataOperations.cs +++ /dev/null @@ -1,1485 +0,0 @@ -// -// 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; - - /// - /// MetadataOperations operations. - /// - internal partial class MetadataOperations : IServiceOperations, IMetadataOperations - { - /// - /// Initializes a new instance of the MetadataOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal MetadataOperations(SecurityInsightsClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityInsightsClient - /// - public SecurityInsightsClient Client { get; private set; } - - /// - /// List of all metadata - /// - /// - /// 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. - /// - /// - /// Used to skip n elements in the OData query (offset). Returns a nextLink to - /// the next page of results if there are any left. - /// - /// - /// 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?), int? skip = default(int?), 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("skip", skip); - 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/metadata").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 (skip != null) - { - _queryParameters.Add(string.Format("$skip={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(skip, Client.SerializationSettings).Trim('"')))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get a Metadata. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata 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 metadataName, 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 (metadataName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "metadataName"); - } - // 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("metadataName", metadataName); - 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/metadata/{metadataName}").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("{metadataName}", System.Uri.EscapeDataString(metadataName)); - 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; - } - - /// - /// Delete a Metadata. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata 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 metadataName, 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 (metadataName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "metadataName"); - } - // 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("metadataName", metadataName); - 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/metadata/{metadataName}").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("{metadataName}", System.Uri.EscapeDataString(metadataName)); - 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; - } - - /// - /// Create a Metadata. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata name. - /// - /// - /// Metadata resource. - /// - /// - /// 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 metadataName, MetadataModel metadata, 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 (metadataName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "metadataName"); - } - if (metadata == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "metadata"); - } - if (metadata != null) - { - metadata.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("metadataName", metadataName); - tracingParameters.Add("metadata", metadata); - 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/metadata/{metadataName}").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("{metadataName}", System.Uri.EscapeDataString(metadataName)); - 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(metadata != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(metadata, 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; - } - - /// - /// Update an existing Metadata. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata name. - /// - /// - /// Partial metadata request. - /// - /// - /// 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string metadataName, MetadataPatch metadataPatch, 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 (metadataName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "metadataName"); - } - if (metadataPatch == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "metadataPatch"); - } - // 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("metadataName", metadataName); - tracingParameters.Add("metadataPatch", metadataPatch); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", 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/metadata/{metadataName}").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("{metadataName}", System.Uri.EscapeDataString(metadataName)); - 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("PATCH"); - _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(metadataPatch != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(metadataPatch, 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) - { - 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; - } - - /// - /// List of all metadata - /// - /// - /// 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/MetadataOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/MetadataOperationsExtensions.cs deleted file mode 100644 index 3216145a08533..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/MetadataOperationsExtensions.cs +++ /dev/null @@ -1,318 +0,0 @@ -// -// 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 MetadataOperations. - /// - public static partial class MetadataOperationsExtensions - { - /// - /// List of all metadata - /// - /// - /// 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. - /// - /// - /// Used to skip n elements in the OData query (offset). Returns a nextLink to - /// the next page of results if there are any left. - /// - public static IPage List(this IMetadataOperations operations, string resourceGroupName, string workspaceName, string filter = default(string), string orderby = default(string), int? top = default(int?), int? skip = default(int?)) - { - return operations.ListAsync(resourceGroupName, workspaceName, filter, orderby, top, skip).GetAwaiter().GetResult(); - } - - /// - /// List of all metadata - /// - /// - /// 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. - /// - /// - /// Used to skip n elements in the OData query (offset). Returns a nextLink to - /// the next page of results if there are any left. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IMetadataOperations operations, string resourceGroupName, string workspaceName, string filter = default(string), string orderby = default(string), int? top = default(int?), int? skip = default(int?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, filter, orderby, top, skip, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get a Metadata. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata name. - /// - public static MetadataModel Get(this IMetadataOperations operations, string resourceGroupName, string workspaceName, string metadataName) - { - return operations.GetAsync(resourceGroupName, workspaceName, metadataName).GetAwaiter().GetResult(); - } - - /// - /// Get a Metadata. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata name. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IMetadataOperations operations, string resourceGroupName, string workspaceName, string metadataName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, metadataName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete a Metadata. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata name. - /// - public static void Delete(this IMetadataOperations operations, string resourceGroupName, string workspaceName, string metadataName) - { - operations.DeleteAsync(resourceGroupName, workspaceName, metadataName).GetAwaiter().GetResult(); - } - - /// - /// Delete a Metadata. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata name. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IMetadataOperations operations, string resourceGroupName, string workspaceName, string metadataName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, metadataName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Create a Metadata. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata name. - /// - /// - /// Metadata resource. - /// - public static MetadataModel Create(this IMetadataOperations operations, string resourceGroupName, string workspaceName, string metadataName, MetadataModel metadata) - { - return operations.CreateAsync(resourceGroupName, workspaceName, metadataName, metadata).GetAwaiter().GetResult(); - } - - /// - /// Create a Metadata. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata name. - /// - /// - /// Metadata resource. - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IMetadataOperations operations, string resourceGroupName, string workspaceName, string metadataName, MetadataModel metadata, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, workspaceName, metadataName, metadata, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update an existing Metadata. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata name. - /// - /// - /// Partial metadata request. - /// - public static MetadataModel Update(this IMetadataOperations operations, string resourceGroupName, string workspaceName, string metadataName, MetadataPatch metadataPatch) - { - return operations.UpdateAsync(resourceGroupName, workspaceName, metadataName, metadataPatch).GetAwaiter().GetResult(); - } - - /// - /// Update an existing Metadata. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Metadata name. - /// - /// - /// Partial metadata request. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IMetadataOperations operations, string resourceGroupName, string workspaceName, string metadataName, MetadataPatch metadataPatch, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, metadataName, metadataPatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List of all metadata - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IMetadataOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List of all metadata - /// - /// - /// 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 IMetadataOperations 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/Models/AADCheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AADCheckRequirements.cs deleted file mode 100644 index 0e22351790dd4..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AADCheckRequirements.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents AAD (Azure Active Directory) requirements check request. - /// - [Newtonsoft.Json.JsonObject("AzureActiveDirectory")] - [Rest.Serialization.JsonTransformation] - public partial class AADCheckRequirements : DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the AADCheckRequirements class. - /// - public AADCheckRequirements() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AADCheckRequirements class. - /// - /// The tenant id to connect to, and get the - /// data from. - public AADCheckRequirements(string tenantId) - { - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AADDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AADDataConnector.cs index 1502d8f7844fb..d820cf3585077 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AADDataConnector.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AADDataConnector.cs @@ -33,21 +33,16 @@ public AADDataConnector() /// /// Initializes a new instance of the AADDataConnector class. /// + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Etag of the azure resource /// The tenant id to connect to, and get the /// data from. - /// 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 available data types for the /// connector. - public AADDataConnector(string tenantId, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), AlertsDataTypeOfDataConnector dataTypes = default(AlertsDataTypeOfDataConnector)) - : base(id, name, type, systemData, etag) + public AADDataConnector(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string tenantId = default(string), AlertsDataTypeOfDataConnector dataTypes = default(AlertsDataTypeOfDataConnector)) + : base(id, name, type, etag) { TenantId = tenantId; DataTypes = dataTypes; @@ -71,22 +66,5 @@ public AADDataConnector() [JsonProperty(PropertyName = "properties.dataTypes")] public AlertsDataTypeOfDataConnector DataTypes { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - if (DataTypes != null) - { - DataTypes.Validate(); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AATPCheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AATPCheckRequirements.cs deleted file mode 100644 index 8a131fbe25e57..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AATPCheckRequirements.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents AATP (Azure Advanced Threat Protection) requirements check - /// request. - /// - [Newtonsoft.Json.JsonObject("AzureAdvancedThreatProtection")] - [Rest.Serialization.JsonTransformation] - public partial class AATPCheckRequirements : DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the AATPCheckRequirements class. - /// - public AATPCheckRequirements() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AATPCheckRequirements class. - /// - /// The tenant id to connect to, and get the - /// data from. - public AATPCheckRequirements(string tenantId) - { - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AATPDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AATPDataConnector.cs index c53d16bdb6163..f9c73a8b99f92 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AATPDataConnector.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AATPDataConnector.cs @@ -33,21 +33,16 @@ public AATPDataConnector() /// /// Initializes a new instance of the AATPDataConnector class. /// + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Etag of the azure resource /// The tenant id to connect to, and get the /// data from. - /// 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 available data types for the /// connector. - public AATPDataConnector(string tenantId, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), AlertsDataTypeOfDataConnector dataTypes = default(AlertsDataTypeOfDataConnector)) - : base(id, name, type, systemData, etag) + public AATPDataConnector(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string tenantId = default(string), AlertsDataTypeOfDataConnector dataTypes = default(AlertsDataTypeOfDataConnector)) + : base(id, name, type, etag) { TenantId = tenantId; DataTypes = dataTypes; @@ -71,22 +66,5 @@ public AATPDataConnector() [JsonProperty(PropertyName = "properties.dataTypes")] public AlertsDataTypeOfDataConnector DataTypes { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - if (DataTypes != null) - { - DataTypes.Validate(); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ASCCheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ASCCheckRequirements.cs deleted file mode 100644 index 167c786fb229c..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ASCCheckRequirements.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents ASC (Azure Security Center) requirements check request. - /// - [Newtonsoft.Json.JsonObject("AzureSecurityCenter")] - [Rest.Serialization.JsonTransformation] - public partial class ASCCheckRequirements : DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the ASCCheckRequirements class. - /// - public ASCCheckRequirements() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ASCCheckRequirements class. - /// - /// The subscription id to connect to, and - /// get the data from. - public ASCCheckRequirements(string subscriptionId = default(string)) - { - SubscriptionId = subscriptionId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the subscription id to connect to, and get the data - /// from. - /// - [JsonProperty(PropertyName = "properties.subscriptionId")] - public string SubscriptionId { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ASCDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ASCDataConnector.cs index 8aa1fbd95fd4b..b0885c94718dd 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ASCDataConnector.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ASCDataConnector.cs @@ -33,21 +33,16 @@ public ASCDataConnector() /// /// Initializes a new instance of the ASCDataConnector 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. + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// Etag of the azure resource /// The available data types for the /// connector. /// The subscription id to connect to, and /// get the data from. - public ASCDataConnector(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), AlertsDataTypeOfDataConnector dataTypes = default(AlertsDataTypeOfDataConnector), string subscriptionId = default(string)) - : base(id, name, type, systemData, etag) + public ASCDataConnector(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), AlertsDataTypeOfDataConnector dataTypes = default(AlertsDataTypeOfDataConnector), string subscriptionId = default(string)) + : base(id, name, type, etag) { DataTypes = dataTypes; SubscriptionId = subscriptionId; @@ -72,18 +67,5 @@ public ASCDataConnector() [JsonProperty(PropertyName = "properties.subscriptionId")] public string SubscriptionId { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DataTypes != null) - { - DataTypes.Validate(); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AccountEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AccountEntity.cs deleted file mode 100644 index 3dc4c56fcb188..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AccountEntity.cs +++ /dev/null @@ -1,194 +0,0 @@ -// -// 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 account entity. - /// - [Newtonsoft.Json.JsonObject("Account")] - [Rest.Serialization.JsonTransformation] - public partial class AccountEntity : Entity - { - /// - /// Initializes a new instance of the AccountEntity class. - /// - public AccountEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AccountEntity 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 Azure Active Directory tenant - /// id. - /// The Azure Active Directory user id. - /// The name of the account. This field - /// should hold only the name without any domain added to it, i.e. - /// administrator. - /// The display name of the account. - /// The Host entity id that contains the - /// account in case it is a local account (not domain joined) - /// Determines whether this is a domain - /// account. - /// The NetBIOS domain name as it appears in the - /// alert format domain/username. Examples: NT AUTHORITY. - /// The objectGUID attribute is a single-value - /// attribute that is the unique identifier for the object, assigned by - /// active directory. - /// The Azure Active Directory Passport User - /// ID. - /// The account security identifier, e.g. - /// S-1-5-18. - /// The user principal name suffix for the - /// account, in some cases it is also the domain name. Examples: - /// contoso.com. - /// The fully qualified domain DNS - /// name. - public AccountEntity(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 aadTenantId = default(string), string aadUserId = default(string), string accountName = default(string), string displayName = default(string), string hostEntityId = default(string), bool? isDomainJoined = default(bool?), string ntDomain = default(string), System.Guid? objectGuid = default(System.Guid?), string puid = default(string), string sid = default(string), string upnSuffix = default(string), string dnsDomain = default(string)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - AadTenantId = aadTenantId; - AadUserId = aadUserId; - AccountName = accountName; - DisplayName = displayName; - HostEntityId = hostEntityId; - IsDomainJoined = isDomainJoined; - NtDomain = ntDomain; - ObjectGuid = objectGuid; - Puid = puid; - Sid = sid; - UpnSuffix = upnSuffix; - DnsDomain = dnsDomain; - 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 Azure Active Directory tenant id. - /// - [JsonProperty(PropertyName = "properties.aadTenantId")] - public string AadTenantId { get; private set; } - - /// - /// Gets the Azure Active Directory user id. - /// - [JsonProperty(PropertyName = "properties.aadUserId")] - public string AadUserId { get; private set; } - - /// - /// Gets the name of the account. This field should hold only the name - /// without any domain added to it, i.e. administrator. - /// - [JsonProperty(PropertyName = "properties.accountName")] - public string AccountName { get; private set; } - - /// - /// Gets the display name of the account. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets the Host entity id that contains the account in case it is a - /// local account (not domain joined) - /// - [JsonProperty(PropertyName = "properties.hostEntityId")] - public string HostEntityId { get; private set; } - - /// - /// Gets determines whether this is a domain account. - /// - [JsonProperty(PropertyName = "properties.isDomainJoined")] - public bool? IsDomainJoined { get; private set; } - - /// - /// Gets the NetBIOS domain name as it appears in the alert format - /// domain/username. Examples: NT AUTHORITY. - /// - [JsonProperty(PropertyName = "properties.ntDomain")] - public string NtDomain { get; private set; } - - /// - /// Gets the objectGUID attribute is a single-value attribute that is - /// the unique identifier for the object, assigned by active directory. - /// - [JsonProperty(PropertyName = "properties.objectGuid")] - public System.Guid? ObjectGuid { get; private set; } - - /// - /// Gets the Azure Active Directory Passport User ID. - /// - [JsonProperty(PropertyName = "properties.puid")] - public string Puid { get; private set; } - - /// - /// Gets the account security identifier, e.g. S-1-5-18. - /// - [JsonProperty(PropertyName = "properties.sid")] - public string Sid { get; private set; } - - /// - /// Gets the user principal name suffix for the account, in some cases - /// it is also the domain name. Examples: contoso.com. - /// - [JsonProperty(PropertyName = "properties.upnSuffix")] - public string UpnSuffix { get; private set; } - - /// - /// Gets the fully qualified domain DNS name. - /// - [JsonProperty(PropertyName = "properties.dnsDomain")] - public string DnsDomain { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActionRequest.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActionRequest.cs index c5d5843dc773e..248caaf74c61c 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActionRequest.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActionRequest.cs @@ -36,17 +36,12 @@ public ActionRequest() /// /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. /// Logic App Callback URL for this specific /// workflow. - /// 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. + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// Etag of the azure resource - public ActionRequest(string logicAppResourceId, string triggerUri, 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) + public ActionRequest(string logicAppResourceId, string triggerUri, string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + : base(id, name, type, etag) { LogicAppResourceId = logicAppResourceId; TriggerUri = triggerUri; diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActionResponse.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActionResponse.cs index b51e400611b3e..79f56df2404ec 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActionResponse.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActionResponse.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models /// Action for alert rule. /// [Rest.Serialization.JsonTransformation] - public partial class ActionResponse : ResourceWithEtag + public partial class ActionResponse : Resource { /// /// Initializes a new instance of the ActionResponse class. @@ -34,20 +34,16 @@ public ActionResponse() /// /// Logic App Resource Id, /// /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. - /// 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 + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Etag of the action. /// The name of the logic app's /// workflow. - public ActionResponse(string logicAppResourceId, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string workflowId = default(string)) - : base(id, name, type, systemData, etag) + public ActionResponse(string logicAppResourceId, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string workflowId = default(string)) + : base(id, name, type) { + Etag = etag; LogicAppResourceId = logicAppResourceId; WorkflowId = workflowId; CustomInit(); @@ -58,6 +54,12 @@ public ActionResponse() /// partial void CustomInit(); + /// + /// Gets or sets etag of the action. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; set; } + /// /// Gets or sets logic App Resource Id, /// /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. 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 deleted file mode 100644 index 90d755c939504..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityCustomEntityQuery.cs +++ /dev/null @@ -1,169 +0,0 @@ -// -// 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 Activity entity query. - /// - [Newtonsoft.Json.JsonObject("Activity")] - [Rest.Serialization.JsonTransformation] - public partial class ActivityCustomEntityQuery : CustomEntityQuery - { - /// - /// Initializes a new instance of the ActivityCustomEntityQuery class. - /// - public ActivityCustomEntityQuery() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActivityCustomEntityQuery 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 - /// The entity query title - /// The entity query content to display in - /// timeline - /// The entity query description - /// The Activity query - /// definitions - /// The type of the query's source - /// entity. Possible values include: 'Account', 'Host', 'File', - /// 'AzureResource', 'CloudApplication', 'DNS', 'FileHash', 'IP', - /// 'Malware', 'Process', 'RegistryKey', 'RegistryValue', - /// 'SecurityGroup', 'URL', 'IoTDevice', 'SecurityAlert', - /// 'HuntingBookmark', 'MailCluster', 'MailMessage', 'Mailbox', - /// 'SubmissionMail' - /// List of the fields of the - /// source entity that are required to run the query - /// The query applied only to entities - /// matching to all filters - /// The template id this activity was - /// created from - /// Determines whether this activity is enabled - /// or disabled. - /// The time the activity was - /// created - /// The last time the activity was - /// updated - public ActivityCustomEntityQuery(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string title = default(string), string content = default(string), string description = default(string), ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions = default(ActivityEntityQueriesPropertiesQueryDefinitions), string inputEntityType = default(string), IList> requiredInputFieldsSets = default(IList>), IDictionary> entitiesFilter = default(IDictionary>), string templateName = default(string), bool? enabled = default(bool?), System.DateTime? createdTimeUtc = default(System.DateTime?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?)) - : base(id, name, type, systemData, etag) - { - Title = title; - Content = content; - Description = description; - QueryDefinitions = queryDefinitions; - InputEntityType = inputEntityType; - RequiredInputFieldsSets = requiredInputFieldsSets; - EntitiesFilter = entitiesFilter; - TemplateName = templateName; - Enabled = enabled; - CreatedTimeUtc = createdTimeUtc; - LastModifiedTimeUtc = lastModifiedTimeUtc; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the entity query title - /// - [JsonProperty(PropertyName = "properties.title")] - public string Title { get; set; } - - /// - /// Gets or sets the entity query content to display in timeline - /// - [JsonProperty(PropertyName = "properties.content")] - public string Content { get; set; } - - /// - /// Gets or sets the entity query description - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the Activity query definitions - /// - [JsonProperty(PropertyName = "properties.queryDefinitions")] - public ActivityEntityQueriesPropertiesQueryDefinitions QueryDefinitions { get; set; } - - /// - /// Gets or sets the type of the query's source entity. Possible values - /// include: 'Account', 'Host', 'File', 'AzureResource', - /// 'CloudApplication', 'DNS', 'FileHash', 'IP', 'Malware', 'Process', - /// 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'URL', - /// 'IoTDevice', 'SecurityAlert', 'HuntingBookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' - /// - [JsonProperty(PropertyName = "properties.inputEntityType")] - public string InputEntityType { get; set; } - - /// - /// Gets or sets list of the fields of the source entity that are - /// required to run the query - /// - [JsonProperty(PropertyName = "properties.requiredInputFieldsSets")] - public IList> RequiredInputFieldsSets { get; set; } - - /// - /// Gets or sets the query applied only to entities matching to all - /// filters - /// - [JsonProperty(PropertyName = "properties.entitiesFilter")] - public IDictionary> EntitiesFilter { get; set; } - - /// - /// Gets or sets the template id this activity was created from - /// - [JsonProperty(PropertyName = "properties.templateName")] - public string TemplateName { get; set; } - - /// - /// Gets or sets determines whether this activity is enabled or - /// disabled. - /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool? Enabled { get; set; } - - /// - /// Gets the time the activity was created - /// - [JsonProperty(PropertyName = "properties.createdTimeUtc")] - public System.DateTime? CreatedTimeUtc { get; private set; } - - /// - /// Gets the last time the activity was updated - /// - [JsonProperty(PropertyName = "properties.lastModifiedTimeUtc")] - public System.DateTime? LastModifiedTimeUtc { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQueriesPropertiesQueryDefinitions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQueriesPropertiesQueryDefinitions.cs deleted file mode 100644 index 9bd9189eb86e3..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQueriesPropertiesQueryDefinitions.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -// 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 Activity query definitions - /// - public partial class ActivityEntityQueriesPropertiesQueryDefinitions - { - /// - /// Initializes a new instance of the - /// ActivityEntityQueriesPropertiesQueryDefinitions class. - /// - public ActivityEntityQueriesPropertiesQueryDefinitions() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ActivityEntityQueriesPropertiesQueryDefinitions class. - /// - /// The Activity query to run on a given - /// entity - public ActivityEntityQueriesPropertiesQueryDefinitions(string query = default(string)) - { - Query = query; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Activity query to run on a given entity - /// - [JsonProperty(PropertyName = "query")] - public string Query { 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 deleted file mode 100644 index de83406d7424e..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQuery.cs +++ /dev/null @@ -1,169 +0,0 @@ -// -// 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 Activity entity query. - /// - [Newtonsoft.Json.JsonObject("Activity")] - [Rest.Serialization.JsonTransformation] - public partial class ActivityEntityQuery : EntityQuery - { - /// - /// Initializes a new instance of the ActivityEntityQuery class. - /// - public ActivityEntityQuery() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActivityEntityQuery 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 - /// The entity query title - /// The entity query content to display in - /// timeline - /// The entity query description - /// The Activity query - /// definitions - /// The type of the query's source - /// entity. Possible values include: 'Account', 'Host', 'File', - /// 'AzureResource', 'CloudApplication', 'DNS', 'FileHash', 'IP', - /// 'Malware', 'Process', 'RegistryKey', 'RegistryValue', - /// 'SecurityGroup', 'URL', 'IoTDevice', 'SecurityAlert', - /// 'HuntingBookmark', 'MailCluster', 'MailMessage', 'Mailbox', - /// 'SubmissionMail' - /// List of the fields of the - /// source entity that are required to run the query - /// The query applied only to entities - /// matching to all filters - /// The template id this activity was - /// created from - /// Determines whether this activity is enabled - /// or disabled. - /// The time the activity was - /// created - /// The last time the activity was - /// updated - public ActivityEntityQuery(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string title = default(string), string content = default(string), string description = default(string), ActivityEntityQueriesPropertiesQueryDefinitions queryDefinitions = default(ActivityEntityQueriesPropertiesQueryDefinitions), string inputEntityType = default(string), IList> requiredInputFieldsSets = default(IList>), IDictionary> entitiesFilter = default(IDictionary>), string templateName = default(string), bool? enabled = default(bool?), System.DateTime? createdTimeUtc = default(System.DateTime?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?)) - : base(id, name, type, systemData, etag) - { - Title = title; - Content = content; - Description = description; - QueryDefinitions = queryDefinitions; - InputEntityType = inputEntityType; - RequiredInputFieldsSets = requiredInputFieldsSets; - EntitiesFilter = entitiesFilter; - TemplateName = templateName; - Enabled = enabled; - CreatedTimeUtc = createdTimeUtc; - LastModifiedTimeUtc = lastModifiedTimeUtc; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the entity query title - /// - [JsonProperty(PropertyName = "properties.title")] - public string Title { get; set; } - - /// - /// Gets or sets the entity query content to display in timeline - /// - [JsonProperty(PropertyName = "properties.content")] - public string Content { get; set; } - - /// - /// Gets or sets the entity query description - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the Activity query definitions - /// - [JsonProperty(PropertyName = "properties.queryDefinitions")] - public ActivityEntityQueriesPropertiesQueryDefinitions QueryDefinitions { get; set; } - - /// - /// Gets or sets the type of the query's source entity. Possible values - /// include: 'Account', 'Host', 'File', 'AzureResource', - /// 'CloudApplication', 'DNS', 'FileHash', 'IP', 'Malware', 'Process', - /// 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'URL', - /// 'IoTDevice', 'SecurityAlert', 'HuntingBookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' - /// - [JsonProperty(PropertyName = "properties.inputEntityType")] - public string InputEntityType { get; set; } - - /// - /// Gets or sets list of the fields of the source entity that are - /// required to run the query - /// - [JsonProperty(PropertyName = "properties.requiredInputFieldsSets")] - public IList> RequiredInputFieldsSets { get; set; } - - /// - /// Gets or sets the query applied only to entities matching to all - /// filters - /// - [JsonProperty(PropertyName = "properties.entitiesFilter")] - public IDictionary> EntitiesFilter { get; set; } - - /// - /// Gets or sets the template id this activity was created from - /// - [JsonProperty(PropertyName = "properties.templateName")] - public string TemplateName { get; set; } - - /// - /// Gets or sets determines whether this activity is enabled or - /// disabled. - /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool? Enabled { get; set; } - - /// - /// Gets the time the activity was created - /// - [JsonProperty(PropertyName = "properties.createdTimeUtc")] - public System.DateTime? CreatedTimeUtc { get; private set; } - - /// - /// Gets the last time the activity was updated - /// - [JsonProperty(PropertyName = "properties.lastModifiedTimeUtc")] - public System.DateTime? LastModifiedTimeUtc { get; private 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 deleted file mode 100644 index 5c153c6a3c062..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQueryTemplate.cs +++ /dev/null @@ -1,143 +0,0 @@ -// -// 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 Activity entity query. - /// - [Newtonsoft.Json.JsonObject("Activity")] - [Rest.Serialization.JsonTransformation] - public partial class ActivityEntityQueryTemplate : EntityQueryTemplate - { - /// - /// Initializes a new instance of the ActivityEntityQueryTemplate - /// class. - /// - public ActivityEntityQueryTemplate() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActivityEntityQueryTemplate - /// 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. - /// The entity query title - /// The entity query content to display in - /// timeline - /// The entity query description - /// The Activity query - /// definitions - /// List of required data types for the given - /// entity query template - /// The type of the query's source - /// entity. Possible values include: 'Account', 'Host', 'File', - /// 'AzureResource', 'CloudApplication', 'DNS', 'FileHash', 'IP', - /// 'Malware', 'Process', 'RegistryKey', 'RegistryValue', - /// 'SecurityGroup', 'URL', 'IoTDevice', 'SecurityAlert', - /// 'HuntingBookmark', 'MailCluster', 'MailMessage', 'Mailbox', - /// 'SubmissionMail' - /// List of the fields of the - /// source entity that are required to run the query - /// The query applied only to entities - /// matching to all filters - public ActivityEntityQueryTemplate(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string title = default(string), string content = default(string), string description = default(string), ActivityEntityQueryTemplatePropertiesQueryDefinitions queryDefinitions = default(ActivityEntityQueryTemplatePropertiesQueryDefinitions), IList dataTypes = default(IList), string inputEntityType = default(string), IList> requiredInputFieldsSets = default(IList>), IDictionary> entitiesFilter = default(IDictionary>)) - : base(id, name, type, systemData) - { - Title = title; - Content = content; - Description = description; - QueryDefinitions = queryDefinitions; - DataTypes = dataTypes; - InputEntityType = inputEntityType; - RequiredInputFieldsSets = requiredInputFieldsSets; - EntitiesFilter = entitiesFilter; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the entity query title - /// - [JsonProperty(PropertyName = "properties.title")] - public string Title { get; set; } - - /// - /// Gets or sets the entity query content to display in timeline - /// - [JsonProperty(PropertyName = "properties.content")] - public string Content { get; set; } - - /// - /// Gets or sets the entity query description - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the Activity query definitions - /// - [JsonProperty(PropertyName = "properties.queryDefinitions")] - public ActivityEntityQueryTemplatePropertiesQueryDefinitions QueryDefinitions { get; set; } - - /// - /// Gets or sets list of required data types for the given entity query - /// template - /// - [JsonProperty(PropertyName = "properties.dataTypes")] - public IList DataTypes { get; set; } - - /// - /// Gets or sets the type of the query's source entity. Possible values - /// include: 'Account', 'Host', 'File', 'AzureResource', - /// 'CloudApplication', 'DNS', 'FileHash', 'IP', 'Malware', 'Process', - /// 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'URL', - /// 'IoTDevice', 'SecurityAlert', 'HuntingBookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' - /// - [JsonProperty(PropertyName = "properties.inputEntityType")] - public string InputEntityType { get; set; } - - /// - /// Gets or sets list of the fields of the source entity that are - /// required to run the query - /// - [JsonProperty(PropertyName = "properties.requiredInputFieldsSets")] - public IList> RequiredInputFieldsSets { get; set; } - - /// - /// Gets or sets the query applied only to entities matching to all - /// filters - /// - [JsonProperty(PropertyName = "properties.entitiesFilter")] - public IDictionary> EntitiesFilter { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQueryTemplatePropertiesQueryDefinitions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQueryTemplatePropertiesQueryDefinitions.cs deleted file mode 100644 index d4837740813d8..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityEntityQueryTemplatePropertiesQueryDefinitions.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// 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 Activity query definitions - /// - public partial class ActivityEntityQueryTemplatePropertiesQueryDefinitions - { - /// - /// Initializes a new instance of the - /// ActivityEntityQueryTemplatePropertiesQueryDefinitions class. - /// - public ActivityEntityQueryTemplatePropertiesQueryDefinitions() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ActivityEntityQueryTemplatePropertiesQueryDefinitions class. - /// - /// The Activity query to run on a given - /// entity - /// The dimensions we want to summarize the - /// timeline results on, this is comma separated list - public ActivityEntityQueryTemplatePropertiesQueryDefinitions(string query = default(string), string summarizeBy = default(string)) - { - Query = query; - SummarizeBy = summarizeBy; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Activity query to run on a given entity - /// - [JsonProperty(PropertyName = "query")] - public string Query { get; set; } - - /// - /// Gets or sets the dimensions we want to summarize the timeline - /// results on, this is comma separated list - /// - [JsonProperty(PropertyName = "summarizeBy")] - public string SummarizeBy { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityTimelineItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityTimelineItem.cs deleted file mode 100644 index a894fde412f09..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ActivityTimelineItem.cs +++ /dev/null @@ -1,126 +0,0 @@ -// -// 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; - - /// - /// Represents Activity timeline item. - /// - [Newtonsoft.Json.JsonObject("Activity")] - public partial class ActivityTimelineItem : EntityTimelineItem - { - /// - /// Initializes a new instance of the ActivityTimelineItem class. - /// - public ActivityTimelineItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ActivityTimelineItem class. - /// - /// The activity query id. - /// The grouping bucket start - /// time. - /// The grouping bucket end - /// time. - /// The time of the first activity - /// in the grouping bucket. - /// The time of the last activity in - /// the grouping bucket. - /// The activity timeline content. - /// The activity timeline title. - public ActivityTimelineItem(string queryId, System.DateTime bucketStartTimeUTC, System.DateTime bucketEndTimeUTC, System.DateTime firstActivityTimeUTC, System.DateTime lastActivityTimeUTC, string content, string title) - { - QueryId = queryId; - BucketStartTimeUTC = bucketStartTimeUTC; - BucketEndTimeUTC = bucketEndTimeUTC; - FirstActivityTimeUTC = firstActivityTimeUTC; - LastActivityTimeUTC = lastActivityTimeUTC; - Content = content; - Title = title; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the activity query id. - /// - [JsonProperty(PropertyName = "queryId")] - public string QueryId { get; set; } - - /// - /// Gets or sets the grouping bucket start time. - /// - [JsonProperty(PropertyName = "bucketStartTimeUTC")] - public System.DateTime BucketStartTimeUTC { get; set; } - - /// - /// Gets or sets the grouping bucket end time. - /// - [JsonProperty(PropertyName = "bucketEndTimeUTC")] - public System.DateTime BucketEndTimeUTC { get; set; } - - /// - /// Gets or sets the time of the first activity in the grouping bucket. - /// - [JsonProperty(PropertyName = "firstActivityTimeUTC")] - public System.DateTime FirstActivityTimeUTC { get; set; } - - /// - /// Gets or sets the time of the last activity in the grouping bucket. - /// - [JsonProperty(PropertyName = "lastActivityTimeUTC")] - public System.DateTime LastActivityTimeUTC { get; set; } - - /// - /// Gets or sets the activity timeline content. - /// - [JsonProperty(PropertyName = "content")] - public string Content { get; set; } - - /// - /// Gets or sets the activity timeline title. - /// - [JsonProperty(PropertyName = "title")] - public string Title { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (QueryId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "QueryId"); - } - if (Content == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Content"); - } - if (Title == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Title"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertDetail.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertDetail.cs deleted file mode 100644 index efe902f999719..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertDetail.cs +++ /dev/null @@ -1,28 +0,0 @@ -// -// 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 AlertDetail. - /// - public static class AlertDetail - { - /// - /// Alert display name - /// - public const string DisplayName = "DisplayName"; - /// - /// Alert severity - /// - public const string Severity = "Severity"; - } -} 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 deleted file mode 100644 index e42ab0f0cbe02..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertDetailsOverride.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -// 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; - - /// - /// Settings for how to dynamically override alert static details - /// - public partial class AlertDetailsOverride - { - /// - /// Initializes a new instance of the AlertDetailsOverride class. - /// - public AlertDetailsOverride() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AlertDetailsOverride class. - /// - /// the format containing columns - /// name(s) to override the alert name - /// the format containing columns - /// name(s) to override the alert description - /// the column name to take the - /// 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)) - { - AlertDisplayNameFormat = alertDisplayNameFormat; - AlertDescriptionFormat = alertDescriptionFormat; - AlertTacticsColumnName = alertTacticsColumnName; - AlertSeverityColumnName = alertSeverityColumnName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the format containing columns name(s) to override the - /// alert name - /// - [JsonProperty(PropertyName = "alertDisplayNameFormat")] - public string AlertDisplayNameFormat { get; set; } - - /// - /// Gets or sets the format containing columns name(s) to override the - /// alert description - /// - [JsonProperty(PropertyName = "alertDescriptionFormat")] - public string AlertDescriptionFormat { get; set; } - - /// - /// Gets or sets the column name to take the alert tactics from - /// - [JsonProperty(PropertyName = "alertTacticsColumnName")] - public string AlertTacticsColumnName { get; set; } - - /// - /// Gets or sets the column name to take the alert severity from - /// - [JsonProperty(PropertyName = "alertSeverityColumnName")] - public string AlertSeverityColumnName { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRule.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRule.cs index 632d19b54e41b..66598dd902927 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRule.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRule.cs @@ -13,7 +13,7 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models using System.Linq; /// - /// Alert rule. + /// Alert rule. /// public partial class AlertRule : ResourceWithEtag { @@ -28,17 +28,12 @@ public AlertRule() /// /// Initializes a new instance of the AlertRule 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. + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// Etag of the azure resource - public AlertRule(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) + public AlertRule(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + : base(id, name, type, etag) { CustomInit(); } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRuleKind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRuleKind.cs index f097dcd281896..f5b94178a49b0 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRuleKind.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRuleKind.cs @@ -19,8 +19,5 @@ public static class AlertRuleKind public const string Scheduled = "Scheduled"; public const string MicrosoftSecurityIncidentCreation = "MicrosoftSecurityIncidentCreation"; public const string Fusion = "Fusion"; - public const string MLBehaviorAnalytics = "MLBehaviorAnalytics"; - public const string ThreatIntelligence = "ThreatIntelligence"; - public const string NRT = "NRT"; } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRuleTemplate.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRuleTemplate.cs index 3a48612c9419f..5fd7734c55bcf 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRuleTemplate.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRuleTemplate.cs @@ -28,16 +28,11 @@ public AlertRuleTemplate() /// /// Initializes a new instance of the AlertRuleTemplate 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. - public AlertRuleTemplate(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, systemData) + /// Azure resource Id + /// Azure resource name + /// Azure resource type + public AlertRuleTemplate(string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) { CustomInit(); } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRuleTemplatePropertiesBase.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRuleTemplatePropertiesBase.cs deleted file mode 100644 index 037b1d2d4a485..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertRuleTemplatePropertiesBase.cs +++ /dev/null @@ -1,112 +0,0 @@ -// -// 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; - - /// - /// Base alert rule template property bag. - /// - public partial class AlertRuleTemplatePropertiesBase - { - /// - /// Initializes a new instance of the AlertRuleTemplatePropertiesBase - /// class. - /// - public AlertRuleTemplatePropertiesBase() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AlertRuleTemplatePropertiesBase - /// class. - /// - /// the number of alert - /// rules that were created by this template - /// The last time that this alert rule - /// template has been updated. - /// The time that this alert rule template - /// has been added. - /// The description of the alert rule - /// template. - /// The display name for alert rule - /// template. - /// The required data sources for - /// this template - /// The alert rule template status. Possible - /// values include: 'Installed', 'Available', 'NotAvailable' - public AlertRuleTemplatePropertiesBase(int? alertRulesCreatedByTemplateCount = default(int?), System.DateTime? lastUpdatedDateUTC = default(System.DateTime?), System.DateTime? createdDateUTC = default(System.DateTime?), string description = default(string), string displayName = default(string), IList requiredDataConnectors = default(IList), string status = default(string)) - { - AlertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; - LastUpdatedDateUTC = lastUpdatedDateUTC; - CreatedDateUTC = createdDateUTC; - Description = description; - DisplayName = displayName; - RequiredDataConnectors = requiredDataConnectors; - Status = status; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the number of alert rules that were created by this - /// template - /// - [JsonProperty(PropertyName = "alertRulesCreatedByTemplateCount")] - public int? AlertRulesCreatedByTemplateCount { get; set; } - - /// - /// Gets the last time that this alert rule template has been updated. - /// - [JsonProperty(PropertyName = "lastUpdatedDateUTC")] - public System.DateTime? LastUpdatedDateUTC { get; private set; } - - /// - /// Gets the time that this alert rule template has been added. - /// - [JsonProperty(PropertyName = "createdDateUTC")] - public System.DateTime? CreatedDateUTC { get; private set; } - - /// - /// Gets or sets the description of the alert rule template. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// Gets or sets the display name for alert rule template. - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the required data sources for this template - /// - [JsonProperty(PropertyName = "requiredDataConnectors")] - public IList RequiredDataConnectors { get; set; } - - /// - /// Gets or sets the alert rule template status. Possible values - /// include: 'Installed', 'Available', 'NotAvailable' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertStatus.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertStatus.cs deleted file mode 100644 index adad0750947c9..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertStatus.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// 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 AlertStatus. - /// - public static class AlertStatus - { - /// - /// Unknown value - /// - public const string Unknown = "Unknown"; - /// - /// New alert - /// - public const string New = "New"; - /// - /// Alert closed after handling - /// - public const string Resolved = "Resolved"; - /// - /// Alert dismissed as false positive - /// - public const string Dismissed = "Dismissed"; - /// - /// Alert is being handled - /// - public const string InProgress = "InProgress"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertsDataTypeOfDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertsDataTypeOfDataConnector.cs index 3e047c992b321..3a96fcd1dfe5d 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertsDataTypeOfDataConnector.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AlertsDataTypeOfDataConnector.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -33,7 +32,7 @@ public AlertsDataTypeOfDataConnector() /// class. /// /// Alerts data type connection. - public AlertsDataTypeOfDataConnector(DataConnectorDataTypeCommon alerts) + public AlertsDataTypeOfDataConnector(DataConnectorDataTypeCommon alerts = default(DataConnectorDataTypeCommon)) { Alerts = alerts; CustomInit(); @@ -50,22 +49,5 @@ public AlertsDataTypeOfDataConnector(DataConnectorDataTypeCommon alerts) [JsonProperty(PropertyName = "alerts")] public DataConnectorDataTypeCommon Alerts { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Alerts == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Alerts"); - } - if (Alerts != null) - { - Alerts.Validate(); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Anomalies.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Anomalies.cs deleted file mode 100644 index f59c61d4e96c1..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Anomalies.cs +++ /dev/null @@ -1,65 +0,0 @@ -// -// 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.Linq; - - /// - /// Settings with single toggle. - /// - [Rest.Serialization.JsonTransformation] - public partial class Anomalies : Settings - { - /// - /// Initializes a new instance of the Anomalies class. - /// - public Anomalies() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Anomalies 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 - /// Determines whether the setting is enable or - /// disabled. - public Anomalies(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), bool? isEnabled = default(bool?)) - : base(id, name, type, systemData, etag) - { - IsEnabled = isEnabled; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets determines whether the setting is enable or disabled. - /// - [JsonProperty(PropertyName = "properties.isEnabled")] - public bool? IsEnabled { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AntispamMailDirection.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AntispamMailDirection.cs deleted file mode 100644 index ec3b3453953b9..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AntispamMailDirection.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// 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 AntispamMailDirection. - /// - public static class AntispamMailDirection - { - /// - /// Unknown - /// - public const string Unknown = "Unknown"; - /// - /// Inbound - /// - public const string Inbound = "Inbound"; - /// - /// Outbound - /// - public const string Outbound = "Outbound"; - /// - /// Intraorg - /// - public const string Intraorg = "Intraorg"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AttackTactic.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AttackTactic.cs index c796fa0bef63c..69da962ffc7a1 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AttackTactic.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AttackTactic.cs @@ -28,6 +28,5 @@ public static class AttackTactic public const string Exfiltration = "Exfiltration"; public const string CommandAndControl = "CommandAndControl"; public const string Impact = "Impact"; - public const string PreAttack = "PreAttack"; } } 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 deleted file mode 100644 index 0c470d5ad24fc..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRule.cs +++ /dev/null @@ -1,167 +0,0 @@ -// -// 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 automation rule. - /// - [Rest.Serialization.JsonTransformation] - public partial class AutomationRule : ResourceWithEtag - { - /// - /// Initializes a new instance of the AutomationRule class. - /// - public AutomationRule() - { - TriggeringLogic = new AutomationRuleTriggeringLogic(); - CustomInit(); - } - - /// - /// Initializes a new instance of the AutomationRule class. - /// - /// The display name of the automation - /// rule - /// The order of execution of the automation - /// rule - /// The triggering logic of the - /// automation rule - /// The actions to execute when the automation - /// rule is triggered - /// 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 time the automation rule was - /// created - /// The last time the automation rule - /// was updated - /// Describes the client that created the - /// automation rule - /// Describes the client that last updated - /// the automation rule - 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? createdTimeUtc = default(System.DateTime?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), ClientInfo createdBy = default(ClientInfo), ClientInfo lastModifiedBy = default(ClientInfo)) - : base(id, name, type, systemData, etag) - { - DisplayName = displayName; - Order = order; - TriggeringLogic = triggeringLogic; - Actions = actions; - CreatedTimeUtc = createdTimeUtc; - LastModifiedTimeUtc = lastModifiedTimeUtc; - CreatedBy = createdBy; - LastModifiedBy = lastModifiedBy; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// 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 - /// - [JsonProperty(PropertyName = "properties.order")] - public int Order { get; set; } - - /// - /// Gets or sets the triggering logic of the automation rule - /// - [JsonProperty(PropertyName = "properties.triggeringLogic")] - public AutomationRuleTriggeringLogic TriggeringLogic { get; set; } - - /// - /// Gets or sets the actions to execute when the automation rule is - /// triggered - /// - [JsonProperty(PropertyName = "properties.actions")] - public IList Actions { get; set; } - - /// - /// Gets the time the automation rule was created - /// - [JsonProperty(PropertyName = "properties.createdTimeUtc")] - public System.DateTime? CreatedTimeUtc { get; private set; } - - /// - /// Gets the last time the automation rule was updated - /// - [JsonProperty(PropertyName = "properties.lastModifiedTimeUtc")] - public System.DateTime? LastModifiedTimeUtc { get; private set; } - - /// - /// Gets describes the client that created the automation rule - /// - [JsonProperty(PropertyName = "properties.createdBy")] - public ClientInfo CreatedBy { get; private set; } - - /// - /// Gets describes the client that last updated the automation rule - /// - [JsonProperty(PropertyName = "properties.lastModifiedBy")] - public ClientInfo LastModifiedBy { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DisplayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); - } - if (TriggeringLogic == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TriggeringLogic"); - } - if (Actions == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Actions"); - } - if (TriggeringLogic != null) - { - TriggeringLogic.Validate(); - } - if (Actions != null) - { - foreach (var element in Actions) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} 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 deleted file mode 100644 index e1fbcd0306ffe..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleAction.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// 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 action - /// - public partial class AutomationRuleAction - { - /// - /// Initializes a new instance of the AutomationRuleAction class. - /// - public AutomationRuleAction() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AutomationRuleAction class. - /// - /// The order of execution of the automation rule - /// action - public AutomationRuleAction(int order) - { - Order = order; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the order of execution of the automation rule action - /// - [JsonProperty(PropertyName = "order")] - public int Order { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - //Nothing to validate - } - } -} 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 deleted file mode 100644 index 3647e487416a3..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleCondition.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// 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; - - /// - /// Describes an automation rule condition - /// - public partial class AutomationRuleCondition - { - /// - /// Initializes a new instance of the AutomationRuleCondition class. - /// - public AutomationRuleCondition() - { - 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/AutomationRuleModifyPropertiesAction.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleModifyPropertiesAction.cs deleted file mode 100644 index eb45d31b32446..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleModifyPropertiesAction.cs +++ /dev/null @@ -1,74 +0,0 @@ -// -// 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; - - /// - /// Describes an automation rule action to modify an object's properties - /// - [Newtonsoft.Json.JsonObject("ModifyProperties")] - public partial class AutomationRuleModifyPropertiesAction : AutomationRuleAction - { - /// - /// Initializes a new instance of the - /// AutomationRuleModifyPropertiesAction class. - /// - public AutomationRuleModifyPropertiesAction() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// AutomationRuleModifyPropertiesAction class. - /// - /// The order of execution of the automation rule - /// action - /// The configuration of the modify - /// properties automation rule action - public AutomationRuleModifyPropertiesAction(int order, AutomationRuleModifyPropertiesActionActionConfiguration actionConfiguration) - : base(order) - { - ActionConfiguration = actionConfiguration; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the configuration of the modify properties automation - /// rule action - /// - [JsonProperty(PropertyName = "actionConfiguration")] - public AutomationRuleModifyPropertiesActionActionConfiguration ActionConfiguration { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (ActionConfiguration == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ActionConfiguration"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleModifyPropertiesActionActionConfiguration.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleModifyPropertiesActionActionConfiguration.cs deleted file mode 100644 index 19b1f7c475354..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleModifyPropertiesActionActionConfiguration.cs +++ /dev/null @@ -1,118 +0,0 @@ -// -// 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 configuration of the modify properties automation rule action - /// - public partial class AutomationRuleModifyPropertiesActionActionConfiguration - { - /// - /// Initializes a new instance of the - /// AutomationRuleModifyPropertiesActionActionConfiguration class. - /// - public AutomationRuleModifyPropertiesActionActionConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// AutomationRuleModifyPropertiesActionActionConfiguration class. - /// - /// The reason the incident was closed. - /// Possible values include: 'Undetermined', 'TruePositive', - /// 'BenignPositive', 'FalsePositive' - /// Describes the reason the - /// incident was closed - /// The classification reason the - /// incident was closed with. Possible values include: - /// 'SuspiciousActivity', 'SuspiciousButExpected', - /// 'IncorrectAlertLogic', 'InaccurateData' - /// List of labels to add to the incident - /// Describes a user that the incident is assigned - /// to - /// The severity of the incident. Possible - /// values include: 'High', 'Medium', 'Low', 'Informational' - /// The status of the incident. Possible values - /// include: 'New', 'Active', 'Closed' - public AutomationRuleModifyPropertiesActionActionConfiguration(string classification = default(string), string classificationComment = default(string), string classificationReason = default(string), IList labels = default(IList), IncidentOwnerInfo owner = default(IncidentOwnerInfo), string severity = default(string), string status = default(string)) - { - Classification = classification; - ClassificationComment = classificationComment; - ClassificationReason = classificationReason; - Labels = labels; - Owner = owner; - Severity = severity; - Status = status; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the reason the incident was closed. Possible values - /// include: 'Undetermined', 'TruePositive', 'BenignPositive', - /// 'FalsePositive' - /// - [JsonProperty(PropertyName = "classification")] - public string Classification { get; set; } - - /// - /// Gets or sets describes the reason the incident was closed - /// - [JsonProperty(PropertyName = "classificationComment")] - public string ClassificationComment { get; set; } - - /// - /// Gets or sets the classification reason the incident was closed - /// with. Possible values include: 'SuspiciousActivity', - /// 'SuspiciousButExpected', 'IncorrectAlertLogic', 'InaccurateData' - /// - [JsonProperty(PropertyName = "classificationReason")] - public string ClassificationReason { get; set; } - - /// - /// Gets or sets list of labels to add to the incident - /// - [JsonProperty(PropertyName = "labels")] - public IList Labels { get; set; } - - /// - /// Gets or sets describes a user that the incident is assigned to - /// - [JsonProperty(PropertyName = "owner")] - public IncidentOwnerInfo Owner { get; set; } - - /// - /// Gets or sets the severity of the incident. Possible values include: - /// 'High', 'Medium', 'Low', 'Informational' - /// - [JsonProperty(PropertyName = "severity")] - public string Severity { get; set; } - - /// - /// Gets or sets the status of the incident. Possible values include: - /// 'New', 'Active', 'Closed' - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyConditionSupportedOperator.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyConditionSupportedOperator.cs deleted file mode 100644 index 559379007992e..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyConditionSupportedOperator.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// 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 AutomationRulePropertyConditionSupportedOperator. - /// - public static class AutomationRulePropertyConditionSupportedOperator - { - /// - /// Evaluates if the property equals at least one of the condition - /// values - /// - public const string Equals = "Equals"; - /// - /// Evaluates if the property does not equal any of the condition - /// values - /// - public const string NotEquals = "NotEquals"; - /// - /// Evaluates if the property contains at least one of the condition - /// values - /// - public const string Contains = "Contains"; - /// - /// Evaluates if the property does not contain any of the condition - /// values - /// - public const string NotContains = "NotContains"; - /// - /// Evaluates if the property starts with any of the condition values - /// - public const string StartsWith = "StartsWith"; - /// - /// Evaluates if the property does not start with any of the condition - /// values - /// - public const string NotStartsWith = "NotStartsWith"; - /// - /// Evaluates if the property ends with any of the condition values - /// - public const string EndsWith = "EndsWith"; - /// - /// Evaluates if the property does not end with any of the condition - /// values - /// - public const string NotEndsWith = "NotEndsWith"; - } -} 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 deleted file mode 100644 index 2c04b42ab87fc..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyConditionSupportedProperty.cs +++ /dev/null @@ -1,228 +0,0 @@ -// -// 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 AutomationRulePropertyConditionSupportedProperty. - /// - public static class AutomationRulePropertyConditionSupportedProperty - { - /// - /// The title of the incident - /// - public const string IncidentTitle = "IncidentTitle"; - /// - /// The description of the incident - /// - public const string IncidentDescription = "IncidentDescription"; - /// - /// The severity of the incident - /// - public const string IncidentSeverity = "IncidentSeverity"; - /// - /// The status of the incident - /// - public const string IncidentStatus = "IncidentStatus"; - /// - /// The tactics of the incident - /// - public const string IncidentTactics = "IncidentTactics"; - /// - /// The related Analytic rule ids of the incident - /// - public const string IncidentRelatedAnalyticRuleIds = "IncidentRelatedAnalyticRuleIds"; - /// - /// The provider name of the incident - /// - public const string IncidentProviderName = "IncidentProviderName"; - /// - /// The account Azure Active Directory tenant id - /// - public const string AccountAadTenantId = "AccountAadTenantId"; - /// - /// The account Azure Active Directory user id. - /// - public const string AccountAadUserId = "AccountAadUserId"; - /// - /// The account name - /// - public const string AccountName = "AccountName"; - /// - /// The account NetBIOS domain name - /// - public const string AccountNTDomain = "AccountNTDomain"; - /// - /// The account Azure Active Directory Passport User ID - /// - public const string AccountPUID = "AccountPUID"; - /// - /// The account security identifier - /// - public const string AccountSid = "AccountSid"; - /// - /// The account unique identifier - /// - public const string AccountObjectGuid = "AccountObjectGuid"; - /// - /// The account user principal name suffix - /// - public const string AccountUPNSuffix = "AccountUPNSuffix"; - /// - /// The Azure resource id - /// - public const string AzureResourceResourceId = "AzureResourceResourceId"; - /// - /// The Azure resource subscription id - /// - public const string AzureResourceSubscriptionId = "AzureResourceSubscriptionId"; - /// - /// The cloud application identifier - /// - public const string CloudApplicationAppId = "CloudApplicationAppId"; - /// - /// The cloud application name - /// - public const string CloudApplicationAppName = "CloudApplicationAppName"; - /// - /// The dns record domain name - /// - public const string DNSDomainName = "DNSDomainName"; - /// - /// The file directory full path - /// - public const string FileDirectory = "FileDirectory"; - /// - /// The file name without path - /// - public const string FileName = "FileName"; - /// - /// The file hash value - /// - public const string FileHashValue = "FileHashValue"; - /// - /// The host Azure resource id - /// - public const string HostAzureID = "HostAzureID"; - /// - /// The host name without domain - /// - public const string HostName = "HostName"; - /// - /// The host NetBIOS name - /// - public const string HostNetBiosName = "HostNetBiosName"; - /// - /// The host NT domain - /// - public const string HostNTDomain = "HostNTDomain"; - /// - /// The host operating system - /// - public const string HostOSVersion = "HostOSVersion"; - /// - /// The IoT device id - /// - public const string IoTDeviceId = "IoTDeviceId"; - /// - /// The IoT device name - /// - public const string IoTDeviceName = "IoTDeviceName"; - /// - /// The IoT device type - /// - public const string IoTDeviceType = "IoTDeviceType"; - /// - /// The IoT device vendor - /// - public const string IoTDeviceVendor = "IoTDeviceVendor"; - /// - /// The IoT device model - /// - public const string IoTDeviceModel = "IoTDeviceModel"; - /// - /// The IoT device operating system - /// - public const string IoTDeviceOperatingSystem = "IoTDeviceOperatingSystem"; - /// - /// The IP address - /// - public const string IPAddress = "IPAddress"; - /// - /// The mailbox display name - /// - public const string MailboxDisplayName = "MailboxDisplayName"; - /// - /// The mailbox primary address - /// - public const string MailboxPrimaryAddress = "MailboxPrimaryAddress"; - /// - /// The mailbox user principal name - /// - public const string MailboxUPN = "MailboxUPN"; - /// - /// The mail message delivery action - /// - public const string MailMessageDeliveryAction = "MailMessageDeliveryAction"; - /// - /// The mail message delivery location - /// - public const string MailMessageDeliveryLocation = "MailMessageDeliveryLocation"; - /// - /// The mail message recipient - /// - public const string MailMessageRecipient = "MailMessageRecipient"; - /// - /// The mail message sender IP address - /// - public const string MailMessageSenderIP = "MailMessageSenderIP"; - /// - /// The mail message subject - /// - public const string MailMessageSubject = "MailMessageSubject"; - /// - /// The mail message P1 sender - /// - public const string MailMessageP1Sender = "MailMessageP1Sender"; - /// - /// The mail message P2 sender - /// - public const string MailMessageP2Sender = "MailMessageP2Sender"; - /// - /// The malware category - /// - public const string MalwareCategory = "MalwareCategory"; - /// - /// The malware name - /// - public const string MalwareName = "MalwareName"; - /// - /// The process execution command line - /// - public const string ProcessCommandLine = "ProcessCommandLine"; - /// - /// The process id - /// - public const string ProcessId = "ProcessId"; - /// - /// The registry key path - /// - public const string RegistryKey = "RegistryKey"; - /// - /// The registry key value in string formatted representation - /// - public const string RegistryValueData = "RegistryValueData"; - /// - /// The url - /// - public const string Url = "Url"; - } -} 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 deleted file mode 100644 index fdeb7deed74ce..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyValuesCondition.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// 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; - - /// - /// Describes an automation rule condition that evaluates a property's - /// value - /// - [Newtonsoft.Json.JsonObject("Property")] - public partial class AutomationRulePropertyValuesCondition : AutomationRuleCondition - { - /// - /// Initializes a new instance of the - /// AutomationRulePropertyValuesCondition class. - /// - public AutomationRulePropertyValuesCondition() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// AutomationRulePropertyValuesCondition class. - /// - /// The configuration of the - /// automation rule condition - public AutomationRulePropertyValuesCondition(AutomationRulePropertyValuesConditionConditionProperties conditionProperties) - { - ConditionProperties = conditionProperties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the configuration of the automation rule condition - /// - [JsonProperty(PropertyName = "conditionProperties")] - public AutomationRulePropertyValuesConditionConditionProperties ConditionProperties { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ConditionProperties == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ConditionProperties"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyValuesConditionConditionProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyValuesConditionConditionProperties.cs deleted file mode 100644 index 649478fa28cd4..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRulePropertyValuesConditionConditionProperties.cs +++ /dev/null @@ -1,114 +0,0 @@ -// -// 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 configuration of the automation rule condition - /// - public partial class AutomationRulePropertyValuesConditionConditionProperties - { - /// - /// Initializes a new instance of the - /// AutomationRulePropertyValuesConditionConditionProperties class. - /// - public AutomationRulePropertyValuesConditionConditionProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// AutomationRulePropertyValuesConditionConditionProperties class. - /// - /// The property to evaluate. Possible - /// values include: 'IncidentTitle', 'IncidentDescription', - /// 'IncidentSeverity', 'IncidentStatus', 'IncidentTactics', - /// 'IncidentRelatedAnalyticRuleIds', 'IncidentProviderName', - /// 'AccountAadTenantId', 'AccountAadUserId', 'AccountName', - /// 'AccountNTDomain', 'AccountPUID', 'AccountSid', - /// 'AccountObjectGuid', 'AccountUPNSuffix', 'AzureResourceResourceId', - /// 'AzureResourceSubscriptionId', 'CloudApplicationAppId', - /// 'CloudApplicationAppName', 'DNSDomainName', 'FileDirectory', - /// 'FileName', 'FileHashValue', 'HostAzureID', 'HostName', - /// 'HostNetBiosName', 'HostNTDomain', 'HostOSVersion', 'IoTDeviceId', - /// 'IoTDeviceName', 'IoTDeviceType', 'IoTDeviceVendor', - /// 'IoTDeviceModel', 'IoTDeviceOperatingSystem', 'IPAddress', - /// 'MailboxDisplayName', 'MailboxPrimaryAddress', 'MailboxUPN', - /// 'MailMessageDeliveryAction', 'MailMessageDeliveryLocation', - /// 'MailMessageRecipient', 'MailMessageSenderIP', - /// 'MailMessageSubject', 'MailMessageP1Sender', 'MailMessageP2Sender', - /// 'MalwareCategory', 'MalwareName', 'ProcessCommandLine', - /// 'ProcessId', 'RegistryKey', 'RegistryValueData', 'Url' - /// The operator to use for evaluation - /// the condition. Possible values include: 'Equals', 'NotEquals', - /// 'Contains', 'NotContains', 'StartsWith', 'NotStartsWith', - /// 'EndsWith', 'NotEndsWith' - /// The values to use for evaluating the - /// condition - public AutomationRulePropertyValuesConditionConditionProperties(string propertyName = default(string), string operatorProperty = default(string), IList propertyValues = default(IList)) - { - PropertyName = propertyName; - OperatorProperty = operatorProperty; - PropertyValues = propertyValues; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the property to evaluate. Possible values include: - /// 'IncidentTitle', 'IncidentDescription', 'IncidentSeverity', - /// 'IncidentStatus', 'IncidentTactics', - /// 'IncidentRelatedAnalyticRuleIds', 'IncidentProviderName', - /// 'AccountAadTenantId', 'AccountAadUserId', 'AccountName', - /// 'AccountNTDomain', 'AccountPUID', 'AccountSid', - /// 'AccountObjectGuid', 'AccountUPNSuffix', 'AzureResourceResourceId', - /// 'AzureResourceSubscriptionId', 'CloudApplicationAppId', - /// 'CloudApplicationAppName', 'DNSDomainName', 'FileDirectory', - /// 'FileName', 'FileHashValue', 'HostAzureID', 'HostName', - /// 'HostNetBiosName', 'HostNTDomain', 'HostOSVersion', 'IoTDeviceId', - /// 'IoTDeviceName', 'IoTDeviceType', 'IoTDeviceVendor', - /// 'IoTDeviceModel', 'IoTDeviceOperatingSystem', 'IPAddress', - /// 'MailboxDisplayName', 'MailboxPrimaryAddress', 'MailboxUPN', - /// 'MailMessageDeliveryAction', 'MailMessageDeliveryLocation', - /// 'MailMessageRecipient', 'MailMessageSenderIP', - /// 'MailMessageSubject', 'MailMessageP1Sender', 'MailMessageP2Sender', - /// 'MalwareCategory', 'MalwareName', 'ProcessCommandLine', - /// 'ProcessId', 'RegistryKey', 'RegistryValueData', 'Url' - /// - [JsonProperty(PropertyName = "propertyName")] - public string PropertyName { get; set; } - - /// - /// Gets or sets the operator to use for evaluation the condition. - /// Possible values include: 'Equals', 'NotEquals', 'Contains', - /// 'NotContains', 'StartsWith', 'NotStartsWith', 'EndsWith', - /// 'NotEndsWith' - /// - [JsonProperty(PropertyName = "operator")] - public string OperatorProperty { get; set; } - - /// - /// Gets or sets the values to use for evaluating the condition - /// - [JsonProperty(PropertyName = "propertyValues")] - public IList PropertyValues { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleRunPlaybookAction.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleRunPlaybookAction.cs deleted file mode 100644 index cbc27ec81a7c1..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleRunPlaybookAction.cs +++ /dev/null @@ -1,74 +0,0 @@ -// -// 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; - - /// - /// Describes an automation rule action to run a playbook - /// - [Newtonsoft.Json.JsonObject("RunPlaybook")] - public partial class AutomationRuleRunPlaybookAction : AutomationRuleAction - { - /// - /// Initializes a new instance of the AutomationRuleRunPlaybookAction - /// class. - /// - public AutomationRuleRunPlaybookAction() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AutomationRuleRunPlaybookAction - /// class. - /// - /// The order of execution of the automation rule - /// action - /// The configuration of the run - /// playbook automation rule action - public AutomationRuleRunPlaybookAction(int order, AutomationRuleRunPlaybookActionActionConfiguration actionConfiguration) - : base(order) - { - ActionConfiguration = actionConfiguration; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the configuration of the run playbook automation rule - /// action - /// - [JsonProperty(PropertyName = "actionConfiguration")] - public AutomationRuleRunPlaybookActionActionConfiguration ActionConfiguration { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (ActionConfiguration == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ActionConfiguration"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleRunPlaybookActionActionConfiguration.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleRunPlaybookActionActionConfiguration.cs deleted file mode 100644 index 79bfc0fa2c0f1..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleRunPlaybookActionActionConfiguration.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// 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 configuration of the run playbook automation rule action - /// - public partial class AutomationRuleRunPlaybookActionActionConfiguration - { - /// - /// Initializes a new instance of the - /// AutomationRuleRunPlaybookActionActionConfiguration class. - /// - public AutomationRuleRunPlaybookActionActionConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// AutomationRuleRunPlaybookActionActionConfiguration class. - /// - /// The resource id of the playbook - /// resource - /// The tenant id of the playbook - /// resource - public AutomationRuleRunPlaybookActionActionConfiguration(string logicAppResourceId = default(string), string tenantId = default(string)) - { - LogicAppResourceId = logicAppResourceId; - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// 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 - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; set; } - - } -} 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 deleted file mode 100644 index c668755fd2378..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AutomationRuleTriggeringLogic.cs +++ /dev/null @@ -1,106 +0,0 @@ -// -// 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 automation rule triggering logic - /// - public partial class AutomationRuleTriggeringLogic - { - /// - /// Initializes a new instance of the AutomationRuleTriggeringLogic - /// class. - /// - public AutomationRuleTriggeringLogic() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AutomationRuleTriggeringLogic - /// class. - /// - /// Determines whether the automation rule is - /// enabled or disabled. - /// 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)) - { - IsEnabled = isEnabled; - ExpirationTimeUtc = expirationTimeUtc; - Conditions = conditions; - CustomInit(); - } - /// - /// Static constructor for AutomationRuleTriggeringLogic class. - /// - static AutomationRuleTriggeringLogic() - { - TriggersOn = "Incidents"; - TriggersWhen = "Created"; - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets determines whether the automation rule is enabled or - /// disabled. - /// - [JsonProperty(PropertyName = "isEnabled")] - public bool IsEnabled { get; set; } - - /// - /// Gets or sets determines when the automation rule should - /// automatically expire and be disabled. - /// - [JsonProperty(PropertyName = "expirationTimeUtc")] - 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 - /// - [JsonProperty(PropertyName = "conditions")] - public IList Conditions { get; set; } - - /// - /// The type of object the automation rule triggers on - /// - [JsonProperty(PropertyName = "triggersOn")] - public static string TriggersOn { get; private set; } - - /// - /// The type of event the automation rule triggers on - /// - [JsonProperty(PropertyName = "triggersWhen")] - public static string TriggersWhen { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Availability.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Availability.cs deleted file mode 100644 index d4cd9363276fc..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Availability.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// 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; - - /// - /// Connector Availability Status - /// - public partial class Availability - { - /// - /// Initializes a new instance of the Availability class. - /// - public Availability() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Availability class. - /// - /// The connector Availability Status - /// Set connector as preview - public Availability(int? status = default(int?), bool? isPreview = default(bool?)) - { - Status = status; - IsPreview = isPreview; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the connector Availability Status - /// - [JsonProperty(PropertyName = "status")] - public int? Status { get; set; } - - /// - /// Gets or sets set connector as preview - /// - [JsonProperty(PropertyName = "isPreview")] - public bool? IsPreview { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsCloudTrailCheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsCloudTrailCheckRequirements.cs deleted file mode 100644 index d09f16f2f7ed3..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsCloudTrailCheckRequirements.cs +++ /dev/null @@ -1,38 +0,0 @@ -// -// 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; - - /// - /// Amazon Web Services CloudTrail requirements check request. - /// - [Newtonsoft.Json.JsonObject("AmazonWebServicesCloudTrail")] - public partial class AwsCloudTrailCheckRequirements : DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the AwsCloudTrailCheckRequirements - /// class. - /// - public AwsCloudTrailCheckRequirements() - { - 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/AwsCloudTrailDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsCloudTrailDataConnector.cs index c8e56112896ef..ee41347c8b5a6 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsCloudTrailDataConnector.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsCloudTrailDataConnector.cs @@ -33,21 +33,16 @@ public AwsCloudTrailDataConnector() /// /// Initializes a new instance of the AwsCloudTrailDataConnector class. /// - /// The available data types for the - /// connector. - /// 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. + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// Etag of the azure resource /// The Aws Role Arn (with CloudTrailReadOnly /// policy) that is used to access the Aws account. - public AwsCloudTrailDataConnector(AwsCloudTrailDataConnectorDataTypes dataTypes, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string awsRoleArn = default(string)) - : base(id, name, type, systemData, etag) + /// The available data types for the + /// connector. + public AwsCloudTrailDataConnector(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string awsRoleArn = default(string), AwsCloudTrailDataConnectorDataTypes dataTypes = default(AwsCloudTrailDataConnectorDataTypes)) + : base(id, name, type, etag) { AwsRoleArn = awsRoleArn; DataTypes = dataTypes; @@ -72,22 +67,5 @@ public AwsCloudTrailDataConnector() [JsonProperty(PropertyName = "properties.dataTypes")] public AwsCloudTrailDataConnectorDataTypes DataTypes { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DataTypes == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataTypes"); - } - if (DataTypes != null) - { - DataTypes.Validate(); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsCloudTrailDataConnectorDataTypes.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsCloudTrailDataConnectorDataTypes.cs index cb1ee91fc8785..279ef3f6a6fd1 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsCloudTrailDataConnectorDataTypes.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsCloudTrailDataConnectorDataTypes.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -34,7 +33,7 @@ public AwsCloudTrailDataConnectorDataTypes() /// AwsCloudTrailDataConnectorDataTypes class. /// /// Logs data type. - public AwsCloudTrailDataConnectorDataTypes(AwsCloudTrailDataConnectorDataTypesLogs logs) + public AwsCloudTrailDataConnectorDataTypes(AwsCloudTrailDataConnectorDataTypesLogs logs = default(AwsCloudTrailDataConnectorDataTypesLogs)) { Logs = logs; CustomInit(); @@ -51,22 +50,5 @@ public AwsCloudTrailDataConnectorDataTypes(AwsCloudTrailDataConnectorDataTypesLo [JsonProperty(PropertyName = "logs")] public AwsCloudTrailDataConnectorDataTypesLogs Logs { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Logs == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Logs"); - } - if (Logs != null) - { - Logs.Validate(); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsCloudTrailDataConnectorDataTypesLogs.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsCloudTrailDataConnectorDataTypesLogs.cs index 6f771243230b9..02803069b81e5 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsCloudTrailDataConnectorDataTypesLogs.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsCloudTrailDataConnectorDataTypesLogs.cs @@ -33,7 +33,7 @@ public AwsCloudTrailDataConnectorDataTypesLogs() /// Describe whether this data type connection is /// enabled or not. Possible values include: 'Enabled', /// 'Disabled' - public AwsCloudTrailDataConnectorDataTypesLogs(string state) + public AwsCloudTrailDataConnectorDataTypesLogs(string state = default(string)) : base(state) { CustomInit(); @@ -44,15 +44,5 @@ public AwsCloudTrailDataConnectorDataTypesLogs(string state) /// 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/AwsS3CheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsS3CheckRequirements.cs deleted file mode 100644 index de3dc86562f5c..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsS3CheckRequirements.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// 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; - - /// - /// Amazon Web Services S3 requirements check request. - /// - [Newtonsoft.Json.JsonObject("AmazonWebServicesS3")] - public partial class AwsS3CheckRequirements : DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the AwsS3CheckRequirements class. - /// - public AwsS3CheckRequirements() - { - 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/AwsS3DataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsS3DataConnector.cs deleted file mode 100644 index 4beedd3351ef8..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsS3DataConnector.cs +++ /dev/null @@ -1,124 +0,0 @@ -// -// 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 Amazon Web Services S3 data connector. - /// - [Newtonsoft.Json.JsonObject("AmazonWebServicesS3")] - [Rest.Serialization.JsonTransformation] - public partial class AwsS3DataConnector : DataConnector - { - /// - /// Initializes a new instance of the AwsS3DataConnector class. - /// - public AwsS3DataConnector() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AwsS3DataConnector class. - /// - /// The logs destination table name in - /// LogAnalytics. - /// The AWS sqs urls for the connector. - /// The Aws Role Arn that is used to access the - /// Aws account. - /// The available data types for the - /// connector. - /// 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 AwsS3DataConnector(string destinationTable, IList sqsUrls, string roleArn, AwsS3DataConnectorDataTypes dataTypes, 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) - { - DestinationTable = destinationTable; - SqsUrls = sqsUrls; - RoleArn = roleArn; - DataTypes = dataTypes; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the logs destination table name in LogAnalytics. - /// - [JsonProperty(PropertyName = "properties.destinationTable")] - public string DestinationTable { get; set; } - - /// - /// Gets or sets the AWS sqs urls for the connector. - /// - [JsonProperty(PropertyName = "properties.sqsUrls")] - public IList SqsUrls { get; set; } - - /// - /// Gets or sets the Aws Role Arn that is used to access the Aws - /// account. - /// - [JsonProperty(PropertyName = "properties.roleArn")] - public string RoleArn { get; set; } - - /// - /// Gets or sets the available data types for the connector. - /// - [JsonProperty(PropertyName = "properties.dataTypes")] - public AwsS3DataConnectorDataTypes DataTypes { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DestinationTable == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DestinationTable"); - } - if (SqsUrls == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SqsUrls"); - } - if (RoleArn == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "RoleArn"); - } - if (DataTypes == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataTypes"); - } - if (DataTypes != null) - { - DataTypes.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsS3DataConnectorDataTypes.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsS3DataConnectorDataTypes.cs deleted file mode 100644 index 42ef89fee1fa3..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsS3DataConnectorDataTypes.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// 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; - - /// - /// The available data types for Amazon Web Services S3 data connector. - /// - public partial class AwsS3DataConnectorDataTypes - { - /// - /// Initializes a new instance of the AwsS3DataConnectorDataTypes - /// class. - /// - public AwsS3DataConnectorDataTypes() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AwsS3DataConnectorDataTypes - /// class. - /// - /// Logs data type. - public AwsS3DataConnectorDataTypes(AwsS3DataConnectorDataTypesLogs logs) - { - Logs = logs; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets logs data type. - /// - [JsonProperty(PropertyName = "logs")] - public AwsS3DataConnectorDataTypesLogs Logs { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Logs == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Logs"); - } - if (Logs != null) - { - Logs.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsS3DataConnectorDataTypesLogs.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsS3DataConnectorDataTypesLogs.cs deleted file mode 100644 index 4db4cdd6249ae..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AwsS3DataConnectorDataTypesLogs.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// 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; - - /// - /// Logs data type. - /// - public partial class AwsS3DataConnectorDataTypesLogs : DataConnectorDataTypeCommon - { - /// - /// Initializes a new instance of the AwsS3DataConnectorDataTypesLogs - /// class. - /// - public AwsS3DataConnectorDataTypesLogs() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AwsS3DataConnectorDataTypesLogs - /// class. - /// - /// Describe whether this data type connection is - /// enabled or not. Possible values include: 'Enabled', - /// 'Disabled' - public AwsS3DataConnectorDataTypesLogs(string state) - : base(state) - { - 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/AzureEntityResource.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AzureEntityResource.cs deleted file mode 100644 index ac65db7abfa7d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AzureEntityResource.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// 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; - - /// - /// Entity Resource - /// - /// - /// The resource model definition for an Azure Resource Manager resource - /// with an etag. - /// - public partial class AzureEntityResource : Resource - { - /// - /// Initializes a new instance of the AzureEntityResource class. - /// - public AzureEntityResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AzureEntityResource 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. - /// Resource Etag. - public AzureEntityResource(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 = etag; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets resource Etag. - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AzureResourceEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AzureResourceEntity.cs deleted file mode 100644 index 7fbe3af558223..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/AzureResourceEntity.cs +++ /dev/null @@ -1,98 +0,0 @@ -// -// 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 azure resource entity. - /// - [Newtonsoft.Json.JsonObject("AzureResource")] - [Rest.Serialization.JsonTransformation] - public partial class AzureResourceEntity : Entity - { - /// - /// Initializes a new instance of the AzureResourceEntity class. - /// - public AzureResourceEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AzureResourceEntity 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 azure resource id of the - /// resource - /// The subscription id of the - /// resource - public AzureResourceEntity(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 resourceId = default(string), string subscriptionId = default(string)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - ResourceId = resourceId; - SubscriptionId = subscriptionId; - 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 azure resource id of the resource - /// - [JsonProperty(PropertyName = "properties.resourceId")] - public string ResourceId { get; private set; } - - /// - /// Gets the subscription id of the resource - /// - [JsonProperty(PropertyName = "properties.subscriptionId")] - public string SubscriptionId { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Bookmark.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Bookmark.cs index 8b2f0342eb465..24573b469b66b 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Bookmark.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Bookmark.cs @@ -36,14 +36,9 @@ public Bookmark() /// /// The display name of the bookmark /// The query of the bookmark. - /// 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. + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// Etag of the azure resource /// The time the bookmark was created /// Describes a user that created the @@ -61,8 +56,8 @@ public Bookmark() /// The end time for the query /// Describes an incident that relates to /// bookmark - public Bookmark(string displayName, string query, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), System.DateTime? created = default(System.DateTime?), UserInfo createdBy = default(UserInfo), IList labels = default(IList), string notes = default(string), string queryResult = default(string), System.DateTime? updated = default(System.DateTime?), UserInfo updatedBy = default(UserInfo), System.DateTime? eventTime = default(System.DateTime?), System.DateTime? queryStartTime = default(System.DateTime?), System.DateTime? queryEndTime = default(System.DateTime?), IncidentInfo incidentInfo = default(IncidentInfo)) - : base(id, name, type, systemData, etag) + public Bookmark(string displayName, string query, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), System.DateTime? created = default(System.DateTime?), UserInfo createdBy = default(UserInfo), IList labels = default(IList), string notes = default(string), string queryResult = default(string), System.DateTime? updated = default(System.DateTime?), UserInfo updatedBy = default(UserInfo), System.DateTime? eventTime = default(System.DateTime?), System.DateTime? queryStartTime = default(System.DateTime?), System.DateTime? queryEndTime = default(System.DateTime?), IncidentInfo incidentInfo = default(IncidentInfo)) + : base(id, name, type, etag) { Created = created; CreatedBy = createdBy; @@ -179,6 +174,14 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "Query"); } + if (CreatedBy != null) + { + CreatedBy.Validate(); + } + if (UpdatedBy != null) + { + UpdatedBy.Validate(); + } } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BookmarkExpandParameters.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BookmarkExpandParameters.cs deleted file mode 100644 index 49692692a3f75..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BookmarkExpandParameters.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// 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 parameters required to execute an expand operation on the given - /// bookmark. - /// - public partial class BookmarkExpandParameters - { - /// - /// Initializes a new instance of the BookmarkExpandParameters class. - /// - public BookmarkExpandParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BookmarkExpandParameters class. - /// - /// The end date filter, so the only expansion - /// results returned are before this date. - /// The Id of the expansion to - /// perform. - /// The start date filter, so the only - /// expansion results returned are after this date. - public BookmarkExpandParameters(System.DateTime? endTime = default(System.DateTime?), System.Guid? expansionId = default(System.Guid?), System.DateTime? startTime = default(System.DateTime?)) - { - EndTime = endTime; - ExpansionId = expansionId; - StartTime = startTime; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the end date filter, so the only expansion results - /// returned are before this date. - /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; set; } - - /// - /// Gets or sets the Id of the expansion to perform. - /// - [JsonProperty(PropertyName = "expansionId")] - public System.Guid? ExpansionId { get; set; } - - /// - /// Gets or sets the start date filter, so the only expansion results - /// returned are after this date. - /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BookmarkExpandResponse.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BookmarkExpandResponse.cs deleted file mode 100644 index 1d0025851f089..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BookmarkExpandResponse.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// 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 entity expansion result operation response. - /// - public partial class BookmarkExpandResponse - { - /// - /// Initializes a new instance of the BookmarkExpandResponse class. - /// - public BookmarkExpandResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BookmarkExpandResponse class. - /// - /// The metadata from the expansion operation - /// results. - /// The expansion result values. - public BookmarkExpandResponse(ExpansionResultsMetadata metaData = default(ExpansionResultsMetadata), BookmarkExpandResponseValue value = default(BookmarkExpandResponseValue)) - { - MetaData = metaData; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the metadata from the expansion operation results. - /// - [JsonProperty(PropertyName = "metaData")] - public ExpansionResultsMetadata MetaData { get; set; } - - /// - /// Gets or sets the expansion result values. - /// - [JsonProperty(PropertyName = "value")] - public BookmarkExpandResponseValue Value { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BookmarkExpandResponseValue.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BookmarkExpandResponseValue.cs deleted file mode 100644 index 528b47f0a0e0b..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BookmarkExpandResponseValue.cs +++ /dev/null @@ -1,65 +0,0 @@ -// -// 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 expansion result values. - /// - public partial class BookmarkExpandResponseValue - { - /// - /// Initializes a new instance of the BookmarkExpandResponseValue - /// class. - /// - public BookmarkExpandResponseValue() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BookmarkExpandResponseValue - /// class. - /// - /// Array of the expansion result - /// entities. - /// Array of expansion result connected - /// entities - public BookmarkExpandResponseValue(IList entities = default(IList), IList edges = default(IList)) - { - Entities = entities; - Edges = edges; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets array of the expansion result entities. - /// - [JsonProperty(PropertyName = "entities")] - public IList Entities { get; set; } - - /// - /// Gets or sets array of expansion result connected entities - /// - [JsonProperty(PropertyName = "edges")] - public IList Edges { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BookmarkTimelineItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BookmarkTimelineItem.cs deleted file mode 100644 index dc53041ebffa3..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/BookmarkTimelineItem.cs +++ /dev/null @@ -1,127 +0,0 @@ -// -// 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 bookmark timeline item. - /// - [Newtonsoft.Json.JsonObject("Bookmark")] - public partial class BookmarkTimelineItem : EntityTimelineItem - { - /// - /// Initializes a new instance of the BookmarkTimelineItem class. - /// - public BookmarkTimelineItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BookmarkTimelineItem class. - /// - /// The bookmark azure resource - /// id. - /// The bookmark display name. - /// The notes of the bookmark - /// The bookmark end time. - /// The bookmark start time. - /// The bookmark event time. - /// Describes a user that created the - /// bookmark - /// List of labels relevant to this - /// bookmark - public BookmarkTimelineItem(string azureResourceId, string displayName = default(string), string notes = default(string), System.DateTime? endTimeUtc = default(System.DateTime?), System.DateTime? startTimeUtc = default(System.DateTime?), System.DateTime? eventTime = default(System.DateTime?), UserInfo createdBy = default(UserInfo), IList labels = default(IList)) - { - AzureResourceId = azureResourceId; - DisplayName = displayName; - Notes = notes; - EndTimeUtc = endTimeUtc; - StartTimeUtc = startTimeUtc; - EventTime = eventTime; - CreatedBy = createdBy; - Labels = labels; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the bookmark azure resource id. - /// - [JsonProperty(PropertyName = "azureResourceId")] - public string AzureResourceId { get; set; } - - /// - /// Gets or sets the bookmark display name. - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the notes of the bookmark - /// - [JsonProperty(PropertyName = "notes")] - public string Notes { get; set; } - - /// - /// Gets or sets the bookmark end time. - /// - [JsonProperty(PropertyName = "endTimeUtc")] - public System.DateTime? EndTimeUtc { get; set; } - - /// - /// Gets or sets the bookmark start time. - /// - [JsonProperty(PropertyName = "startTimeUtc")] - public System.DateTime? StartTimeUtc { get; set; } - - /// - /// Gets or sets the bookmark event time. - /// - [JsonProperty(PropertyName = "eventTime")] - public System.DateTime? EventTime { get; set; } - - /// - /// Gets or sets describes a user that created the bookmark - /// - [JsonProperty(PropertyName = "createdBy")] - public UserInfo CreatedBy { get; set; } - - /// - /// Gets or sets list of labels relevant to this bookmark - /// - [JsonProperty(PropertyName = "labels")] - public IList Labels { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AzureResourceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AzureResourceId"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConfidenceLevel.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CaseSeverity.cs similarity index 59% rename from sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConfidenceLevel.cs rename to sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CaseSeverity.cs index 8cc0d1c0ca290..c6780bb5236a3 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConfidenceLevel.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CaseSeverity.cs @@ -12,22 +12,29 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { /// - /// Defines values for ConfidenceLevel. + /// Defines values for CaseSeverity. /// - public static class ConfidenceLevel + public static class CaseSeverity { /// - /// Unknown confidence, the is the default value + /// Critical severity /// - public const string Unknown = "Unknown"; + public const string Critical = "Critical"; /// - /// Low confidence, meaning we have some doubts this is indeed - /// malicious or part of an attack + /// High severity + /// + public const string High = "High"; + /// + /// Medium severity + /// + public const string Medium = "Medium"; + /// + /// Low severity /// public const string Low = "Low"; /// - /// High confidence that the alert is true positive malicious + /// Informational severity /// - public const string High = "High"; + public const string Informational = "Informational"; } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CloudApplicationEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CloudApplicationEntity.cs deleted file mode 100644 index e6d679a7d13ea..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CloudApplicationEntity.cs +++ /dev/null @@ -1,110 +0,0 @@ -// -// 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 cloud application entity. - /// - [Newtonsoft.Json.JsonObject("CloudApplication")] - [Rest.Serialization.JsonTransformation] - public partial class CloudApplicationEntity : Entity - { - /// - /// Initializes a new instance of the CloudApplicationEntity class. - /// - public CloudApplicationEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CloudApplicationEntity 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 technical identifier of the - /// application. - /// The name of the related cloud - /// application. - /// The user defined instance name of the - /// cloud application. It is often used to distinguish between several - /// applications of the same type that a customer has. - public CloudApplicationEntity(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary additionalData = default(IDictionary), string friendlyName = default(string), int? appId = default(int?), string appName = default(string), string instanceName = default(string)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - AppId = appId; - AppName = appName; - InstanceName = instanceName; - 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 technical identifier of the application. - /// - [JsonProperty(PropertyName = "properties.appId")] - public int? AppId { get; private set; } - - /// - /// Gets the name of the related cloud application. - /// - [JsonProperty(PropertyName = "properties.appName")] - public string AppName { get; private set; } - - /// - /// Gets the user defined instance name of the cloud application. It is - /// often used to distinguish between several applications of the same - /// type that a customer has. - /// - [JsonProperty(PropertyName = "properties.instanceName")] - public string InstanceName { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessApiPollingDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessApiPollingDataConnector.cs deleted file mode 100644 index 375f06f550993..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessApiPollingDataConnector.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents Codeless API Polling data connector. - /// - [Newtonsoft.Json.JsonObject("APIPolling")] - [Rest.Serialization.JsonTransformation] - public partial class CodelessApiPollingDataConnector : DataConnector - { - /// - /// Initializes a new instance of the CodelessApiPollingDataConnector - /// class. - /// - public CodelessApiPollingDataConnector() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CodelessApiPollingDataConnector - /// 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 - /// Config to describe the instructions - /// blade - /// Config to describe the polling - /// instructions - public CodelessApiPollingDataConnector(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), CodelessUiConnectorConfigProperties connectorUiConfig = default(CodelessUiConnectorConfigProperties), CodelessConnectorPollingConfigProperties pollingConfig = default(CodelessConnectorPollingConfigProperties)) - : base(id, name, type, systemData, etag) - { - ConnectorUiConfig = connectorUiConfig; - PollingConfig = pollingConfig; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets config to describe the instructions blade - /// - [JsonProperty(PropertyName = "properties.connectorUiConfig")] - public CodelessUiConnectorConfigProperties ConnectorUiConfig { get; set; } - - /// - /// Gets or sets config to describe the polling instructions - /// - [JsonProperty(PropertyName = "properties.pollingConfig")] - public CodelessConnectorPollingConfigProperties PollingConfig { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ConnectorUiConfig != null) - { - ConnectorUiConfig.Validate(); - } - if (PollingConfig != null) - { - PollingConfig.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingAuthProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingAuthProperties.cs deleted file mode 100644 index e354316669b36..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingAuthProperties.cs +++ /dev/null @@ -1,184 +0,0 @@ -// -// 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; - - /// - /// Describe the authentication properties needed to successfully - /// authenticate with the server - /// - public partial class CodelessConnectorPollingAuthProperties - { - /// - /// Initializes a new instance of the - /// CodelessConnectorPollingAuthProperties class. - /// - public CodelessConnectorPollingAuthProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CodelessConnectorPollingAuthProperties class. - /// - /// The authentication type - /// The header name which the token is sent - /// with - /// A prefix send in the header before - /// the actual token - /// Marks if the key should sent in - /// header - /// Describes the flow name, for example - /// 'AuthCode' for Oauth 2.0 - /// The endpoint used to issue a token, - /// used in Oauth 2.0 flow - /// The endpoint used to authorize - /// the user, used in Oauth 2.0 flow - /// The query - /// parameters used in authorization request, used in Oauth 2.0 - /// flow - /// The redirect endpoint where we - /// will get the authorization code, used in Oauth 2.0 flow - /// The query headers used in token - /// request, used in Oauth 2.0 flow - /// The query parameters - /// used in token request, used in Oauth 2.0 flow - /// Marks if we should send the - /// client secret in header or payload, used in Oauth 2.0 flow - /// The OAuth token scope - public CodelessConnectorPollingAuthProperties(string authType, string apiKeyName = default(string), string apiKeyIdentifier = default(string), string isApiKeyInPostPayload = default(string), string flowName = default(string), string tokenEndpoint = default(string), string authorizationEndpoint = default(string), object authorizationEndpointQueryParameters = default(object), string redirectionEndpoint = default(string), object tokenEndpointHeaders = default(object), object tokenEndpointQueryParameters = default(object), bool? isClientSecretInHeader = default(bool?), string scope = default(string)) - { - AuthType = authType; - ApiKeyName = apiKeyName; - ApiKeyIdentifier = apiKeyIdentifier; - IsApiKeyInPostPayload = isApiKeyInPostPayload; - FlowName = flowName; - TokenEndpoint = tokenEndpoint; - AuthorizationEndpoint = authorizationEndpoint; - AuthorizationEndpointQueryParameters = authorizationEndpointQueryParameters; - RedirectionEndpoint = redirectionEndpoint; - TokenEndpointHeaders = tokenEndpointHeaders; - TokenEndpointQueryParameters = tokenEndpointQueryParameters; - IsClientSecretInHeader = isClientSecretInHeader; - Scope = scope; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the authentication type - /// - [JsonProperty(PropertyName = "authType")] - public string AuthType { get; set; } - - /// - /// Gets or sets the header name which the token is sent with - /// - [JsonProperty(PropertyName = "apiKeyName")] - public string ApiKeyName { get; set; } - - /// - /// Gets or sets a prefix send in the header before the actual token - /// - [JsonProperty(PropertyName = "apiKeyIdentifier")] - public string ApiKeyIdentifier { get; set; } - - /// - /// Gets or sets marks if the key should sent in header - /// - [JsonProperty(PropertyName = "isApiKeyInPostPayload")] - public string IsApiKeyInPostPayload { get; set; } - - /// - /// Gets or sets describes the flow name, for example 'AuthCode' for - /// Oauth 2.0 - /// - [JsonProperty(PropertyName = "flowName")] - public string FlowName { get; set; } - - /// - /// Gets or sets the endpoint used to issue a token, used in Oauth 2.0 - /// flow - /// - [JsonProperty(PropertyName = "tokenEndpoint")] - public string TokenEndpoint { get; set; } - - /// - /// Gets or sets the endpoint used to authorize the user, used in Oauth - /// 2.0 flow - /// - [JsonProperty(PropertyName = "authorizationEndpoint")] - public string AuthorizationEndpoint { get; set; } - - /// - /// Gets or sets the query parameters used in authorization request, - /// used in Oauth 2.0 flow - /// - [JsonProperty(PropertyName = "authorizationEndpointQueryParameters")] - public object AuthorizationEndpointQueryParameters { get; set; } - - /// - /// Gets or sets the redirect endpoint where we will get the - /// authorization code, used in Oauth 2.0 flow - /// - [JsonProperty(PropertyName = "redirectionEndpoint")] - public string RedirectionEndpoint { get; set; } - - /// - /// Gets or sets the query headers used in token request, used in Oauth - /// 2.0 flow - /// - [JsonProperty(PropertyName = "tokenEndpointHeaders")] - public object TokenEndpointHeaders { get; set; } - - /// - /// Gets or sets the query parameters used in token request, used in - /// Oauth 2.0 flow - /// - [JsonProperty(PropertyName = "tokenEndpointQueryParameters")] - public object TokenEndpointQueryParameters { get; set; } - - /// - /// Gets or sets marks if we should send the client secret in header or - /// payload, used in Oauth 2.0 flow - /// - [JsonProperty(PropertyName = "isClientSecretInHeader")] - public bool? IsClientSecretInHeader { get; set; } - - /// - /// Gets or sets the OAuth token scope - /// - [JsonProperty(PropertyName = "scope")] - public string Scope { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AuthType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AuthType"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingConfigProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingConfigProperties.cs deleted file mode 100644 index 8ab895f121093..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingConfigProperties.cs +++ /dev/null @@ -1,124 +0,0 @@ -// -// 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; - - /// - /// Config to describe the polling config for API poller connector - /// - public partial class CodelessConnectorPollingConfigProperties - { - /// - /// Initializes a new instance of the - /// CodelessConnectorPollingConfigProperties class. - /// - public CodelessConnectorPollingConfigProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CodelessConnectorPollingConfigProperties class. - /// - /// Describe the authentication type of the - /// poller - /// Describe the poll request config parameters - /// of the poller - /// The poller active status - /// Describe the poll request paging config of the - /// poller - /// Describe the response config parameters of - /// the poller - public CodelessConnectorPollingConfigProperties(CodelessConnectorPollingAuthProperties auth, CodelessConnectorPollingRequestProperties request, bool? isActive = default(bool?), CodelessConnectorPollingPagingProperties paging = default(CodelessConnectorPollingPagingProperties), CodelessConnectorPollingResponseProperties response = default(CodelessConnectorPollingResponseProperties)) - { - IsActive = isActive; - Auth = auth; - Request = request; - Paging = paging; - Response = response; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the poller active status - /// - [JsonProperty(PropertyName = "isActive")] - public bool? IsActive { get; set; } - - /// - /// Gets or sets describe the authentication type of the poller - /// - [JsonProperty(PropertyName = "auth")] - public CodelessConnectorPollingAuthProperties Auth { get; set; } - - /// - /// Gets or sets describe the poll request config parameters of the - /// poller - /// - [JsonProperty(PropertyName = "request")] - public CodelessConnectorPollingRequestProperties Request { get; set; } - - /// - /// Gets or sets describe the poll request paging config of the poller - /// - [JsonProperty(PropertyName = "paging")] - public CodelessConnectorPollingPagingProperties Paging { get; set; } - - /// - /// Gets or sets describe the response config parameters of the poller - /// - [JsonProperty(PropertyName = "response")] - public CodelessConnectorPollingResponseProperties Response { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Auth == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Auth"); - } - if (Request == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Request"); - } - if (Auth != null) - { - Auth.Validate(); - } - if (Request != null) - { - Request.Validate(); - } - if (Paging != null) - { - Paging.Validate(); - } - if (Response != null) - { - Response.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingPagingProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingPagingProperties.cs deleted file mode 100644 index 3a763555d31de..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingPagingProperties.cs +++ /dev/null @@ -1,142 +0,0 @@ -// -// 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; - - /// - /// Describe the properties needed to make a pagination call - /// - public partial class CodelessConnectorPollingPagingProperties - { - /// - /// Initializes a new instance of the - /// CodelessConnectorPollingPagingProperties class. - /// - public CodelessConnectorPollingPagingProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CodelessConnectorPollingPagingProperties class. - /// - /// Describes the type. could be 'None', - /// 'PageToken', 'PageCount', 'TimeStamp' - /// Defines the name of a next page - /// attribute - /// Defines the path to a next page - /// token JSON - /// Defines the path to a page - /// count attribute - /// Defines the path to a - /// page total count attribute - /// Defines the path to a - /// paging time stamp attribute - /// Determines - /// whether to search for the latest time stamp in the events - /// list - /// Defines the name of the page size - /// parameter - /// Defines the paging size - public CodelessConnectorPollingPagingProperties(string pagingType, string nextPageParaName = default(string), string nextPageTokenJsonPath = default(string), string pageCountAttributePath = default(string), string pageTotalCountAttributePath = default(string), string pageTimeStampAttributePath = default(string), string searchTheLatestTimeStampFromEventsList = default(string), string pageSizeParaName = default(string), int? pageSize = default(int?)) - { - PagingType = pagingType; - NextPageParaName = nextPageParaName; - NextPageTokenJsonPath = nextPageTokenJsonPath; - PageCountAttributePath = pageCountAttributePath; - PageTotalCountAttributePath = pageTotalCountAttributePath; - PageTimeStampAttributePath = pageTimeStampAttributePath; - SearchTheLatestTimeStampFromEventsList = searchTheLatestTimeStampFromEventsList; - PageSizeParaName = pageSizeParaName; - PageSize = pageSize; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets describes the type. could be 'None', 'PageToken', - /// 'PageCount', 'TimeStamp' - /// - [JsonProperty(PropertyName = "pagingType")] - public string PagingType { get; set; } - - /// - /// Gets or sets defines the name of a next page attribute - /// - [JsonProperty(PropertyName = "nextPageParaName")] - public string NextPageParaName { get; set; } - - /// - /// Gets or sets defines the path to a next page token JSON - /// - [JsonProperty(PropertyName = "nextPageTokenJsonPath")] - public string NextPageTokenJsonPath { get; set; } - - /// - /// Gets or sets defines the path to a page count attribute - /// - [JsonProperty(PropertyName = "pageCountAttributePath")] - public string PageCountAttributePath { get; set; } - - /// - /// Gets or sets defines the path to a page total count attribute - /// - [JsonProperty(PropertyName = "pageTotalCountAttributePath")] - public string PageTotalCountAttributePath { get; set; } - - /// - /// Gets or sets defines the path to a paging time stamp attribute - /// - [JsonProperty(PropertyName = "pageTimeStampAttributePath")] - public string PageTimeStampAttributePath { get; set; } - - /// - /// Gets or sets determines whether to search for the latest time stamp - /// in the events list - /// - [JsonProperty(PropertyName = "searchTheLatestTimeStampFromEventsList")] - public string SearchTheLatestTimeStampFromEventsList { get; set; } - - /// - /// Gets or sets defines the name of the page size parameter - /// - [JsonProperty(PropertyName = "pageSizeParaName")] - public string PageSizeParaName { get; set; } - - /// - /// Gets or sets defines the paging size - /// - [JsonProperty(PropertyName = "pageSize")] - public int? PageSize { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (PagingType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "PagingType"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingRequestProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingRequestProperties.cs deleted file mode 100644 index 3f3860246f4cc..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingRequestProperties.cs +++ /dev/null @@ -1,182 +0,0 @@ -// -// 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; - - /// - /// Describe the request properties needed to successfully pull from the - /// server - /// - public partial class CodelessConnectorPollingRequestProperties - { - /// - /// Initializes a new instance of the - /// CodelessConnectorPollingRequestProperties class. - /// - public CodelessConnectorPollingRequestProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CodelessConnectorPollingRequestProperties class. - /// - /// Describe the endpoint we should pull the - /// data from - /// The window interval we will use the - /// pull the data - /// The http method type we will use in the - /// poll request, GET or POST - /// The time format will be used the - /// query events in a specific window - /// Defines the rate limit QPS - /// Describe the amount of time we should try - /// and poll the data in case of failure - /// The number of seconds we will - /// consider as a request timeout - /// Describe the headers sent in the poll - /// request - /// Describe the query parameters sent in - /// the poll request - /// For advanced scenarios for - /// example user name/password embedded in nested JSON payload - /// This will be used the query - /// events from a start of the time window - /// This will be used the query - /// events from the end of the time window - public CodelessConnectorPollingRequestProperties(string apiEndpoint, int queryWindowInMin, string httpMethod, string queryTimeFormat, int? rateLimitQps = default(int?), int? retryCount = default(int?), int? timeoutInSeconds = default(int?), object headers = default(object), object queryParameters = default(object), string queryParametersTemplate = default(string), string startTimeAttributeName = default(string), string endTimeAttributeName = default(string)) - { - ApiEndpoint = apiEndpoint; - RateLimitQps = rateLimitQps; - QueryWindowInMin = queryWindowInMin; - HttpMethod = httpMethod; - QueryTimeFormat = queryTimeFormat; - RetryCount = retryCount; - TimeoutInSeconds = timeoutInSeconds; - Headers = headers; - QueryParameters = queryParameters; - QueryParametersTemplate = queryParametersTemplate; - StartTimeAttributeName = startTimeAttributeName; - EndTimeAttributeName = endTimeAttributeName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets describe the endpoint we should pull the data from - /// - [JsonProperty(PropertyName = "apiEndpoint")] - public string ApiEndpoint { get; set; } - - /// - /// Gets or sets defines the rate limit QPS - /// - [JsonProperty(PropertyName = "rateLimitQps")] - public int? RateLimitQps { get; set; } - - /// - /// Gets or sets the window interval we will use the pull the data - /// - [JsonProperty(PropertyName = "queryWindowInMin")] - public int QueryWindowInMin { get; set; } - - /// - /// Gets or sets the http method type we will use in the poll request, - /// GET or POST - /// - [JsonProperty(PropertyName = "httpMethod")] - public string HttpMethod { get; set; } - - /// - /// Gets or sets the time format will be used the query events in a - /// specific window - /// - [JsonProperty(PropertyName = "queryTimeFormat")] - public string QueryTimeFormat { get; set; } - - /// - /// Gets or sets describe the amount of time we should try and poll the - /// data in case of failure - /// - [JsonProperty(PropertyName = "retryCount")] - public int? RetryCount { get; set; } - - /// - /// Gets or sets the number of seconds we will consider as a request - /// timeout - /// - [JsonProperty(PropertyName = "timeoutInSeconds")] - public int? TimeoutInSeconds { get; set; } - - /// - /// Gets or sets describe the headers sent in the poll request - /// - [JsonProperty(PropertyName = "headers")] - public object Headers { get; set; } - - /// - /// Gets or sets describe the query parameters sent in the poll request - /// - [JsonProperty(PropertyName = "queryParameters")] - public object QueryParameters { get; set; } - - /// - /// Gets or sets for advanced scenarios for example user name/password - /// embedded in nested JSON payload - /// - [JsonProperty(PropertyName = "queryParametersTemplate")] - public string QueryParametersTemplate { get; set; } - - /// - /// Gets or sets this will be used the query events from a start of the - /// time window - /// - [JsonProperty(PropertyName = "startTimeAttributeName")] - public string StartTimeAttributeName { get; set; } - - /// - /// Gets or sets this will be used the query events from the end of the - /// time window - /// - [JsonProperty(PropertyName = "endTimeAttributeName")] - public string EndTimeAttributeName { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ApiEndpoint == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ApiEndpoint"); - } - if (HttpMethod == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "HttpMethod"); - } - if (QueryTimeFormat == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "QueryTimeFormat"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingResponseProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingResponseProperties.cs deleted file mode 100644 index a319eac6737fe..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessConnectorPollingResponseProperties.cs +++ /dev/null @@ -1,100 +0,0 @@ -// -// 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; - - /// - /// Describes the response from the external server - /// - public partial class CodelessConnectorPollingResponseProperties - { - /// - /// Initializes a new instance of the - /// CodelessConnectorPollingResponseProperties class. - /// - public CodelessConnectorPollingResponseProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CodelessConnectorPollingResponseProperties class. - /// - /// Describes the path we should extract - /// the data in the response - /// Describes the path we should - /// extract the status code in the response - /// Describes the path we should - /// extract the status value in the response - /// Describes if the data in the - /// response is Gzip - public CodelessConnectorPollingResponseProperties(IList eventsJsonPaths, string successStatusJsonPath = default(string), string successStatusValue = default(string), bool? isGzipCompressed = default(bool?)) - { - EventsJsonPaths = eventsJsonPaths; - SuccessStatusJsonPath = successStatusJsonPath; - SuccessStatusValue = successStatusValue; - IsGzipCompressed = isGzipCompressed; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets describes the path we should extract the data in the - /// response - /// - [JsonProperty(PropertyName = "eventsJsonPaths")] - public IList EventsJsonPaths { get; set; } - - /// - /// Gets or sets describes the path we should extract the status code - /// in the response - /// - [JsonProperty(PropertyName = "successStatusJsonPath")] - public string SuccessStatusJsonPath { get; set; } - - /// - /// Gets or sets describes the path we should extract the status value - /// in the response - /// - [JsonProperty(PropertyName = "successStatusValue")] - public string SuccessStatusValue { get; set; } - - /// - /// Gets or sets describes if the data in the response is Gzip - /// - [JsonProperty(PropertyName = "isGzipCompressed")] - public bool? IsGzipCompressed { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (EventsJsonPaths == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "EventsJsonPaths"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiConnectorConfigProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiConnectorConfigProperties.cs deleted file mode 100644 index 39c3032f73c86..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiConnectorConfigProperties.cs +++ /dev/null @@ -1,208 +0,0 @@ -// -// 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; - - /// - /// Config to describe the instructions blade - /// - public partial class CodelessUiConnectorConfigProperties - { - /// - /// Initializes a new instance of the - /// CodelessUiConnectorConfigProperties class. - /// - public CodelessUiConnectorConfigProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CodelessUiConnectorConfigProperties class. - /// - /// Connector blade title - /// Connector publisher name - /// Connector description - /// Name of the table the connector - /// will insert the data to - /// The graph query to show the current data - /// status - /// The sample queries for the - /// connector - /// Data types to check for last data - /// received - /// Define the way the connector - /// check connectivity - /// Connector Availability Status - /// Permissions required for the - /// connector - /// Instruction steps to enable the - /// connector - /// An optional custom image to be used when - /// displaying the connector within Azure Sentinel's connector's - /// gallery - public CodelessUiConnectorConfigProperties(string title, string publisher, string descriptionMarkdown, string graphQueriesTableName, IList graphQueries, IList sampleQueries, IList dataTypes, IList connectivityCriteria, Availability availability, Permissions permissions, IList instructionSteps, string customImage = default(string)) - { - Title = title; - Publisher = publisher; - DescriptionMarkdown = descriptionMarkdown; - CustomImage = customImage; - GraphQueriesTableName = graphQueriesTableName; - GraphQueries = graphQueries; - SampleQueries = sampleQueries; - DataTypes = dataTypes; - ConnectivityCriteria = connectivityCriteria; - Availability = availability; - Permissions = permissions; - InstructionSteps = instructionSteps; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets connector blade title - /// - [JsonProperty(PropertyName = "title")] - public string Title { get; set; } - - /// - /// Gets or sets connector publisher name - /// - [JsonProperty(PropertyName = "publisher")] - public string Publisher { get; set; } - - /// - /// Gets or sets connector description - /// - [JsonProperty(PropertyName = "descriptionMarkdown")] - public string DescriptionMarkdown { get; set; } - - /// - /// Gets or sets an optional custom image to be used when displaying - /// the connector within Azure Sentinel's connector's gallery - /// - [JsonProperty(PropertyName = "customImage")] - public string CustomImage { get; set; } - - /// - /// Gets or sets name of the table the connector will insert the data - /// to - /// - [JsonProperty(PropertyName = "graphQueriesTableName")] - public string GraphQueriesTableName { get; set; } - - /// - /// Gets or sets the graph query to show the current data status - /// - [JsonProperty(PropertyName = "graphQueries")] - public IList GraphQueries { get; set; } - - /// - /// Gets or sets the sample queries for the connector - /// - [JsonProperty(PropertyName = "sampleQueries")] - public IList SampleQueries { get; set; } - - /// - /// Gets or sets data types to check for last data received - /// - [JsonProperty(PropertyName = "dataTypes")] - public IList DataTypes { get; set; } - - /// - /// Gets or sets define the way the connector check connectivity - /// - [JsonProperty(PropertyName = "connectivityCriteria")] - public IList ConnectivityCriteria { get; set; } - - /// - /// Gets or sets connector Availability Status - /// - [JsonProperty(PropertyName = "availability")] - public Availability Availability { get; set; } - - /// - /// Gets or sets permissions required for the connector - /// - [JsonProperty(PropertyName = "permissions")] - public Permissions Permissions { get; set; } - - /// - /// Gets or sets instruction steps to enable the connector - /// - [JsonProperty(PropertyName = "instructionSteps")] - public IList InstructionSteps { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Title == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Title"); - } - if (Publisher == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Publisher"); - } - if (DescriptionMarkdown == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DescriptionMarkdown"); - } - if (GraphQueriesTableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "GraphQueriesTableName"); - } - if (GraphQueries == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "GraphQueries"); - } - if (SampleQueries == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SampleQueries"); - } - if (DataTypes == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataTypes"); - } - if (ConnectivityCriteria == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ConnectivityCriteria"); - } - if (Availability == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Availability"); - } - if (Permissions == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Permissions"); - } - if (InstructionSteps == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "InstructionSteps"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.cs deleted file mode 100644 index 896db48d07f0d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// 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.Collections; - using System.Collections.Generic; - using System.Linq; - - public partial class CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem : ConnectivityCriteria - { - /// - /// Initializes a new instance of the - /// CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem class. - /// - public CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem class. - /// - /// type of connectivity. Possible values include: - /// 'IsConnectedQuery' - /// Queries for checking connectivity - public CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem(string type = default(string), IList value = default(IList)) - : base(type, value) - { - 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/CodelessUiConnectorConfigPropertiesDataTypesItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiConnectorConfigPropertiesDataTypesItem.cs deleted file mode 100644 index 17ae577886451..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiConnectorConfigPropertiesDataTypesItem.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// 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 CodelessUiConnectorConfigPropertiesDataTypesItem : LastDataReceivedDataType - { - /// - /// Initializes a new instance of the - /// CodelessUiConnectorConfigPropertiesDataTypesItem class. - /// - public CodelessUiConnectorConfigPropertiesDataTypesItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CodelessUiConnectorConfigPropertiesDataTypesItem class. - /// - /// Name of the data type to show in the graph. can - /// be use with {{graphQueriesTableName}} placeholder - /// Query for indicate last data - /// received - public CodelessUiConnectorConfigPropertiesDataTypesItem(string name = default(string), string lastDataReceivedQuery = default(string)) - : base(name, lastDataReceivedQuery) - { - 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/CodelessUiConnectorConfigPropertiesGraphQueriesItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiConnectorConfigPropertiesGraphQueriesItem.cs deleted file mode 100644 index 0f533610c63cb..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiConnectorConfigPropertiesGraphQueriesItem.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// 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 CodelessUiConnectorConfigPropertiesGraphQueriesItem : GraphQueries - { - /// - /// Initializes a new instance of the - /// CodelessUiConnectorConfigPropertiesGraphQueriesItem class. - /// - public CodelessUiConnectorConfigPropertiesGraphQueriesItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CodelessUiConnectorConfigPropertiesGraphQueriesItem class. - /// - /// the metric that the query is - /// checking - /// The legend for the graph - /// The base query for the graph - public CodelessUiConnectorConfigPropertiesGraphQueriesItem(string metricName = default(string), string legend = default(string), string baseQuery = default(string)) - : base(metricName, legend, baseQuery) - { - 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/CodelessUiConnectorConfigPropertiesInstructionStepsItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiConnectorConfigPropertiesInstructionStepsItem.cs deleted file mode 100644 index 8344fd1795907..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiConnectorConfigPropertiesInstructionStepsItem.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// 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.Collections; - using System.Collections.Generic; - using System.Linq; - - public partial class CodelessUiConnectorConfigPropertiesInstructionStepsItem : InstructionSteps - { - /// - /// Initializes a new instance of the - /// CodelessUiConnectorConfigPropertiesInstructionStepsItem class. - /// - public CodelessUiConnectorConfigPropertiesInstructionStepsItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CodelessUiConnectorConfigPropertiesInstructionStepsItem class. - /// - /// Instruction step title - /// Instruction step description - /// Instruction step details - public CodelessUiConnectorConfigPropertiesInstructionStepsItem(string title = default(string), string description = default(string), IList instructions = default(IList)) - : base(title, description, instructions) - { - 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/CodelessUiConnectorConfigPropertiesSampleQueriesItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiConnectorConfigPropertiesSampleQueriesItem.cs deleted file mode 100644 index 3c41833cdc014..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiConnectorConfigPropertiesSampleQueriesItem.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// 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 CodelessUiConnectorConfigPropertiesSampleQueriesItem : SampleQueries - { - /// - /// Initializes a new instance of the - /// CodelessUiConnectorConfigPropertiesSampleQueriesItem class. - /// - public CodelessUiConnectorConfigPropertiesSampleQueriesItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// CodelessUiConnectorConfigPropertiesSampleQueriesItem class. - /// - /// The sample query description - /// the sample query - public CodelessUiConnectorConfigPropertiesSampleQueriesItem(string description = default(string), string query = default(string)) - : base(description, query) - { - 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/CodelessUiDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiDataConnector.cs deleted file mode 100644 index 322e5adea866f..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CodelessUiDataConnector.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents Codeless UI data connector. - /// - [Newtonsoft.Json.JsonObject("GenericUI")] - [Rest.Serialization.JsonTransformation] - public partial class CodelessUiDataConnector : DataConnector - { - /// - /// Initializes a new instance of the CodelessUiDataConnector class. - /// - public CodelessUiDataConnector() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CodelessUiDataConnector 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 - /// Config to describe the instructions - /// blade - public CodelessUiDataConnector(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), CodelessUiConnectorConfigProperties connectorUiConfig = default(CodelessUiConnectorConfigProperties)) - : base(id, name, type, systemData, etag) - { - ConnectorUiConfig = connectorUiConfig; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets config to describe the instructions blade - /// - [JsonProperty(PropertyName = "properties.connectorUiConfig")] - public CodelessUiConnectorConfigProperties ConnectorUiConfig { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ConnectorUiConfig != null) - { - ConnectorUiConfig.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConfidenceScoreStatus.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConfidenceScoreStatus.cs deleted file mode 100644 index 954928060d6cc..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConfidenceScoreStatus.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// 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 ConfidenceScoreStatus. - /// - public static class ConfidenceScoreStatus - { - /// - /// Score will not be calculated for this alert as it is not supported - /// by virtual analyst - /// - public const string NotApplicable = "NotApplicable"; - /// - /// No score was set yet and calculation is in progress - /// - public const string InProcess = "InProcess"; - /// - /// Score is calculated and shown as part of the alert, but may be - /// updated again at a later time following the processing of - /// additional data - /// - public const string NotFinal = "NotFinal"; - /// - /// Final score was calculated and available - /// - public const string Final = "Final"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectAuthKind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectAuthKind.cs deleted file mode 100644 index cd386e546aff9..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectAuthKind.cs +++ /dev/null @@ -1,23 +0,0 @@ -// -// 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 ConnectAuthKind. - /// - public static class ConnectAuthKind - { - public const string Basic = "Basic"; - public const string OAuth2 = "OAuth2"; - public const string APIKey = "APIKey"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectedEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectedEntity.cs deleted file mode 100644 index 95b71f80e37a4..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectedEntity.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// 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; - - /// - /// Expansion result connected entities - /// - public partial class ConnectedEntity - { - /// - /// Initializes a new instance of the ConnectedEntity class. - /// - public ConnectedEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ConnectedEntity class. - /// - /// Entity Id of the connected - /// entity - /// key-value pairs for a connected entity - /// mapping - public ConnectedEntity(string targetEntityId = default(string), object additionalData = default(object)) - { - TargetEntityId = targetEntityId; - AdditionalData = additionalData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets entity Id of the connected entity - /// - [JsonProperty(PropertyName = "targetEntityId")] - public string TargetEntityId { get; set; } - - /// - /// Gets or sets key-value pairs for a connected entity mapping - /// - [JsonProperty(PropertyName = "additionalData")] - public object AdditionalData { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectivityCriteria.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectivityCriteria.cs deleted file mode 100644 index 1d906edbff876..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectivityCriteria.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// 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; - - /// - /// Setting for the connector check connectivity - /// - public partial class ConnectivityCriteria - { - /// - /// Initializes a new instance of the ConnectivityCriteria class. - /// - public ConnectivityCriteria() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ConnectivityCriteria class. - /// - /// type of connectivity. Possible values include: - /// 'IsConnectedQuery' - /// Queries for checking connectivity - public ConnectivityCriteria(string type = default(string), IList value = default(IList)) - { - Type = type; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets type of connectivity. Possible values include: - /// 'IsConnectedQuery' - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets queries for checking connectivity - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectorInstructionModelBase.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectorInstructionModelBase.cs deleted file mode 100644 index 00f58006eec1d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectorInstructionModelBase.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// 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; - - /// - /// Instruction step details - /// - public partial class ConnectorInstructionModelBase - { - /// - /// Initializes a new instance of the ConnectorInstructionModelBase - /// class. - /// - public ConnectorInstructionModelBase() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ConnectorInstructionModelBase - /// class. - /// - /// The kind of the setting. Possible values - /// include: 'CopyableLabel', 'InstructionStepsGroup', - /// 'InfoMessage' - /// The parameters for the setting - public ConnectorInstructionModelBase(string type, object parameters = default(object)) - { - Parameters = parameters; - Type = type; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the parameters for the setting - /// - [JsonProperty(PropertyName = "parameters")] - public object Parameters { get; set; } - - /// - /// Gets or sets the kind of the setting. Possible values include: - /// 'CopyableLabel', 'InstructionStepsGroup', 'InfoMessage' - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Type == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Type"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ContentPathMap.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ContentPathMap.cs deleted file mode 100644 index 2582dea1203b4..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ContentPathMap.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// 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 mapping of content type to a repo path. - /// - public partial class ContentPathMap - { - /// - /// Initializes a new instance of the ContentPathMap class. - /// - public ContentPathMap() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ContentPathMap class. - /// - /// Content type. Possible values include: - /// 'AnalyticRule', 'Workbook' - /// The path to the content. - public ContentPathMap(string contentType = default(string), string path = default(string)) - { - ContentType = contentType; - Path = path; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets content type. Possible values include: 'AnalyticRule', - /// 'Workbook' - /// - [JsonProperty(PropertyName = "contentType")] - public string ContentType { get; set; } - - /// - /// Gets or sets the path to the content. - /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ContentType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ContentType.cs deleted file mode 100644 index d8b28b7c6b7fb..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ContentType.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -// 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 ContentType. - /// - public static class ContentType - { - public const string AnalyticRule = "AnalyticRule"; - public const string Workbook = "Workbook"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CreatedByType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CreatedByType.cs deleted file mode 100644 index 3cd5fb995c533..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CreatedByType.cs +++ /dev/null @@ -1,24 +0,0 @@ -// -// 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 CreatedByType. - /// - public static class CreatedByType - { - public const string User = "User"; - public const string Application = "Application"; - public const string ManagedIdentity = "ManagedIdentity"; - public const string Key = "Key"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CustomEntityQuery.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CustomEntityQuery.cs deleted file mode 100644 index f7749fa7514bb..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CustomEntityQuery.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// 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; - - /// - /// Specific entity query that supports put requests. - /// - public partial class CustomEntityQuery : ResourceWithEtag - { - /// - /// Initializes a new instance of the CustomEntityQuery class. - /// - public CustomEntityQuery() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CustomEntityQuery 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 CustomEntityQuery(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/Customs.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Customs.cs deleted file mode 100644 index fb60cd1168895..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Customs.cs +++ /dev/null @@ -1,45 +0,0 @@ -// -// 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; - - /// - /// Customs permissions required for the connector - /// - public partial class Customs : CustomsPermission - { - /// - /// Initializes a new instance of the Customs class. - /// - public Customs() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Customs class. - /// - /// Customs permissions name - /// Customs permissions description - public Customs(string name = default(string), string description = default(string)) - : base(name, description) - { - 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/CustomsPermission.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CustomsPermission.cs deleted file mode 100644 index 6d503f1cf0c30..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CustomsPermission.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// 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; - - /// - /// Customs permissions required for the connector - /// - public partial class CustomsPermission - { - /// - /// Initializes a new instance of the CustomsPermission class. - /// - public CustomsPermission() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CustomsPermission class. - /// - /// Customs permissions name - /// Customs permissions description - public CustomsPermission(string name = default(string), string description = default(string)) - { - Name = name; - Description = description; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets customs permissions name - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets customs permissions description - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnector.cs index c6aeaefdb1a43..41ea4bba92e3e 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnector.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnector.cs @@ -13,7 +13,7 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models using System.Linq; /// - /// Data connector + /// Data connector. /// public partial class DataConnector : ResourceWithEtag { @@ -28,17 +28,12 @@ public DataConnector() /// /// Initializes a new instance of the DataConnector 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. + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// Etag of the azure resource - public DataConnector(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) + public DataConnector(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + : base(id, name, type, etag) { CustomInit(); } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorAuthorizationState.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorAuthorizationState.cs deleted file mode 100644 index 2a43f735cd076..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorAuthorizationState.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -// 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 DataConnectorAuthorizationState. - /// - public static class DataConnectorAuthorizationState - { - public const string Valid = "Valid"; - public const string Invalid = "Invalid"; - } -} 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 deleted file mode 100644 index a188ff4b082c0..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorConnectBody.cs +++ /dev/null @@ -1,115 +0,0 @@ -// -// 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; - - /// - /// Represents Codeless API Polling data connector. - /// - public partial class DataConnectorConnectBody - { - /// - /// Initializes a new instance of the DataConnectorConnectBody class. - /// - public DataConnectorConnectBody() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DataConnectorConnectBody class. - /// - /// The authentication kind used to poll the data. - /// Possible values include: 'Basic', 'OAuth2', 'APIKey' - /// The API key of the audit server. - /// The client secret of the OAuth 2.0 - /// application. - /// The client id of the OAuth 2.0 - /// application. - /// The authorization code used in - /// OAuth 2.0 code flow to issue a token. - /// The user name in the audit log - /// 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)) - { - Kind = kind; - ApiKey = apiKey; - ClientSecret = clientSecret; - ClientId = clientId; - AuthorizationCode = authorizationCode; - UserName = userName; - Password = password; - RequestConfigUserInputValues = requestConfigUserInputValues; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the authentication kind used to poll the data. - /// Possible values include: 'Basic', 'OAuth2', 'APIKey' - /// - [JsonProperty(PropertyName = "kind")] - public string Kind { get; set; } - - /// - /// Gets or sets the API key of the audit server. - /// - [JsonProperty(PropertyName = "apiKey")] - public string ApiKey { get; set; } - - /// - /// Gets or sets the client secret of the OAuth 2.0 application. - /// - [JsonProperty(PropertyName = "clientSecret")] - public string ClientSecret { get; set; } - - /// - /// Gets or sets the client id of the OAuth 2.0 application. - /// - [JsonProperty(PropertyName = "clientId")] - public string ClientId { get; set; } - - /// - /// Gets or sets the authorization code used in OAuth 2.0 code flow to - /// issue a token. - /// - [JsonProperty(PropertyName = "authorizationCode")] - public string AuthorizationCode { get; set; } - - /// - /// Gets or sets the user name in the audit log server. - /// - [JsonProperty(PropertyName = "userName")] - public string UserName { get; set; } - - /// - /// Gets or sets the user password in the audit log server. - /// - [JsonProperty(PropertyName = "password")] - public string Password { get; set; } - - /// - /// - [JsonProperty(PropertyName = "requestConfigUserInputValues")] - public IList RequestConfigUserInputValues { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorDataTypeCommon.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorDataTypeCommon.cs index b02c3130bd20b..322fd804d6c76 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorDataTypeCommon.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorDataTypeCommon.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -35,7 +34,7 @@ public DataConnectorDataTypeCommon() /// Describe whether this data type connection is /// enabled or not. Possible values include: 'Enabled', /// 'Disabled' - public DataConnectorDataTypeCommon(string state) + public DataConnectorDataTypeCommon(string state = default(string)) { State = state; CustomInit(); @@ -53,18 +52,5 @@ public DataConnectorDataTypeCommon(string state) [JsonProperty(PropertyName = "state")] public string State { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (State == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "State"); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorKind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorKind.cs index ef6b891acd5dd..6db67ec03c55b 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorKind.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorKind.cs @@ -20,18 +20,9 @@ public static class DataConnectorKind public const string AzureSecurityCenter = "AzureSecurityCenter"; public const string MicrosoftCloudAppSecurity = "MicrosoftCloudAppSecurity"; public const string ThreatIntelligence = "ThreatIntelligence"; - public const string ThreatIntelligenceTaxii = "ThreatIntelligenceTaxii"; public const string Office365 = "Office365"; - public const string OfficeATP = "OfficeATP"; - public const string OfficeIRM = "OfficeIRM"; public const string AmazonWebServicesCloudTrail = "AmazonWebServicesCloudTrail"; - public const string AmazonWebServicesS3 = "AmazonWebServicesS3"; public const string AzureAdvancedThreatProtection = "AzureAdvancedThreatProtection"; public const string MicrosoftDefenderAdvancedThreatProtection = "MicrosoftDefenderAdvancedThreatProtection"; - public const string Dynamics365 = "Dynamics365"; - public const string MicrosoftThreatProtection = "MicrosoftThreatProtection"; - public const string MicrosoftThreatIntelligence = "MicrosoftThreatIntelligence"; - public const string GenericUI = "GenericUI"; - public const string APIPolling = "APIPolling"; } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorLicenseState.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorLicenseState.cs deleted file mode 100644 index 231fab963a022..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorLicenseState.cs +++ /dev/null @@ -1,23 +0,0 @@ -// -// 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 DataConnectorLicenseState. - /// - public static class DataConnectorLicenseState - { - public const string Valid = "Valid"; - public const string Invalid = "Invalid"; - public const string Unknown = "Unknown"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorRequirementsState.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorRequirementsState.cs deleted file mode 100644 index a213cdd5427eb..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorRequirementsState.cs +++ /dev/null @@ -1,65 +0,0 @@ -// -// 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; - - /// - /// Data connector requirements status. - /// - public partial class DataConnectorRequirementsState - { - /// - /// Initializes a new instance of the DataConnectorRequirementsState - /// class. - /// - public DataConnectorRequirementsState() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DataConnectorRequirementsState - /// class. - /// - /// Authorization state for this - /// connector. Possible values include: 'Valid', 'Invalid' - /// License state for this connector. - /// Possible values include: 'Valid', 'Invalid', 'Unknown' - public DataConnectorRequirementsState(string authorizationState = default(string), string licenseState = default(string)) - { - AuthorizationState = authorizationState; - LicenseState = licenseState; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets authorization state for this connector. Possible - /// values include: 'Valid', 'Invalid' - /// - [JsonProperty(PropertyName = "authorizationState")] - public string AuthorizationState { get; set; } - - /// - /// Gets or sets license state for this connector. Possible values - /// include: 'Valid', 'Invalid', 'Unknown' - /// - [JsonProperty(PropertyName = "licenseState")] - public string LicenseState { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorTenantId.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorTenantId.cs index 05f76fd6c7675..58c3b3457f4c1 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorTenantId.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorTenantId.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -32,7 +31,7 @@ public DataConnectorTenantId() /// /// The tenant id to connect to, and get the /// data from. - public DataConnectorTenantId(string tenantId) + public DataConnectorTenantId(string tenantId = default(string)) { TenantId = tenantId; CustomInit(); @@ -49,18 +48,5 @@ public DataConnectorTenantId(string tenantId) [JsonProperty(PropertyName = "tenantId")] public string TenantId { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorWithAlertsProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorWithAlertsProperties.cs index 513a9a2f07fea..b11f7fa33d1b1 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorWithAlertsProperties.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorWithAlertsProperties.cs @@ -50,18 +50,5 @@ public DataConnectorWithAlertsProperties() [JsonProperty(PropertyName = "dataTypes")] public AlertsDataTypeOfDataConnector DataTypes { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DataTypes != null) - { - DataTypes.Validate(); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorsCheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorsCheckRequirements.cs deleted file mode 100644 index 9adbf44a09a99..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataConnectorsCheckRequirements.cs +++ /dev/null @@ -1,36 +0,0 @@ -// -// 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; - - /// - /// Data connector requirements properties. - /// - public partial class DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the DataConnectorsCheckRequirements - /// class. - /// - public DataConnectorsCheckRequirements() - { - 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/DataTypeDefinitions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataTypeDefinitions.cs deleted file mode 100644 index 39588a7f5217b..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DataTypeDefinitions.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// 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 data type definition - /// - public partial class DataTypeDefinitions - { - /// - /// Initializes a new instance of the DataTypeDefinitions class. - /// - public DataTypeDefinitions() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DataTypeDefinitions class. - /// - /// The data type name - public DataTypeDefinitions(string dataType = default(string)) - { - DataType = dataType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the data type name - /// - [JsonProperty(PropertyName = "dataType")] - public string DataType { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DeliveryAction.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DeliveryAction.cs deleted file mode 100644 index 80e8366eaa8ee..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DeliveryAction.cs +++ /dev/null @@ -1,93 +0,0 @@ -// -// 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 DeliveryAction. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum DeliveryAction - { - /// - /// Unknown - /// - [EnumMember(Value = "Unknown")] - Unknown, - /// - /// DeliveredAsSpam - /// - [EnumMember(Value = "DeliveredAsSpam")] - DeliveredAsSpam, - /// - /// Delivered - /// - [EnumMember(Value = "Delivered")] - Delivered, - /// - /// Blocked - /// - [EnumMember(Value = "Blocked")] - Blocked, - /// - /// Replaced - /// - [EnumMember(Value = "Replaced")] - Replaced - } - internal static class DeliveryActionEnumExtension - { - internal static string ToSerializedValue(this DeliveryAction? value) - { - return value == null ? null : ((DeliveryAction)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this DeliveryAction value) - { - switch( value ) - { - case DeliveryAction.Unknown: - return "Unknown"; - case DeliveryAction.DeliveredAsSpam: - return "DeliveredAsSpam"; - case DeliveryAction.Delivered: - return "Delivered"; - case DeliveryAction.Blocked: - return "Blocked"; - case DeliveryAction.Replaced: - return "Replaced"; - } - return null; - } - - internal static DeliveryAction? ParseDeliveryAction(this string value) - { - switch( value ) - { - case "Unknown": - return DeliveryAction.Unknown; - case "DeliveredAsSpam": - return DeliveryAction.DeliveredAsSpam; - case "Delivered": - return DeliveryAction.Delivered; - case "Blocked": - return DeliveryAction.Blocked; - case "Replaced": - return DeliveryAction.Replaced; - } - return null; - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DeliveryLocation.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DeliveryLocation.cs deleted file mode 100644 index 1b77e05e79295..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DeliveryLocation.cs +++ /dev/null @@ -1,129 +0,0 @@ -// -// 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 DeliveryLocation. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum DeliveryLocation - { - /// - /// Unknown - /// - [EnumMember(Value = "Unknown")] - Unknown, - /// - /// Inbox - /// - [EnumMember(Value = "Inbox")] - Inbox, - /// - /// JunkFolder - /// - [EnumMember(Value = "JunkFolder")] - JunkFolder, - /// - /// DeletedFolder - /// - [EnumMember(Value = "DeletedFolder")] - DeletedFolder, - /// - /// Quarantine - /// - [EnumMember(Value = "Quarantine")] - Quarantine, - /// - /// External - /// - [EnumMember(Value = "External")] - External, - /// - /// Failed - /// - [EnumMember(Value = "Failed")] - Failed, - /// - /// Dropped - /// - [EnumMember(Value = "Dropped")] - Dropped, - /// - /// Forwarded - /// - [EnumMember(Value = "Forwarded")] - Forwarded - } - internal static class DeliveryLocationEnumExtension - { - internal static string ToSerializedValue(this DeliveryLocation? value) - { - return value == null ? null : ((DeliveryLocation)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this DeliveryLocation value) - { - switch( value ) - { - case DeliveryLocation.Unknown: - return "Unknown"; - case DeliveryLocation.Inbox: - return "Inbox"; - case DeliveryLocation.JunkFolder: - return "JunkFolder"; - case DeliveryLocation.DeletedFolder: - return "DeletedFolder"; - case DeliveryLocation.Quarantine: - return "Quarantine"; - case DeliveryLocation.External: - return "External"; - case DeliveryLocation.Failed: - return "Failed"; - case DeliveryLocation.Dropped: - return "Dropped"; - case DeliveryLocation.Forwarded: - return "Forwarded"; - } - return null; - } - - internal static DeliveryLocation? ParseDeliveryLocation(this string value) - { - switch( value ) - { - case "Unknown": - return DeliveryLocation.Unknown; - case "Inbox": - return DeliveryLocation.Inbox; - case "JunkFolder": - return DeliveryLocation.JunkFolder; - case "DeletedFolder": - return DeliveryLocation.DeletedFolder; - case "Quarantine": - return DeliveryLocation.Quarantine; - case "External": - return DeliveryLocation.External; - case "Failed": - return DeliveryLocation.Failed; - case "Dropped": - return DeliveryLocation.Dropped; - case "Forwarded": - return DeliveryLocation.Forwarded; - } - return null; - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DnsEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DnsEntity.cs deleted file mode 100644 index 575cb10971d1a..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/DnsEntity.cs +++ /dev/null @@ -1,116 +0,0 @@ -// -// 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 dns entity. - /// - [Newtonsoft.Json.JsonObject("DnsResolution")] - [Rest.Serialization.JsonTransformation] - public partial class DnsEntity : Entity - { - /// - /// Initializes a new instance of the DnsEntity class. - /// - public DnsEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DnsEntity 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. - /// An ip entity id for the dns - /// server resolving the request - /// The name of the dns record associated with - /// the alert - /// An ip entity id for the dns - /// request client - /// Ip entity identifiers for the - /// resolved ip address. - public DnsEntity(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 dnsServerIpEntityId = default(string), string domainName = default(string), string hostIpAddressEntityId = default(string), IList ipAddressEntityIds = default(IList)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - DnsServerIpEntityId = dnsServerIpEntityId; - DomainName = domainName; - HostIpAddressEntityId = hostIpAddressEntityId; - IpAddressEntityIds = ipAddressEntityIds; - 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 an ip entity id for the dns server resolving the request - /// - [JsonProperty(PropertyName = "properties.dnsServerIpEntityId")] - public string DnsServerIpEntityId { get; private set; } - - /// - /// Gets the name of the dns record associated with the alert - /// - [JsonProperty(PropertyName = "properties.domainName")] - public string DomainName { get; private set; } - - /// - /// Gets an ip entity id for the dns request client - /// - [JsonProperty(PropertyName = "properties.hostIpAddressEntityId")] - public string HostIpAddressEntityId { get; private set; } - - /// - /// Gets ip entity identifiers for the resolved ip address. - /// - [JsonProperty(PropertyName = "properties.ipAddressEntityIds")] - public IList IpAddressEntityIds { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Dynamics365CheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Dynamics365CheckRequirements.cs deleted file mode 100644 index e067d340ba9fa..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Dynamics365CheckRequirements.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents Dynamics365 requirements check request. - /// - [Newtonsoft.Json.JsonObject("Dynamics365")] - [Rest.Serialization.JsonTransformation] - public partial class Dynamics365CheckRequirements : DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the Dynamics365CheckRequirements - /// class. - /// - public Dynamics365CheckRequirements() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Dynamics365CheckRequirements - /// class. - /// - /// The tenant id to connect to, and get the - /// data from. - public Dynamics365CheckRequirements(string tenantId) - { - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Dynamics365DataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Dynamics365DataConnector.cs deleted file mode 100644 index ff5abeb191b8b..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Dynamics365DataConnector.cs +++ /dev/null @@ -1,96 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents Dynamics365 data connector. - /// - [Newtonsoft.Json.JsonObject("Dynamics365")] - [Rest.Serialization.JsonTransformation] - public partial class Dynamics365DataConnector : DataConnector - { - /// - /// Initializes a new instance of the Dynamics365DataConnector class. - /// - public Dynamics365DataConnector() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Dynamics365DataConnector class. - /// - /// The tenant id to connect to, and get the - /// data from. - /// The available data types for the - /// connector. - /// 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 Dynamics365DataConnector(string tenantId, Dynamics365DataConnectorDataTypes dataTypes, 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) - { - TenantId = tenantId; - DataTypes = dataTypes; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Gets or sets the available data types for the connector. - /// - [JsonProperty(PropertyName = "properties.dataTypes")] - public Dynamics365DataConnectorDataTypes DataTypes { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - if (DataTypes == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataTypes"); - } - if (DataTypes != null) - { - DataTypes.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Dynamics365DataConnectorDataTypes.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Dynamics365DataConnectorDataTypes.cs deleted file mode 100644 index 53ae1aa5485cc..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Dynamics365DataConnectorDataTypes.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// 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; - - /// - /// The available data types for Dynamics365 data connector. - /// - public partial class Dynamics365DataConnectorDataTypes - { - /// - /// Initializes a new instance of the Dynamics365DataConnectorDataTypes - /// class. - /// - public Dynamics365DataConnectorDataTypes() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Dynamics365DataConnectorDataTypes - /// class. - /// - /// Common Data Service data - /// type connection. - public Dynamics365DataConnectorDataTypes(Dynamics365DataConnectorDataTypesDynamics365CdsActivities dynamics365CdsActivities) - { - Dynamics365CdsActivities = dynamics365CdsActivities; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets common Data Service data type connection. - /// - [JsonProperty(PropertyName = "dynamics365CdsActivities")] - public Dynamics365DataConnectorDataTypesDynamics365CdsActivities Dynamics365CdsActivities { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Dynamics365CdsActivities == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Dynamics365CdsActivities"); - } - if (Dynamics365CdsActivities != null) - { - Dynamics365CdsActivities.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Dynamics365DataConnectorDataTypesDynamics365CdsActivities.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Dynamics365DataConnectorDataTypesDynamics365CdsActivities.cs deleted file mode 100644 index 1117fd13efe5e..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Dynamics365DataConnectorDataTypesDynamics365CdsActivities.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// 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; - - /// - /// Common Data Service data type connection. - /// - public partial class Dynamics365DataConnectorDataTypesDynamics365CdsActivities : DataConnectorDataTypeCommon - { - /// - /// Initializes a new instance of the - /// Dynamics365DataConnectorDataTypesDynamics365CdsActivities class. - /// - public Dynamics365DataConnectorDataTypesDynamics365CdsActivities() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// Dynamics365DataConnectorDataTypesDynamics365CdsActivities class. - /// - /// Describe whether this data type connection is - /// enabled or not. Possible values include: 'Enabled', - /// 'Disabled' - public Dynamics365DataConnectorDataTypesDynamics365CdsActivities(string state) - : base(state) - { - 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/ElevationToken.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ElevationToken.cs deleted file mode 100644 index 810dfb319f6e1..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ElevationToken.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// 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 ElevationToken. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum ElevationToken - { - /// - /// Default elevation token - /// - [EnumMember(Value = "Default")] - Default, - /// - /// Full elevation token - /// - [EnumMember(Value = "Full")] - Full, - /// - /// Limited elevation token - /// - [EnumMember(Value = "Limited")] - Limited - } - internal static class ElevationTokenEnumExtension - { - internal static string ToSerializedValue(this ElevationToken? value) - { - return value == null ? null : ((ElevationToken)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this ElevationToken value) - { - switch( value ) - { - case ElevationToken.Default: - return "Default"; - case ElevationToken.Full: - return "Full"; - case ElevationToken.Limited: - return "Limited"; - } - return null; - } - - internal static ElevationToken? ParseElevationToken(this string value) - { - switch( value ) - { - case "Default": - return ElevationToken.Default; - case "Full": - return ElevationToken.Full; - case "Limited": - return ElevationToken.Limited; - } - return null; - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhois.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhois.cs deleted file mode 100644 index 3e8d2afcd571a..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhois.cs +++ /dev/null @@ -1,96 +0,0 @@ -// -// 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; - - /// - /// Whois information for a given domain and associated metadata - /// - public partial class EnrichmentDomainWhois - { - /// - /// Initializes a new instance of the EnrichmentDomainWhois class. - /// - public EnrichmentDomainWhois() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EnrichmentDomainWhois class. - /// - /// The domain for this whois record - /// The hostname of this registrar's whois - /// server - /// The timestamp at which this record was - /// created - /// The timestamp at which this record was last - /// updated - /// The timestamp at which this record will - /// expire - /// The whois record for a given - /// domain - public EnrichmentDomainWhois(string domain = default(string), string server = default(string), System.DateTime? created = default(System.DateTime?), System.DateTime? updated = default(System.DateTime?), System.DateTime? expires = default(System.DateTime?), EnrichmentDomainWhoisDetails parsedWhois = default(EnrichmentDomainWhoisDetails)) - { - Domain = domain; - Server = server; - Created = created; - Updated = updated; - Expires = expires; - ParsedWhois = parsedWhois; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the domain for this whois record - /// - [JsonProperty(PropertyName = "domain")] - public string Domain { get; set; } - - /// - /// Gets or sets the hostname of this registrar's whois server - /// - [JsonProperty(PropertyName = "server")] - public string Server { get; set; } - - /// - /// Gets or sets the timestamp at which this record was created - /// - [JsonProperty(PropertyName = "created")] - public System.DateTime? Created { get; set; } - - /// - /// Gets or sets the timestamp at which this record was last updated - /// - [JsonProperty(PropertyName = "updated")] - public System.DateTime? Updated { get; set; } - - /// - /// Gets or sets the timestamp at which this record will expire - /// - [JsonProperty(PropertyName = "expires")] - public System.DateTime? Expires { get; set; } - - /// - /// Gets or sets the whois record for a given domain - /// - [JsonProperty(PropertyName = "parsedWhois")] - public EnrichmentDomainWhoisDetails ParsedWhois { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhoisContact.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhoisContact.cs deleted file mode 100644 index f587afdd61a97..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhoisContact.cs +++ /dev/null @@ -1,128 +0,0 @@ -// -// 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; - - /// - /// An individual contact associated with this domain - /// - public partial class EnrichmentDomainWhoisContact - { - /// - /// Initializes a new instance of the EnrichmentDomainWhoisContact - /// class. - /// - public EnrichmentDomainWhoisContact() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EnrichmentDomainWhoisContact - /// class. - /// - /// The name of this contact - /// The organization for this contact - /// A list describing the street address for this - /// contact - /// The city for this contact - /// The state for this contact - /// The postal code for this contact - /// The country for this contact - /// The phone number for this contact - /// The fax number for this contact - /// The email address for this contact - public EnrichmentDomainWhoisContact(string name = default(string), string org = default(string), IList street = default(IList), string city = default(string), string state = default(string), string postal = default(string), string country = default(string), string phone = default(string), string fax = default(string), string email = default(string)) - { - Name = name; - Org = org; - Street = street; - City = city; - State = state; - Postal = postal; - Country = country; - Phone = phone; - Fax = fax; - Email = email; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of this contact - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the organization for this contact - /// - [JsonProperty(PropertyName = "org")] - public string Org { get; set; } - - /// - /// Gets or sets a list describing the street address for this contact - /// - [JsonProperty(PropertyName = "street")] - public IList Street { get; set; } - - /// - /// Gets or sets the city for this contact - /// - [JsonProperty(PropertyName = "city")] - public string City { get; set; } - - /// - /// Gets or sets the state for this contact - /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } - - /// - /// Gets or sets the postal code for this contact - /// - [JsonProperty(PropertyName = "postal")] - public string Postal { get; set; } - - /// - /// Gets or sets the country for this contact - /// - [JsonProperty(PropertyName = "country")] - public string Country { get; set; } - - /// - /// Gets or sets the phone number for this contact - /// - [JsonProperty(PropertyName = "phone")] - public string Phone { get; set; } - - /// - /// Gets or sets the fax number for this contact - /// - [JsonProperty(PropertyName = "fax")] - public string Fax { get; set; } - - /// - /// Gets or sets the email address for this contact - /// - [JsonProperty(PropertyName = "email")] - public string Email { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhoisContacts.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhoisContacts.cs deleted file mode 100644 index 767d155e06b32..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhoisContacts.cs +++ /dev/null @@ -1,80 +0,0 @@ -// -// 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 set of contacts associated with this domain - /// - public partial class EnrichmentDomainWhoisContacts - { - /// - /// Initializes a new instance of the EnrichmentDomainWhoisContacts - /// class. - /// - public EnrichmentDomainWhoisContacts() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EnrichmentDomainWhoisContacts - /// class. - /// - /// The admin contact for this whois record - /// The billing contact for this whois - /// record - /// The registrant contact for this whois - /// record - /// The technical contact for this whois - /// record - public EnrichmentDomainWhoisContacts(EnrichmentDomainWhoisContact admin = default(EnrichmentDomainWhoisContact), EnrichmentDomainWhoisContact billing = default(EnrichmentDomainWhoisContact), EnrichmentDomainWhoisContact registrant = default(EnrichmentDomainWhoisContact), EnrichmentDomainWhoisContact tech = default(EnrichmentDomainWhoisContact)) - { - Admin = admin; - Billing = billing; - Registrant = registrant; - Tech = tech; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the admin contact for this whois record - /// - [JsonProperty(PropertyName = "admin")] - public EnrichmentDomainWhoisContact Admin { get; set; } - - /// - /// Gets or sets the billing contact for this whois record - /// - [JsonProperty(PropertyName = "billing")] - public EnrichmentDomainWhoisContact Billing { get; set; } - - /// - /// Gets or sets the registrant contact for this whois record - /// - [JsonProperty(PropertyName = "registrant")] - public EnrichmentDomainWhoisContact Registrant { get; set; } - - /// - /// Gets or sets the technical contact for this whois record - /// - [JsonProperty(PropertyName = "tech")] - public EnrichmentDomainWhoisContact Tech { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhoisDetails.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhoisDetails.cs deleted file mode 100644 index edb488b43b3a1..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhoisDetails.cs +++ /dev/null @@ -1,83 +0,0 @@ -// -// 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 whois record for a given domain - /// - public partial class EnrichmentDomainWhoisDetails - { - /// - /// Initializes a new instance of the EnrichmentDomainWhoisDetails - /// class. - /// - public EnrichmentDomainWhoisDetails() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EnrichmentDomainWhoisDetails - /// class. - /// - /// The registrar associated with this - /// domain - /// The set of contacts associated with this - /// domain - /// A list of name servers associated with - /// this domain - /// The set of status flags for this whois - /// record - public EnrichmentDomainWhoisDetails(EnrichmentDomainWhoisRegistrarDetails registrar = default(EnrichmentDomainWhoisRegistrarDetails), EnrichmentDomainWhoisContacts contacts = default(EnrichmentDomainWhoisContacts), IList nameServers = default(IList), IList statuses = default(IList)) - { - Registrar = registrar; - Contacts = contacts; - NameServers = nameServers; - Statuses = statuses; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the registrar associated with this domain - /// - [JsonProperty(PropertyName = "registrar")] - public EnrichmentDomainWhoisRegistrarDetails Registrar { get; set; } - - /// - /// Gets or sets the set of contacts associated with this domain - /// - [JsonProperty(PropertyName = "contacts")] - public EnrichmentDomainWhoisContacts Contacts { get; set; } - - /// - /// Gets or sets a list of name servers associated with this domain - /// - [JsonProperty(PropertyName = "nameServers")] - public IList NameServers { get; set; } - - /// - /// Gets or sets the set of status flags for this whois record - /// - [JsonProperty(PropertyName = "statuses")] - public IList Statuses { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhoisRegistrarDetails.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhoisRegistrarDetails.cs deleted file mode 100644 index 54bc98b28674c..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentDomainWhoisRegistrarDetails.cs +++ /dev/null @@ -1,98 +0,0 @@ -// -// 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 registrar associated with this domain - /// - public partial class EnrichmentDomainWhoisRegistrarDetails - { - /// - /// Initializes a new instance of the - /// EnrichmentDomainWhoisRegistrarDetails class. - /// - public EnrichmentDomainWhoisRegistrarDetails() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// EnrichmentDomainWhoisRegistrarDetails class. - /// - /// The name of this registrar - /// This registrar's abuse contact - /// email - /// This registrar's abuse contact - /// phone number - /// This registrar's Internet Assigned Numbers - /// Authority id - /// This registrar's URL - /// The hostname of this registrar's whois - /// server - public EnrichmentDomainWhoisRegistrarDetails(string name = default(string), string abuseContactEmail = default(string), string abuseContactPhone = default(string), string ianaId = default(string), string url = default(string), string whoisServer = default(string)) - { - Name = name; - AbuseContactEmail = abuseContactEmail; - AbuseContactPhone = abuseContactPhone; - IanaId = ianaId; - Url = url; - WhoisServer = whoisServer; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of this registrar - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets this registrar's abuse contact email - /// - [JsonProperty(PropertyName = "abuseContactEmail")] - public string AbuseContactEmail { get; set; } - - /// - /// Gets or sets this registrar's abuse contact phone number - /// - [JsonProperty(PropertyName = "abuseContactPhone")] - public string AbuseContactPhone { get; set; } - - /// - /// Gets or sets this registrar's Internet Assigned Numbers Authority - /// id - /// - [JsonProperty(PropertyName = "ianaId")] - public string IanaId { get; set; } - - /// - /// Gets or sets this registrar's URL - /// - [JsonProperty(PropertyName = "url")] - public string Url { get; set; } - - /// - /// Gets or sets the hostname of this registrar's whois server - /// - [JsonProperty(PropertyName = "whoisServer")] - public string WhoisServer { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentIpGeodata.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentIpGeodata.cs deleted file mode 100644 index 31266d1fddd1f..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EnrichmentIpGeodata.cs +++ /dev/null @@ -1,199 +0,0 @@ -// -// 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; - - /// - /// Geodata information for a given IP address - /// - public partial class EnrichmentIpGeodata - { - /// - /// Initializes a new instance of the EnrichmentIpGeodata class. - /// - public EnrichmentIpGeodata() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EnrichmentIpGeodata class. - /// - /// The autonomous system number associated with this - /// IP address - /// The name of the carrier for this IP - /// address - /// The city this IP address is located in - /// A numeric rating of confidence that the value - /// in the 'city' field is correct, on a scale of 0-100 - /// The continent this IP address is located - /// on - /// The county this IP address is located - /// in - /// A numeric rating of confidence that the - /// value in the 'country' field is correct on a scale of 0-100 - /// The dotted-decimal or colon-separated string - /// representation of the IP address - /// A description of the connection type of - /// this IP address - /// The latitude of this IP address - /// The longitude of this IP address - /// The name of the organization for this IP - /// address - /// The type of the organization for - /// this IP address - /// The geographic region this IP address is - /// located in - /// The state this IP address is located in - /// A numeric rating of confidence that the value - /// in the 'state' field is correct on a scale of 0-100 - /// The abbreviated name for the state this IP - /// address is located in - public EnrichmentIpGeodata(string asn = default(string), string carrier = default(string), string city = default(string), int? cityCf = default(int?), string continent = default(string), string country = default(string), int? countryCf = default(int?), string ipAddr = default(string), string ipRoutingType = default(string), string latitude = default(string), string longitude = default(string), string organization = default(string), string organizationType = default(string), string region = default(string), string state = default(string), int? stateCf = default(int?), string stateCode = default(string)) - { - Asn = asn; - Carrier = carrier; - City = city; - CityCf = cityCf; - Continent = continent; - Country = country; - CountryCf = countryCf; - IpAddr = ipAddr; - IpRoutingType = ipRoutingType; - Latitude = latitude; - Longitude = longitude; - Organization = organization; - OrganizationType = organizationType; - Region = region; - State = state; - StateCf = stateCf; - StateCode = stateCode; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the autonomous system number associated with this IP - /// address - /// - [JsonProperty(PropertyName = "asn")] - public string Asn { get; set; } - - /// - /// Gets or sets the name of the carrier for this IP address - /// - [JsonProperty(PropertyName = "carrier")] - public string Carrier { get; set; } - - /// - /// Gets or sets the city this IP address is located in - /// - [JsonProperty(PropertyName = "city")] - public string City { get; set; } - - /// - /// Gets or sets a numeric rating of confidence that the value in the - /// 'city' field is correct, on a scale of 0-100 - /// - [JsonProperty(PropertyName = "cityCf")] - public int? CityCf { get; set; } - - /// - /// Gets or sets the continent this IP address is located on - /// - [JsonProperty(PropertyName = "continent")] - public string Continent { get; set; } - - /// - /// Gets or sets the county this IP address is located in - /// - [JsonProperty(PropertyName = "country")] - public string Country { get; set; } - - /// - /// Gets or sets a numeric rating of confidence that the value in the - /// 'country' field is correct on a scale of 0-100 - /// - [JsonProperty(PropertyName = "countryCf")] - public int? CountryCf { get; set; } - - /// - /// Gets or sets the dotted-decimal or colon-separated string - /// representation of the IP address - /// - [JsonProperty(PropertyName = "ipAddr")] - public string IpAddr { get; set; } - - /// - /// Gets or sets a description of the connection type of this IP - /// address - /// - [JsonProperty(PropertyName = "ipRoutingType")] - public string IpRoutingType { get; set; } - - /// - /// Gets or sets the latitude of this IP address - /// - [JsonProperty(PropertyName = "latitude")] - public string Latitude { get; set; } - - /// - /// Gets or sets the longitude of this IP address - /// - [JsonProperty(PropertyName = "longitude")] - public string Longitude { get; set; } - - /// - /// Gets or sets the name of the organization for this IP address - /// - [JsonProperty(PropertyName = "organization")] - public string Organization { get; set; } - - /// - /// Gets or sets the type of the organization for this IP address - /// - [JsonProperty(PropertyName = "organizationType")] - public string OrganizationType { get; set; } - - /// - /// Gets or sets the geographic region this IP address is located in - /// - [JsonProperty(PropertyName = "region")] - public string Region { get; set; } - - /// - /// Gets or sets the state this IP address is located in - /// - [JsonProperty(PropertyName = "state")] - public string State { get; set; } - - /// - /// Gets or sets a numeric rating of confidence that the value in the - /// 'state' field is correct on a scale of 0-100 - /// - [JsonProperty(PropertyName = "stateCf")] - public int? StateCf { get; set; } - - /// - /// Gets or sets the abbreviated name for the state this IP address is - /// located in - /// - [JsonProperty(PropertyName = "stateCode")] - public string StateCode { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Entity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Entity.cs deleted file mode 100644 index 10b8d057550e2..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Entity.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// 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; - - /// - /// Specific entity. - /// - public partial class Entity : Resource - { - /// - /// Initializes a new instance of the Entity class. - /// - public Entity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Entity 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. - public Entity(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, systemData) - { - 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/EntityAnalytics.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityAnalytics.cs deleted file mode 100644 index 9cd4307b7aad5..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityAnalytics.cs +++ /dev/null @@ -1,65 +0,0 @@ -// -// 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.Linq; - - /// - /// Settings with single toggle. - /// - [Rest.Serialization.JsonTransformation] - public partial class EntityAnalytics : Settings - { - /// - /// Initializes a new instance of the EntityAnalytics class. - /// - public EntityAnalytics() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityAnalytics 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 - /// 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?)) - : base(id, name, type, systemData, etag) - { - IsEnabled = isEnabled; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets determines whether the setting is enable or disabled. - /// - [JsonProperty(PropertyName = "properties.isEnabled")] - public bool? IsEnabled { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityCommonProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityCommonProperties.cs deleted file mode 100644 index 1ea2909c2bb81..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityCommonProperties.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// 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; - - /// - /// Entity common property bag. - /// - public partial class EntityCommonProperties - { - /// - /// Initializes a new instance of the EntityCommonProperties class. - /// - public EntityCommonProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityCommonProperties class. - /// - /// 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. - public EntityCommonProperties(IDictionary additionalData = default(IDictionary), string friendlyName = default(string)) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - 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 = "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 = "friendlyName")] - public string FriendlyName { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityEdges.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityEdges.cs deleted file mode 100644 index 440e7c2ed591f..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityEdges.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// 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 edge that connects the entity to the other entity. - /// - public partial class EntityEdges - { - /// - /// Initializes a new instance of the EntityEdges class. - /// - public EntityEdges() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityEdges class. - /// - /// The target entity Id. - /// A bag of custom fields that should be - /// part of the entity and will be presented to the user. - public EntityEdges(string targetEntityId = default(string), IDictionary additionalData = default(IDictionary)) - { - TargetEntityId = targetEntityId; - AdditionalData = additionalData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the target entity Id. - /// - [JsonProperty(PropertyName = "targetEntityId")] - public string TargetEntityId { get; set; } - - /// - /// Gets or sets a bag of custom fields that should be part of the - /// entity and will be presented to the user. - /// - [JsonProperty(PropertyName = "additionalData")] - public IDictionary AdditionalData { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityExpandParameters.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityExpandParameters.cs deleted file mode 100644 index 5a7f826262f86..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityExpandParameters.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// 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 parameters required to execute an expand operation on the given - /// entity. - /// - public partial class EntityExpandParameters - { - /// - /// Initializes a new instance of the EntityExpandParameters class. - /// - public EntityExpandParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityExpandParameters class. - /// - /// The end date filter, so the only expansion - /// results returned are before this date. - /// The Id of the expansion to - /// perform. - /// The start date filter, so the only - /// expansion results returned are after this date. - public EntityExpandParameters(System.DateTime? endTime = default(System.DateTime?), System.Guid? expansionId = default(System.Guid?), System.DateTime? startTime = default(System.DateTime?)) - { - EndTime = endTime; - ExpansionId = expansionId; - StartTime = startTime; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the end date filter, so the only expansion results - /// returned are before this date. - /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { get; set; } - - /// - /// Gets or sets the Id of the expansion to perform. - /// - [JsonProperty(PropertyName = "expansionId")] - public System.Guid? ExpansionId { get; set; } - - /// - /// Gets or sets the start date filter, so the only expansion results - /// returned are after this date. - /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityExpandResponse.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityExpandResponse.cs deleted file mode 100644 index d530f5493f6bc..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityExpandResponse.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// 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 entity expansion result operation response. - /// - public partial class EntityExpandResponse - { - /// - /// Initializes a new instance of the EntityExpandResponse class. - /// - public EntityExpandResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityExpandResponse class. - /// - /// The metadata from the expansion operation - /// results. - /// The expansion result values. - public EntityExpandResponse(ExpansionResultsMetadata metaData = default(ExpansionResultsMetadata), EntityExpandResponseValue value = default(EntityExpandResponseValue)) - { - MetaData = metaData; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the metadata from the expansion operation results. - /// - [JsonProperty(PropertyName = "metaData")] - public ExpansionResultsMetadata MetaData { get; set; } - - /// - /// Gets or sets the expansion result values. - /// - [JsonProperty(PropertyName = "value")] - public EntityExpandResponseValue Value { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityExpandResponseValue.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityExpandResponseValue.cs deleted file mode 100644 index b7208b1fe5777..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityExpandResponseValue.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// 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 expansion result values. - /// - public partial class EntityExpandResponseValue - { - /// - /// Initializes a new instance of the EntityExpandResponseValue class. - /// - public EntityExpandResponseValue() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityExpandResponseValue class. - /// - /// Array of the expansion result - /// entities. - /// Array of edges that connects the entity to the - /// list of entities. - public EntityExpandResponseValue(IList entities = default(IList), IList edges = default(IList)) - { - Entities = entities; - Edges = edges; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets array of the expansion result entities. - /// - [JsonProperty(PropertyName = "entities")] - public IList Entities { get; set; } - - /// - /// Gets or sets array of edges that connects the entity to the list of - /// entities. - /// - [JsonProperty(PropertyName = "edges")] - public IList Edges { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityGetInsightsParameters.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityGetInsightsParameters.cs deleted file mode 100644 index 57412ac7f6ddd..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityGetInsightsParameters.cs +++ /dev/null @@ -1,98 +0,0 @@ -// -// 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 parameters required to execute insights operation on the given - /// entity. - /// - public partial class EntityGetInsightsParameters - { - /// - /// Initializes a new instance of the EntityGetInsightsParameters - /// class. - /// - public EntityGetInsightsParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityGetInsightsParameters - /// class. - /// - /// The start timeline date, so the results - /// returned are after this date. - /// The end timeline date, so the results - /// returned are before this date. - /// Indicates if query time - /// range should be extended with default time range of the query. - /// Default value is false - /// List of Insights Query Id. If empty, - /// default value is all insights of this entity - public EntityGetInsightsParameters(System.DateTime startTime, System.DateTime endTime, bool? addDefaultExtendedTimeRange = default(bool?), IList insightQueryIds = default(IList)) - { - StartTime = startTime; - EndTime = endTime; - AddDefaultExtendedTimeRange = addDefaultExtendedTimeRange; - InsightQueryIds = insightQueryIds; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the start timeline date, so the results returned are - /// after this date. - /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime StartTime { get; set; } - - /// - /// Gets or sets the end timeline date, so the results returned are - /// before this date. - /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime EndTime { get; set; } - - /// - /// Gets or sets indicates if query time range should be extended with - /// default time range of the query. Default value is false - /// - [JsonProperty(PropertyName = "addDefaultExtendedTimeRange")] - public bool? AddDefaultExtendedTimeRange { get; set; } - - /// - /// Gets or sets list of Insights Query Id. If empty, default value is - /// all insights of this entity - /// - [JsonProperty(PropertyName = "insightQueryIds")] - public IList InsightQueryIds { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityGetInsightsResponse.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityGetInsightsResponse.cs deleted file mode 100644 index c92e0f54cae85..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityGetInsightsResponse.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// 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 Get Insights result operation response. - /// - public partial class EntityGetInsightsResponse - { - /// - /// Initializes a new instance of the EntityGetInsightsResponse class. - /// - public EntityGetInsightsResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityGetInsightsResponse class. - /// - /// The metadata from the get insights operation - /// results. - /// The insights result values. - public EntityGetInsightsResponse(GetInsightsResultsMetadata metaData = default(GetInsightsResultsMetadata), IList value = default(IList)) - { - MetaData = metaData; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the metadata from the get insights operation results. - /// - [JsonProperty(PropertyName = "metaData")] - public GetInsightsResultsMetadata MetaData { get; set; } - - /// - /// Gets or sets the insights result values. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (MetaData != null) - { - MetaData.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityInsightItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityInsightItem.cs deleted file mode 100644 index d46c305595dca..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityInsightItem.cs +++ /dev/null @@ -1,80 +0,0 @@ -// -// 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; - - /// - /// Entity insight Item. - /// - public partial class EntityInsightItem - { - /// - /// Initializes a new instance of the EntityInsightItem class. - /// - public EntityInsightItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityInsightItem class. - /// - /// The query id of the insight - /// The Time interval that the query - /// actually executed on. - /// Query results for table insights - /// query. - /// Query results for table insights - /// query. - public EntityInsightItem(string queryId = default(string), EntityInsightItemQueryTimeInterval queryTimeInterval = default(EntityInsightItemQueryTimeInterval), InsightsTableResult tableQueryResults = default(InsightsTableResult), IList chartQueryResults = default(IList)) - { - QueryId = queryId; - QueryTimeInterval = queryTimeInterval; - TableQueryResults = tableQueryResults; - ChartQueryResults = chartQueryResults; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the query id of the insight - /// - [JsonProperty(PropertyName = "queryId")] - public string QueryId { get; set; } - - /// - /// Gets or sets the Time interval that the query actually executed on. - /// - [JsonProperty(PropertyName = "queryTimeInterval")] - public EntityInsightItemQueryTimeInterval QueryTimeInterval { get; set; } - - /// - /// Gets or sets query results for table insights query. - /// - [JsonProperty(PropertyName = "tableQueryResults")] - public InsightsTableResult TableQueryResults { get; set; } - - /// - /// Gets or sets query results for table insights query. - /// - [JsonProperty(PropertyName = "chartQueryResults")] - public IList ChartQueryResults { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityInsightItemQueryTimeInterval.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityInsightItemQueryTimeInterval.cs deleted file mode 100644 index 4da48fb89a742..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityInsightItemQueryTimeInterval.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// 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 Time interval that the query actually executed on. - /// - public partial class EntityInsightItemQueryTimeInterval - { - /// - /// Initializes a new instance of the - /// EntityInsightItemQueryTimeInterval class. - /// - public EntityInsightItemQueryTimeInterval() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// EntityInsightItemQueryTimeInterval class. - /// - /// Insight query start time - /// Insight query end time - public EntityInsightItemQueryTimeInterval(System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?)) - { - StartTime = startTime; - EndTime = endTime; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets insight query start time - /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime? StartTime { get; set; } - - /// - /// Gets or sets insight query end time - /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime? EndTime { 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 deleted file mode 100644 index 2547a43a7e727..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityKind.cs +++ /dev/null @@ -1,104 +0,0 @@ -// -// 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 EntityKind. - /// - public static class EntityKind - { - /// - /// Entity represents account in the system. - /// - public const string Account = "Account"; - /// - /// Entity represents host in the system. - /// - public const string Host = "Host"; - /// - /// Entity represents file in the system. - /// - public const string File = "File"; - /// - /// Entity represents azure resource in the system. - /// - public const string AzureResource = "AzureResource"; - /// - /// Entity represents cloud application in the system. - /// - public const string CloudApplication = "CloudApplication"; - /// - /// Entity represents dns resolution in the system. - /// - public const string DnsResolution = "DnsResolution"; - /// - /// Entity represents file hash in the system. - /// - public const string FileHash = "FileHash"; - /// - /// Entity represents ip in the system. - /// - public const string Ip = "Ip"; - /// - /// Entity represents malware in the system. - /// - public const string Malware = "Malware"; - /// - /// Entity represents process in the system. - /// - public const string Process = "Process"; - /// - /// Entity represents registry key in the system. - /// - public const string RegistryKey = "RegistryKey"; - /// - /// Entity represents registry value in the system. - /// - public const string RegistryValue = "RegistryValue"; - /// - /// Entity represents security group in the system. - /// - public const string SecurityGroup = "SecurityGroup"; - /// - /// Entity represents url in the system. - /// - public const string Url = "Url"; - /// - /// Entity represents IoT device in the system. - /// - public const string IoTDevice = "IoTDevice"; - /// - /// Entity represents security alert in the system. - /// - public const string SecurityAlert = "SecurityAlert"; - /// - /// Entity represents bookmark in the system. - /// - public const string Bookmark = "Bookmark"; - /// - /// Entity represents mail cluster in the system. - /// - public const string MailCluster = "MailCluster"; - /// - /// Entity represents mail message in the system. - /// - public const string MailMessage = "MailMessage"; - /// - /// Entity represents mailbox in the system. - /// - public const string Mailbox = "Mailbox"; - /// - /// Entity represents submission mail in the system. - /// - public const string SubmissionMail = "SubmissionMail"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityMapping.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityMapping.cs deleted file mode 100644 index f3a9b34a2d2ee..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityMapping.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// 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; - - /// - /// Single entity mapping for the alert rule - /// - public partial class EntityMapping - { - /// - /// Initializes a new instance of the EntityMapping class. - /// - public EntityMapping() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityMapping class. - /// - /// Possible values include: 'Account', - /// 'Host', 'IP', 'Malware', 'File', 'Process', 'CloudApplication', - /// 'DNS', 'AzureResource', 'FileHash', 'RegistryKey', 'RegistryValue', - /// 'SecurityGroup', 'URL', 'Mailbox', 'MailCluster', 'MailMessage', - /// 'SubmissionMail' - /// array of field mappings for the given - /// entity mapping - public EntityMapping(string entityType = default(string), IList fieldMappings = default(IList)) - { - EntityType = entityType; - FieldMappings = fieldMappings; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets possible values include: 'Account', 'Host', 'IP', - /// 'Malware', 'File', 'Process', 'CloudApplication', 'DNS', - /// 'AzureResource', 'FileHash', 'RegistryKey', 'RegistryValue', - /// 'SecurityGroup', 'URL', 'Mailbox', 'MailCluster', 'MailMessage', - /// 'SubmissionMail' - /// - [JsonProperty(PropertyName = "entityType")] - public string EntityType { get; set; } - - /// - /// Gets or sets array of field mappings for the given entity mapping - /// - [JsonProperty(PropertyName = "fieldMappings")] - public IList FieldMappings { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityMappingType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityMappingType.cs deleted file mode 100644 index 2682cc5b441b1..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityMappingType.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -// 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 EntityMappingType. - /// - public static class EntityMappingType - { - /// - /// User account entity type - /// - public const string Account = "Account"; - /// - /// Host entity type - /// - public const string Host = "Host"; - /// - /// IP address entity type - /// - public const string IP = "IP"; - /// - /// Malware entity type - /// - public const string Malware = "Malware"; - /// - /// System file entity type - /// - public const string File = "File"; - /// - /// Process entity type - /// - public const string Process = "Process"; - /// - /// Cloud app entity type - /// - public const string CloudApplication = "CloudApplication"; - /// - /// DNS entity type - /// - public const string DNS = "DNS"; - /// - /// Azure resource entity type - /// - public const string AzureResource = "AzureResource"; - /// - /// File-hash entity type - /// - public const string FileHash = "FileHash"; - /// - /// Registry key entity type - /// - public const string RegistryKey = "RegistryKey"; - /// - /// Registry value entity type - /// - public const string RegistryValue = "RegistryValue"; - /// - /// Security group entity type - /// - public const string SecurityGroup = "SecurityGroup"; - /// - /// URL entity type - /// - public const string URL = "URL"; - /// - /// Mailbox entity type - /// - public const string Mailbox = "Mailbox"; - /// - /// Mail cluster entity type - /// - public const string MailCluster = "MailCluster"; - /// - /// Mail message entity type - /// - public const string MailMessage = "MailMessage"; - /// - /// Submission mail entity type - /// - public const string SubmissionMail = "SubmissionMail"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQuery.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQuery.cs deleted file mode 100644 index 799239036ed69..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQuery.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// 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; - - /// - /// Specific entity query. - /// - public partial class EntityQuery : ResourceWithEtag - { - /// - /// Initializes a new instance of the EntityQuery class. - /// - public EntityQuery() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityQuery 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 EntityQuery(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/EntityQueryItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryItem.cs deleted file mode 100644 index 3c014936cb7b0..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryItem.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// 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; - - /// - /// An abstract Query item for entity - /// - public partial class EntityQueryItem - { - /// - /// Initializes a new instance of the EntityQueryItem class. - /// - public EntityQueryItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityQueryItem class. - /// - /// Query Template ARM ID - /// Query Template ARM Name - /// ARM Type - public EntityQueryItem(string id = default(string), string name = default(string), string type = default(string)) - { - Id = id; - Name = name; - Type = type; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets query Template ARM ID - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets or sets query Template ARM Name - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets ARM Type - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - } -} 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 deleted file mode 100644 index 50be53c5ad328..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryItemProperties.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -// 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; - - /// - /// An properties abstract Query item for entity - /// - public partial class EntityQueryItemProperties - { - /// - /// Initializes a new instance of the EntityQueryItemProperties class. - /// - public EntityQueryItemProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityQueryItemProperties class. - /// - /// Data types for template - /// The type of the entity. Possible - /// values include: 'Account', 'Host', 'File', 'AzureResource', - /// 'CloudApplication', 'DNS', 'FileHash', 'IP', 'Malware', 'Process', - /// 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'URL', - /// 'IoTDevice', 'SecurityAlert', 'HuntingBookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' - /// Data types for - /// template - /// The query applied only to entities - /// matching to all filters - public EntityQueryItemProperties(IList dataTypes = default(IList), string inputEntityType = default(string), IList> requiredInputFieldsSets = default(IList>), object entitiesFilter = default(object)) - { - DataTypes = dataTypes; - InputEntityType = inputEntityType; - RequiredInputFieldsSets = requiredInputFieldsSets; - EntitiesFilter = entitiesFilter; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets data types for template - /// - [JsonProperty(PropertyName = "dataTypes")] - public IList DataTypes { get; set; } - - /// - /// Gets or sets the type of the entity. Possible values include: - /// 'Account', 'Host', 'File', 'AzureResource', 'CloudApplication', - /// 'DNS', 'FileHash', 'IP', 'Malware', 'Process', 'RegistryKey', - /// 'RegistryValue', 'SecurityGroup', 'URL', 'IoTDevice', - /// 'SecurityAlert', 'HuntingBookmark', 'MailCluster', 'MailMessage', - /// 'Mailbox', 'SubmissionMail' - /// - [JsonProperty(PropertyName = "inputEntityType")] - public string InputEntityType { get; set; } - - /// - /// Gets or sets data types for template - /// - [JsonProperty(PropertyName = "requiredInputFieldsSets")] - public IList> RequiredInputFieldsSets { get; set; } - - /// - /// Gets or sets the query applied only to entities matching to all - /// filters - /// - [JsonProperty(PropertyName = "entitiesFilter")] - public object EntitiesFilter { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryItemPropertiesDataTypesItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryItemPropertiesDataTypesItem.cs deleted file mode 100644 index ef3caae09a0fd..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryItemPropertiesDataTypesItem.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// 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 EntityQueryItemPropertiesDataTypesItem - { - /// - /// Initializes a new instance of the - /// EntityQueryItemPropertiesDataTypesItem class. - /// - public EntityQueryItemPropertiesDataTypesItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// EntityQueryItemPropertiesDataTypesItem class. - /// - /// Data type name - public EntityQueryItemPropertiesDataTypesItem(string dataType = default(string)) - { - DataType = dataType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets data type name - /// - [JsonProperty(PropertyName = "dataType")] - public string DataType { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryKind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryKind.cs deleted file mode 100644 index cacfd57754ba1..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryKind.cs +++ /dev/null @@ -1,23 +0,0 @@ -// -// 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 EntityQueryKind. - /// - public static class EntityQueryKind - { - public const string Expansion = "Expansion"; - public const string Insight = "Insight"; - public const string Activity = "Activity"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryTemplate.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryTemplate.cs deleted file mode 100644 index a50456bcc0864..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryTemplate.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// 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; - - /// - /// Specific entity query template. - /// - public partial class EntityQueryTemplate : Resource - { - /// - /// Initializes a new instance of the EntityQueryTemplate class. - /// - public EntityQueryTemplate() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityQueryTemplate 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. - public EntityQueryTemplate(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, systemData) - { - 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/EntityTimelineItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityTimelineItem.cs deleted file mode 100644 index c371b83088019..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityTimelineItem.cs +++ /dev/null @@ -1,35 +0,0 @@ -// -// 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; - - /// - /// Entity timeline Item. - /// - public partial class EntityTimelineItem - { - /// - /// Initializes a new instance of the EntityTimelineItem class. - /// - public EntityTimelineItem() - { - 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/EntityTimelineKind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityTimelineKind.cs deleted file mode 100644 index 7187fa5452ad5..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityTimelineKind.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// 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 EntityTimelineKind. - /// - public static class EntityTimelineKind - { - /// - /// activity - /// - public const string Activity = "Activity"; - /// - /// bookmarks - /// - public const string Bookmark = "Bookmark"; - /// - /// security alerts - /// - public const string SecurityAlert = "SecurityAlert"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityTimelineParameters.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityTimelineParameters.cs deleted file mode 100644 index c1e111d61c0b3..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityTimelineParameters.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -// 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 parameters required to execute s timeline operation on the given - /// entity. - /// - public partial class EntityTimelineParameters - { - /// - /// Initializes a new instance of the EntityTimelineParameters class. - /// - public EntityTimelineParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityTimelineParameters class. - /// - /// The start timeline date, so the results - /// returned are after this date. - /// The end timeline date, so the results - /// returned are before this date. - /// Array of timeline Item kinds. - /// The number of bucket for timeline - /// queries aggregation. - public EntityTimelineParameters(System.DateTime startTime, System.DateTime endTime, IList kinds = default(IList), int? numberOfBucket = default(int?)) - { - Kinds = kinds; - StartTime = startTime; - EndTime = endTime; - NumberOfBucket = numberOfBucket; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets array of timeline Item kinds. - /// - [JsonProperty(PropertyName = "kinds")] - public IList Kinds { get; set; } - - /// - /// Gets or sets the start timeline date, so the results returned are - /// after this date. - /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTime StartTime { get; set; } - - /// - /// Gets or sets the end timeline date, so the results returned are - /// before this date. - /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTime EndTime { get; set; } - - /// - /// Gets or sets the number of bucket for timeline queries aggregation. - /// - [JsonProperty(PropertyName = "numberOfBucket")] - public int? NumberOfBucket { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityTimelineResponse.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityTimelineResponse.cs deleted file mode 100644 index ee0834f9b2a17..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityTimelineResponse.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// 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 entity timeline result operation response. - /// - public partial class EntityTimelineResponse - { - /// - /// Initializes a new instance of the EntityTimelineResponse class. - /// - public EntityTimelineResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityTimelineResponse class. - /// - /// The metadata from the timeline operation - /// results. - /// The timeline result values. - public EntityTimelineResponse(TimelineResultsMetadata metaData = default(TimelineResultsMetadata), IList value = default(IList)) - { - MetaData = metaData; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the metadata from the timeline operation results. - /// - [JsonProperty(PropertyName = "metaData")] - public TimelineResultsMetadata MetaData { get; set; } - - /// - /// Gets or sets the timeline result values. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (MetaData != null) - { - MetaData.Validate(); - } - } - } -} 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 deleted file mode 100644 index 0a6dc63eb8a1e..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityType.cs +++ /dev/null @@ -1,104 +0,0 @@ -// -// 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 EntityType. - /// - public static class EntityType - { - /// - /// Entity represents account in the system. - /// - public const string Account = "Account"; - /// - /// Entity represents host in the system. - /// - public const string Host = "Host"; - /// - /// Entity represents file in the system. - /// - public const string File = "File"; - /// - /// Entity represents azure resource in the system. - /// - public const string AzureResource = "AzureResource"; - /// - /// Entity represents cloud application in the system. - /// - public const string CloudApplication = "CloudApplication"; - /// - /// Entity represents dns in the system. - /// - public const string DNS = "DNS"; - /// - /// Entity represents file hash in the system. - /// - public const string FileHash = "FileHash"; - /// - /// Entity represents ip in the system. - /// - public const string IP = "IP"; - /// - /// Entity represents malware in the system. - /// - public const string Malware = "Malware"; - /// - /// Entity represents process in the system. - /// - public const string Process = "Process"; - /// - /// Entity represents registry key in the system. - /// - public const string RegistryKey = "RegistryKey"; - /// - /// Entity represents registry value in the system. - /// - public const string RegistryValue = "RegistryValue"; - /// - /// Entity represents security group in the system. - /// - public const string SecurityGroup = "SecurityGroup"; - /// - /// Entity represents url in the system. - /// - public const string URL = "URL"; - /// - /// Entity represents IoT device in the system. - /// - public const string IoTDevice = "IoTDevice"; - /// - /// Entity represents security alert in the system. - /// - public const string SecurityAlert = "SecurityAlert"; - /// - /// Entity represents HuntingBookmark in the system. - /// - public const string HuntingBookmark = "HuntingBookmark"; - /// - /// Entity represents mail cluster in the system. - /// - public const string MailCluster = "MailCluster"; - /// - /// Entity represents mail message in the system. - /// - public const string MailMessage = "MailMessage"; - /// - /// Entity represents mailbox in the system. - /// - public const string Mailbox = "Mailbox"; - /// - /// Entity represents submission mail in the system. - /// - public const string SubmissionMail = "SubmissionMail"; - } -} 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 deleted file mode 100644 index f100dc6720818..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorDetail.cs +++ /dev/null @@ -1,85 +0,0 @@ -// -// 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 index 7d2ad4e463770..a60cf83241746 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorResponse.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorResponse.cs @@ -11,15 +11,17 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// - /// Error response + /// 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.). + /// response format.) /// public partial class ErrorResponse { @@ -34,10 +36,18 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// The error object. - public ErrorResponse(ErrorDetail error = default(ErrorDetail)) + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorResponse(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) { - Error = error; + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; CustomInit(); } @@ -47,10 +57,34 @@ public ErrorResponse() partial void CustomInit(); /// - /// Gets or sets the error object. + /// Gets the error code. /// - [JsonProperty(PropertyName = "error")] - public ErrorDetail Error { get; set; } + [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/ErrorResponseException.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorResponseException.cs deleted file mode 100644 index 93959aa48c537..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ErrorResponseException.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// 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/EventGroupingAggregationKind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EventGroupingAggregationKind.cs deleted file mode 100644 index 04a9a21a1c9f7..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EventGroupingAggregationKind.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -// 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 EventGroupingAggregationKind. - /// - public static class EventGroupingAggregationKind - { - public const string SingleAlert = "SingleAlert"; - public const string AlertPerResult = "AlertPerResult"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EventGroupingSettings.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EventGroupingSettings.cs deleted file mode 100644 index b721c50df0536..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EventGroupingSettings.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// 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; - - /// - /// Event grouping settings property bag. - /// - public partial class EventGroupingSettings - { - /// - /// Initializes a new instance of the EventGroupingSettings class. - /// - public EventGroupingSettings() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EventGroupingSettings class. - /// - /// Possible values include: - /// 'SingleAlert', 'AlertPerResult' - public EventGroupingSettings(string aggregationKind = default(string)) - { - AggregationKind = aggregationKind; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets possible values include: 'SingleAlert', - /// 'AlertPerResult' - /// - [JsonProperty(PropertyName = "aggregationKind")] - public string AggregationKind { get; set; } - - } -} 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 deleted file mode 100644 index 19b310286fbda..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ExpansionEntityQuery.cs +++ /dev/null @@ -1,125 +0,0 @@ -// -// 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 Expansion entity query. - /// - [Newtonsoft.Json.JsonObject("Expansion")] - [Rest.Serialization.JsonTransformation] - public partial class ExpansionEntityQuery : EntityQuery - { - /// - /// Initializes a new instance of the ExpansionEntityQuery class. - /// - public ExpansionEntityQuery() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ExpansionEntityQuery 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 - /// List of the data sources that are - /// required to run the query - /// The query display name - /// The type of the query's source - /// entity. Possible values include: 'Account', 'Host', 'File', - /// 'AzureResource', 'CloudApplication', 'DNS', 'FileHash', 'IP', - /// 'Malware', 'Process', 'RegistryKey', 'RegistryValue', - /// 'SecurityGroup', 'URL', 'IoTDevice', 'SecurityAlert', - /// 'HuntingBookmark', 'MailCluster', 'MailMessage', 'Mailbox', - /// 'SubmissionMail' - /// List of the fields of the source entity - /// that are required to run the query - /// List of the desired output types to - /// be constructed from the result - /// The template query string to be parsed - /// and formatted - public ExpansionEntityQuery(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), IList dataSources = default(IList), string displayName = default(string), string inputEntityType = default(string), IList inputFields = default(IList), IList outputEntityTypes = default(IList), string queryTemplate = default(string)) - : base(id, name, type, systemData, etag) - { - DataSources = dataSources; - DisplayName = displayName; - InputEntityType = inputEntityType; - InputFields = inputFields; - OutputEntityTypes = outputEntityTypes; - QueryTemplate = queryTemplate; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of the data sources that are required to run the - /// query - /// - [JsonProperty(PropertyName = "properties.dataSources")] - public IList DataSources { get; set; } - - /// - /// Gets or sets the query display name - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the type of the query's source entity. Possible values - /// include: 'Account', 'Host', 'File', 'AzureResource', - /// 'CloudApplication', 'DNS', 'FileHash', 'IP', 'Malware', 'Process', - /// 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'URL', - /// 'IoTDevice', 'SecurityAlert', 'HuntingBookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' - /// - [JsonProperty(PropertyName = "properties.inputEntityType")] - public string InputEntityType { get; set; } - - /// - /// Gets or sets list of the fields of the source entity that are - /// required to run the query - /// - [JsonProperty(PropertyName = "properties.inputFields")] - public IList InputFields { get; set; } - - /// - /// Gets or sets list of the desired output types to be constructed - /// from the result - /// - [JsonProperty(PropertyName = "properties.outputEntityTypes")] - public IList OutputEntityTypes { get; set; } - - /// - /// Gets or sets the template query string to be parsed and formatted - /// - [JsonProperty(PropertyName = "properties.queryTemplate")] - public string QueryTemplate { 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 deleted file mode 100644 index dbc96904e9819..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ExpansionResultAggregation.cs +++ /dev/null @@ -1,104 +0,0 @@ -// -// 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; - - /// - /// Information of a specific aggregation in the expansion result. - /// - public partial class ExpansionResultAggregation - { - /// - /// Initializes a new instance of the ExpansionResultAggregation class. - /// - public ExpansionResultAggregation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ExpansionResultAggregation class. - /// - /// Total number of aggregations of the given kind - /// (and aggregationType if given) in the expansion result. - /// The kind of the aggregated entity. - /// Possible values include: 'Account', 'Host', 'File', - /// 'AzureResource', 'CloudApplication', 'DnsResolution', 'FileHash', - /// 'Ip', 'Malware', 'Process', 'RegistryKey', 'RegistryValue', - /// 'SecurityGroup', 'Url', 'IoTDevice', 'SecurityAlert', 'Bookmark', - /// 'MailCluster', 'MailMessage', 'Mailbox', 'SubmissionMail' - /// The common type of the aggregation. - /// (for e.g. entity field name) - /// The display name of the aggregation by - /// type. - public ExpansionResultAggregation(int count, string entityKind, string aggregationType = default(string), string displayName = default(string)) - { - AggregationType = aggregationType; - Count = count; - DisplayName = displayName; - EntityKind = entityKind; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the common type of the aggregation. (for e.g. entity - /// field name) - /// - [JsonProperty(PropertyName = "aggregationType")] - public string AggregationType { get; set; } - - /// - /// Gets or sets total number of aggregations of the given kind (and - /// aggregationType if given) in the expansion result. - /// - [JsonProperty(PropertyName = "count")] - public int Count { get; set; } - - /// - /// Gets or sets the display name of the aggregation by type. - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the kind of the aggregated entity. Possible values - /// include: 'Account', 'Host', 'File', 'AzureResource', - /// 'CloudApplication', 'DnsResolution', 'FileHash', 'Ip', 'Malware', - /// 'Process', 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'Url', - /// 'IoTDevice', 'SecurityAlert', 'Bookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' - /// - [JsonProperty(PropertyName = "entityKind")] - public string EntityKind { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (EntityKind == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "EntityKind"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ExpansionResultsMetadata.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ExpansionResultsMetadata.cs deleted file mode 100644 index 49e89971e9aa7..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ExpansionResultsMetadata.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// 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; - - /// - /// Expansion result metadata. - /// - public partial class ExpansionResultsMetadata - { - /// - /// Initializes a new instance of the ExpansionResultsMetadata class. - /// - public ExpansionResultsMetadata() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ExpansionResultsMetadata class. - /// - /// Information of the aggregated nodes in - /// the expansion result. - public ExpansionResultsMetadata(IList aggregations = default(IList)) - { - Aggregations = aggregations; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets information of the aggregated nodes in the expansion - /// result. - /// - [JsonProperty(PropertyName = "aggregations")] - public IList Aggregations { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FieldMapping.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FieldMapping.cs deleted file mode 100644 index 53539ffc1a984..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FieldMapping.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// 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 field mapping of the mapped entity - /// - public partial class FieldMapping - { - /// - /// Initializes a new instance of the FieldMapping class. - /// - public FieldMapping() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the FieldMapping class. - /// - /// the V3 identifier of the entity - /// the column name to be mapped to the - /// identifier - public FieldMapping(string identifier = default(string), string columnName = default(string)) - { - Identifier = identifier; - ColumnName = columnName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the V3 identifier of the entity - /// - [JsonProperty(PropertyName = "identifier")] - public string Identifier { get; set; } - - /// - /// Gets or sets the column name to be mapped to the identifier - /// - [JsonProperty(PropertyName = "columnName")] - public string ColumnName { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileEntity.cs deleted file mode 100644 index 40bbc9d001384..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileEntity.cs +++ /dev/null @@ -1,116 +0,0 @@ -// -// 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 entity. - /// - [Newtonsoft.Json.JsonObject("File")] - [Rest.Serialization.JsonTransformation] - public partial class FileEntity : Entity - { - /// - /// Initializes a new instance of the FileEntity class. - /// - public FileEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the FileEntity 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 full path to the file. - /// The file hash entity identifiers - /// associated with this file - /// The file name without path (some alerts - /// might not include path). - /// The Host entity id which the file - /// belongs to - public FileEntity(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 directory = default(string), IList fileHashEntityIds = default(IList), string fileName = default(string), string hostEntityId = default(string)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - Directory = directory; - FileHashEntityIds = fileHashEntityIds; - FileName = fileName; - HostEntityId = hostEntityId; - 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 full path to the file. - /// - [JsonProperty(PropertyName = "properties.directory")] - public string Directory { get; private set; } - - /// - /// Gets the file hash entity identifiers associated with this file - /// - [JsonProperty(PropertyName = "properties.fileHashEntityIds")] - public IList FileHashEntityIds { get; private set; } - - /// - /// Gets the file name without path (some alerts might not include - /// path). - /// - [JsonProperty(PropertyName = "properties.fileName")] - public string FileName { get; private set; } - - /// - /// Gets the Host entity id which the file belongs to - /// - [JsonProperty(PropertyName = "properties.hostEntityId")] - public string HostEntityId { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileHashAlgorithm.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileHashAlgorithm.cs deleted file mode 100644 index c0bdf6b8df93b..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileHashAlgorithm.cs +++ /dev/null @@ -1,40 +0,0 @@ -// -// 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 FileHashAlgorithm. - /// - public static class FileHashAlgorithm - { - /// - /// Unknown hash algorithm - /// - public const string Unknown = "Unknown"; - /// - /// MD5 hash type - /// - public const string MD5 = "MD5"; - /// - /// SHA1 hash type - /// - public const string SHA1 = "SHA1"; - /// - /// SHA256 hash type - /// - public const string SHA256 = "SHA256"; - /// - /// SHA256 Authenticode hash type - /// - public const string SHA256AC = "SHA256AC"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileHashEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileHashEntity.cs deleted file mode 100644 index d2ebd8fa56475..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FileHashEntity.cs +++ /dev/null @@ -1,98 +0,0 @@ -// -// 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 hash entity. - /// - [Newtonsoft.Json.JsonObject("FileHash")] - [Rest.Serialization.JsonTransformation] - public partial class FileHashEntity : Entity - { - /// - /// Initializes a new instance of the FileHashEntity class. - /// - public FileHashEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the FileHashEntity 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 hash algorithm type. Possible values - /// include: 'Unknown', 'MD5', 'SHA1', 'SHA256', 'SHA256AC' - /// The file hash value. - public FileHashEntity(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 algorithm = default(string), string hashValue = default(string)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - Algorithm = algorithm; - HashValue = hashValue; - 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 hash algorithm type. Possible values include: 'Unknown', - /// 'MD5', 'SHA1', 'SHA256', 'SHA256AC' - /// - [JsonProperty(PropertyName = "properties.algorithm")] - public string Algorithm { get; private set; } - - /// - /// Gets the file hash value. - /// - [JsonProperty(PropertyName = "properties.hashValue")] - public string HashValue { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FusionAlertRule.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FusionAlertRule.cs index b50d56ed8f5cf..c47cecd45ac36 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FusionAlertRule.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FusionAlertRule.cs @@ -39,14 +39,9 @@ public FusionAlertRule() /// template used to create this rule. /// Determines whether this alert rule is enabled /// or disabled. - /// 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. + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// Etag of the azure resource /// The description of the alert /// rule. @@ -58,8 +53,8 @@ public FusionAlertRule() /// alert rule. Possible values include: 'High', 'Medium', 'Low', /// 'Informational' /// The tactics of the alert rule - public FusionAlertRule(string alertRuleTemplateName, bool enabled, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string description = default(string), string displayName = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?), string severity = default(string), IList tactics = default(IList)) - : base(id, name, type, systemData, etag) + public FusionAlertRule(string alertRuleTemplateName, bool enabled, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string description = default(string), string displayName = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?), string severity = default(string), IList tactics = default(IList)) + : base(id, name, type, etag) { AlertRuleTemplateName = alertRuleTemplateName; Description = description; diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FusionAlertRuleTemplate.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FusionAlertRuleTemplate.cs index a7be9134d6303..54a55ee9dc979 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FusionAlertRuleTemplate.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/FusionAlertRuleTemplate.cs @@ -35,38 +35,30 @@ public FusionAlertRuleTemplate() /// /// Initializes a new instance of the FusionAlertRuleTemplate class. /// - /// The severity for alerts created by this - /// alert rule. Possible values include: 'High', 'Medium', 'Low', - /// 'Informational' - /// 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. + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// the number of alert /// rules that were created by this template - /// The last time that this alert rule - /// template has been updated. /// The time that this alert rule template /// has been added. /// The description of the alert rule /// template. /// The display name for alert rule /// template. - /// The required data sources for - /// this template + /// The required data connectors + /// for this template /// The alert rule template status. Possible /// values include: 'Installed', 'Available', 'NotAvailable' + /// The severity for alerts created by this + /// alert rule. Possible values include: 'High', 'Medium', 'Low', + /// 'Informational' /// The tactics of the alert rule /// template - public FusionAlertRuleTemplate(string severity, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), int? alertRulesCreatedByTemplateCount = default(int?), System.DateTime? lastUpdatedDateUTC = default(System.DateTime?), System.DateTime? createdDateUTC = default(System.DateTime?), string description = default(string), string displayName = default(string), IList requiredDataConnectors = default(IList), string status = default(string), IList tactics = default(IList)) - : base(id, name, type, systemData) + public FusionAlertRuleTemplate(string id = default(string), string name = default(string), string type = default(string), int? alertRulesCreatedByTemplateCount = default(int?), System.DateTime? createdDateUTC = default(System.DateTime?), string description = default(string), string displayName = default(string), IList requiredDataConnectors = default(IList), string status = default(string), string severity = default(string), IList tactics = default(IList)) + : base(id, name, type) { AlertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; - LastUpdatedDateUTC = lastUpdatedDateUTC; CreatedDateUTC = createdDateUTC; Description = description; DisplayName = displayName; @@ -89,12 +81,6 @@ public FusionAlertRuleTemplate() [JsonProperty(PropertyName = "properties.alertRulesCreatedByTemplateCount")] public int? AlertRulesCreatedByTemplateCount { get; set; } - /// - /// Gets the last time that this alert rule template has been updated. - /// - [JsonProperty(PropertyName = "properties.lastUpdatedDateUTC")] - public System.DateTime? LastUpdatedDateUTC { get; private set; } - /// /// Gets the time that this alert rule template has been added. /// @@ -114,7 +100,7 @@ public FusionAlertRuleTemplate() public string DisplayName { get; set; } /// - /// Gets or sets the required data sources for this template + /// Gets or sets the required data connectors for this template /// [JsonProperty(PropertyName = "properties.requiredDataConnectors")] public IList RequiredDataConnectors { get; set; } @@ -139,18 +125,5 @@ public FusionAlertRuleTemplate() [JsonProperty(PropertyName = "properties.tactics")] public IList Tactics { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Severity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Severity"); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GeoLocation.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GeoLocation.cs deleted file mode 100644 index 5538c24adb388..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GeoLocation.cs +++ /dev/null @@ -1,116 +0,0 @@ -// -// 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 geo-location context attached to the ip entity - /// - public partial class GeoLocation - { - /// - /// Initializes a new instance of the GeoLocation class. - /// - public GeoLocation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GeoLocation class. - /// - /// Autonomous System Number - /// City name - /// The country code according to ISO 3166 - /// format - /// Country name according to ISO 3166 Alpha - /// 2: the lowercase of the English Short Name - /// The longitude of the identified location, - /// expressed as a floating point number with range of -180 to 180, - /// with positive numbers representing East and negative numbers - /// representing West. Latitude and longitude are derived from the city - /// or postal code. - /// The latitude of the identified location, - /// expressed as a floating point number with range of - 90 to 90, with - /// positive numbers representing North and negative numbers - /// representing South. Latitude and longitude are derived from the - /// city or postal code. - /// State name - public GeoLocation(int? asn = default(int?), string city = default(string), string countryCode = default(string), string countryName = default(string), double? latitude = default(double?), double? longitude = default(double?), string state = default(string)) - { - Asn = asn; - City = city; - CountryCode = countryCode; - CountryName = countryName; - Latitude = latitude; - Longitude = longitude; - State = state; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets autonomous System Number - /// - [JsonProperty(PropertyName = "asn")] - public int? Asn { get; private set; } - - /// - /// Gets city name - /// - [JsonProperty(PropertyName = "city")] - public string City { get; private set; } - - /// - /// Gets the country code according to ISO 3166 format - /// - [JsonProperty(PropertyName = "countryCode")] - public string CountryCode { get; private set; } - - /// - /// Gets country name according to ISO 3166 Alpha 2: the lowercase of - /// the English Short Name - /// - [JsonProperty(PropertyName = "countryName")] - public string CountryName { get; private set; } - - /// - /// Gets the longitude of the identified location, expressed as a - /// floating point number with range of -180 to 180, with positive - /// numbers representing East and negative numbers representing West. - /// Latitude and longitude are derived from the city or postal code. - /// - [JsonProperty(PropertyName = "latitude")] - public double? Latitude { get; private set; } - - /// - /// Gets the latitude of the identified location, expressed as a - /// floating point number with range of - 90 to 90, with positive - /// numbers representing North and negative numbers representing South. - /// Latitude and longitude are derived from the city or postal code. - /// - [JsonProperty(PropertyName = "longitude")] - public double? Longitude { get; private set; } - - /// - /// Gets state name - /// - [JsonProperty(PropertyName = "state")] - public string State { 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/GetInsightsError.cs deleted file mode 100644 index bd8427d852eaa..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetInsightsError.cs +++ /dev/null @@ -1,86 +0,0 @@ -// -// 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; - - /// - /// GetInsights Query Errors. - /// - public partial class GetInsightsError - { - /// - /// Initializes a new instance of the GetInsightsError class. - /// - public GetInsightsError() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GetInsightsError class. - /// - /// the error message - /// the query id - public GetInsightsError(string errorMessage, string queryId = default(string)) - { - QueryId = queryId; - ErrorMessage = errorMessage; - CustomInit(); - } - /// - /// Static constructor for GetInsightsError class. - /// - static GetInsightsError() - { - Kind = "Insight"; - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the query id - /// - [JsonProperty(PropertyName = "queryId")] - public string QueryId { get; set; } - - /// - /// Gets or sets the error message - /// - [JsonProperty(PropertyName = "errorMessage")] - public string ErrorMessage { get; set; } - - /// - /// the query kind - /// - [JsonProperty(PropertyName = "kind")] - public static string Kind { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ErrorMessage == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ErrorMessage"); - } - } - } -} 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 deleted file mode 100644 index c8fae0960be3e..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetInsightsResultsMetadata.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -// 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; - - /// - /// Get Insights result metadata. - /// - public partial class GetInsightsResultsMetadata - { - /// - /// Initializes a new instance of the GetInsightsResultsMetadata class. - /// - public GetInsightsResultsMetadata() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GetInsightsResultsMetadata class. - /// - /// the total items found for the insights - /// request - /// information about the failed queries - public GetInsightsResultsMetadata(int totalCount, IList errors = default(IList)) - { - TotalCount = totalCount; - Errors = errors; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the total items found for the insights request - /// - [JsonProperty(PropertyName = "totalCount")] - public int TotalCount { get; set; } - - /// - /// Gets or sets information about the failed queries - /// - [JsonProperty(PropertyName = "errors")] - public IList Errors { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Errors != null) - { - foreach (var element in Errors) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetQueriesResponse.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetQueriesResponse.cs deleted file mode 100644 index e99416ec586a3..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GetQueriesResponse.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// 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; - - /// - /// Retrieve queries for entity result operation response. - /// - public partial class GetQueriesResponse - { - /// - /// Initializes a new instance of the GetQueriesResponse class. - /// - public GetQueriesResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GetQueriesResponse class. - /// - /// The query result values. - public GetQueriesResponse(IList value = default(IList)) - { - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the query result values. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GraphQueries.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GraphQueries.cs deleted file mode 100644 index 49fbc054ee412..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GraphQueries.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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 graph query to show the current data status - /// - public partial class GraphQueries - { - /// - /// Initializes a new instance of the GraphQueries class. - /// - public GraphQueries() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GraphQueries class. - /// - /// the metric that the query is - /// checking - /// The legend for the graph - /// The base query for the graph - public GraphQueries(string metricName = default(string), string legend = default(string), string baseQuery = default(string)) - { - MetricName = metricName; - Legend = legend; - BaseQuery = baseQuery; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the metric that the query is checking - /// - [JsonProperty(PropertyName = "metricName")] - public string MetricName { get; set; } - - /// - /// Gets or sets the legend for the graph - /// - [JsonProperty(PropertyName = "legend")] - public string Legend { get; set; } - - /// - /// Gets or sets the base query for the graph - /// - [JsonProperty(PropertyName = "baseQuery")] - public string BaseQuery { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GroupingConfiguration.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GroupingConfiguration.cs deleted file mode 100644 index be8d556224b51..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/GroupingConfiguration.cs +++ /dev/null @@ -1,134 +0,0 @@ -// -// 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; - - /// - /// Grouping configuration property bag. - /// - public partial class GroupingConfiguration - { - /// - /// Initializes a new instance of the GroupingConfiguration class. - /// - public GroupingConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the GroupingConfiguration class. - /// - /// Grouping enabled - /// Re-open closed matching - /// incidents - /// Limit the group to alerts created - /// within the lookback duration (in ISO 8601 duration format) - /// Grouping matching method. When method - /// is Selected at least one of groupByEntities, groupByAlertDetails, - /// groupByCustomDetails must be provided and not empty. Possible - /// values include: 'AllEntities', 'AnyAlert', 'Selected' - /// A list of entity types to group by - /// (when matchingMethod is Selected). Only entities defined in the - /// current alert rule may be used. - /// A list of alert details to group - /// by (when matchingMethod is Selected) - /// A list of custom details keys to - /// group by (when matchingMethod is Selected). Only keys defined in - /// the current alert rule may be used. - public GroupingConfiguration(bool enabled, bool reopenClosedIncident, System.TimeSpan lookbackDuration, string matchingMethod, IList groupByEntities = default(IList), IList groupByAlertDetails = default(IList), IList groupByCustomDetails = default(IList)) - { - Enabled = enabled; - ReopenClosedIncident = reopenClosedIncident; - LookbackDuration = lookbackDuration; - MatchingMethod = matchingMethod; - GroupByEntities = groupByEntities; - GroupByAlertDetails = groupByAlertDetails; - GroupByCustomDetails = groupByCustomDetails; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets grouping enabled - /// - [JsonProperty(PropertyName = "enabled")] - public bool Enabled { get; set; } - - /// - /// Gets or sets re-open closed matching incidents - /// - [JsonProperty(PropertyName = "reopenClosedIncident")] - public bool ReopenClosedIncident { get; set; } - - /// - /// Gets or sets limit the group to alerts created within the lookback - /// duration (in ISO 8601 duration format) - /// - [JsonProperty(PropertyName = "lookbackDuration")] - public System.TimeSpan LookbackDuration { get; set; } - - /// - /// Gets or sets grouping matching method. When method is Selected at - /// least one of groupByEntities, groupByAlertDetails, - /// groupByCustomDetails must be provided and not empty. Possible - /// values include: 'AllEntities', 'AnyAlert', 'Selected' - /// - [JsonProperty(PropertyName = "matchingMethod")] - public string MatchingMethod { get; set; } - - /// - /// Gets or sets a list of entity types to group by (when - /// matchingMethod is Selected). Only entities defined in the current - /// alert rule may be used. - /// - [JsonProperty(PropertyName = "groupByEntities")] - public IList GroupByEntities { get; set; } - - /// - /// Gets or sets a list of alert details to group by (when - /// matchingMethod is Selected) - /// - [JsonProperty(PropertyName = "groupByAlertDetails")] - public IList GroupByAlertDetails { get; set; } - - /// - /// Gets or sets a list of custom details keys to group by (when - /// matchingMethod is Selected). Only keys defined in the current alert - /// rule may be used. - /// - [JsonProperty(PropertyName = "groupByCustomDetails")] - public IList GroupByCustomDetails { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (MatchingMethod == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "MatchingMethod"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/HostEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/HostEntity.cs deleted file mode 100644 index c9f2118c37073..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/HostEntity.cs +++ /dev/null @@ -1,165 +0,0 @@ -// -// 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 host entity. - /// - [Newtonsoft.Json.JsonObject("Host")] - [Rest.Serialization.JsonTransformation] - public partial class HostEntity : Entity - { - /// - /// Initializes a new instance of the HostEntity class. - /// - public HostEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the HostEntity 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 azure resource id of the VM. - /// The DNS domain that this host belongs to. - /// Should contain the compete DNS suffix for the domain - /// The hostname without the domain - /// suffix. - /// Determines whether this host belongs - /// to a domain. - /// The host name (pre-windows2000). - /// The NT domain that this host belongs - /// to. - /// The OMS agent id, if the host has OMS - /// agent installed. - /// The operating system type. Possible values - /// include: 'Linux', 'Windows', 'Android', 'IOS', 'Unknown' - /// A free text representation of the operating - /// system. This field is meant to hold specific versions the are more - /// fine grained than OSFamily or future values not supported by - /// OSFamily enumeration - public HostEntity(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 azureID = default(string), string dnsDomain = default(string), string hostName = default(string), bool? isDomainJoined = default(bool?), string netBiosName = default(string), string ntDomain = default(string), string omsAgentID = default(string), OSFamily? osFamily = default(OSFamily?), string osVersion = default(string)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - AzureID = azureID; - DnsDomain = dnsDomain; - HostName = hostName; - IsDomainJoined = isDomainJoined; - NetBiosName = netBiosName; - NtDomain = ntDomain; - OmsAgentID = omsAgentID; - OsFamily = osFamily; - OsVersion = osVersion; - 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 azure resource id of the VM. - /// - [JsonProperty(PropertyName = "properties.azureID")] - public string AzureID { get; private set; } - - /// - /// Gets the DNS domain that this host belongs to. Should contain the - /// compete DNS suffix for the domain - /// - [JsonProperty(PropertyName = "properties.dnsDomain")] - public string DnsDomain { get; private set; } - - /// - /// Gets the hostname without the domain suffix. - /// - [JsonProperty(PropertyName = "properties.hostName")] - public string HostName { get; private set; } - - /// - /// Gets determines whether this host belongs to a domain. - /// - [JsonProperty(PropertyName = "properties.isDomainJoined")] - public bool? IsDomainJoined { get; private set; } - - /// - /// Gets the host name (pre-windows2000). - /// - [JsonProperty(PropertyName = "properties.netBiosName")] - public string NetBiosName { get; private set; } - - /// - /// Gets the NT domain that this host belongs to. - /// - [JsonProperty(PropertyName = "properties.ntDomain")] - public string NtDomain { get; private set; } - - /// - /// Gets the OMS agent id, if the host has OMS agent installed. - /// - [JsonProperty(PropertyName = "properties.omsAgentID")] - public string OmsAgentID { get; private set; } - - /// - /// Gets or sets the operating system type. Possible values include: - /// 'Linux', 'Windows', 'Android', 'IOS', 'Unknown' - /// - [JsonProperty(PropertyName = "properties.osFamily")] - public OSFamily? OsFamily { get; set; } - - /// - /// Gets a free text representation of the operating system. This field - /// is meant to hold specific versions the are more fine grained than - /// OSFamily or future values not supported by OSFamily enumeration - /// - [JsonProperty(PropertyName = "properties.osVersion")] - public string OsVersion { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/HuntingBookmark.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/HuntingBookmark.cs deleted file mode 100644 index b8308cccc64b8..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/HuntingBookmark.cs +++ /dev/null @@ -1,190 +0,0 @@ -// -// 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 Hunting bookmark entity. - /// - [Newtonsoft.Json.JsonObject("Bookmark")] - [Rest.Serialization.JsonTransformation] - public partial class HuntingBookmark : Entity - { - /// - /// Initializes a new instance of the HuntingBookmark class. - /// - public HuntingBookmark() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the HuntingBookmark class. - /// - /// The display name of the bookmark - /// The query of the bookmark. - /// 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 time the bookmark was created - /// Describes a user that created the - /// bookmark - /// The time of the event - /// List of labels relevant to this - /// bookmark - /// The notes of the bookmark - /// The query result of the bookmark. - /// The last time the bookmark was - /// updated - /// Describes a user that updated the - /// bookmark - /// Describes an incident that relates to - /// bookmark - public HuntingBookmark(string displayName, string query, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary additionalData = default(IDictionary), string friendlyName = default(string), System.DateTime? created = default(System.DateTime?), UserInfo createdBy = default(UserInfo), System.DateTime? eventTime = default(System.DateTime?), IList labels = default(IList), string notes = default(string), string queryResult = default(string), System.DateTime? updated = default(System.DateTime?), UserInfo updatedBy = default(UserInfo), IncidentInfo incidentInfo = default(IncidentInfo)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - Created = created; - CreatedBy = createdBy; - DisplayName = displayName; - EventTime = eventTime; - Labels = labels; - Notes = notes; - Query = query; - QueryResult = queryResult; - Updated = updated; - UpdatedBy = updatedBy; - IncidentInfo = incidentInfo; - 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 or sets the time the bookmark was created - /// - [JsonProperty(PropertyName = "properties.created")] - public System.DateTime? Created { get; set; } - - /// - /// Gets or sets describes a user that created the bookmark - /// - [JsonProperty(PropertyName = "properties.createdBy")] - public UserInfo CreatedBy { get; set; } - - /// - /// Gets or sets the display name of the bookmark - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the time of the event - /// - [JsonProperty(PropertyName = "properties.eventTime")] - public System.DateTime? EventTime { get; set; } - - /// - /// Gets or sets list of labels relevant to this bookmark - /// - [JsonProperty(PropertyName = "properties.labels")] - public IList Labels { get; set; } - - /// - /// Gets or sets the notes of the bookmark - /// - [JsonProperty(PropertyName = "properties.notes")] - public string Notes { get; set; } - - /// - /// Gets or sets the query of the bookmark. - /// - [JsonProperty(PropertyName = "properties.query")] - public string Query { get; set; } - - /// - /// Gets or sets the query result of the bookmark. - /// - [JsonProperty(PropertyName = "properties.queryResult")] - public string QueryResult { get; set; } - - /// - /// Gets or sets the last time the bookmark was updated - /// - [JsonProperty(PropertyName = "properties.updated")] - public System.DateTime? Updated { get; set; } - - /// - /// Gets or sets describes a user that updated the bookmark - /// - [JsonProperty(PropertyName = "properties.updatedBy")] - public UserInfo UpdatedBy { get; set; } - - /// - /// Gets or sets describes an incident that relates to bookmark - /// - [JsonProperty(PropertyName = "properties.incidentInfo")] - public IncidentInfo IncidentInfo { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DisplayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); - } - if (Query == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Query"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Incident.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Incident.cs index 2f10ad03050f4..9d7d25e0af371 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Incident.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Incident.cs @@ -39,14 +39,9 @@ public Incident() /// The status of the incident. Possible values /// include: 'New', 'Active', 'Closed' /// The title of the incident - /// 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. + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// Etag of the azure resource /// Additional data on the /// incident @@ -69,10 +64,6 @@ public Incident() /// A sequential number /// List of labels relevant to this /// incident - /// The name of the source provider that - /// generated the incident - /// The incident ID assigned by the - /// incident provider /// The time of the last activity in /// the incident /// The last time the incident was @@ -81,10 +72,8 @@ public Incident() /// to /// List of resource ids of /// Analytic rules related to the incident - /// Describes a team for the - /// incident - public Incident(string severity, string status, string title, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), IncidentAdditionalData additionalData = default(IncidentAdditionalData), string classification = default(string), string classificationComment = default(string), string classificationReason = default(string), System.DateTime? createdTimeUtc = default(System.DateTime?), string description = default(string), System.DateTime? firstActivityTimeUtc = default(System.DateTime?), string incidentUrl = default(string), int? incidentNumber = default(int?), IList labels = default(IList), string providerName = default(string), string providerIncidentId = default(string), System.DateTime? lastActivityTimeUtc = default(System.DateTime?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), IncidentOwnerInfo owner = default(IncidentOwnerInfo), IList relatedAnalyticRuleIds = default(IList), TeamInformation teamInformation = default(TeamInformation)) - : base(id, name, type, systemData, etag) + public Incident(string severity, string status, string title, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), IncidentAdditionalData additionalData = default(IncidentAdditionalData), string classification = default(string), string classificationComment = default(string), string classificationReason = default(string), System.DateTime? createdTimeUtc = default(System.DateTime?), string description = default(string), System.DateTime? firstActivityTimeUtc = default(System.DateTime?), string incidentUrl = default(string), int? incidentNumber = default(int?), IList labels = default(IList), System.DateTime? lastActivityTimeUtc = default(System.DateTime?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), IncidentOwnerInfo owner = default(IncidentOwnerInfo), IList relatedAnalyticRuleIds = default(IList)) + : base(id, name, type, etag) { AdditionalData = additionalData; Classification = classification; @@ -96,15 +85,12 @@ public Incident() IncidentUrl = incidentUrl; IncidentNumber = incidentNumber; Labels = labels; - ProviderName = providerName; - ProviderIncidentId = providerIncidentId; LastActivityTimeUtc = lastActivityTimeUtc; LastModifiedTimeUtc = lastModifiedTimeUtc; Owner = owner; RelatedAnalyticRuleIds = relatedAnalyticRuleIds; Severity = severity; Status = status; - TeamInformation = teamInformation; Title = title; CustomInit(); } @@ -178,19 +164,6 @@ public Incident() [JsonProperty(PropertyName = "properties.labels")] public IList Labels { get; set; } - /// - /// Gets or sets the name of the source provider that generated the - /// incident - /// - [JsonProperty(PropertyName = "properties.providerName")] - public string ProviderName { get; set; } - - /// - /// Gets or sets the incident ID assigned by the incident provider - /// - [JsonProperty(PropertyName = "properties.providerIncidentId")] - public string ProviderIncidentId { get; set; } - /// /// Gets or sets the time of the last activity in the incident /// @@ -229,12 +202,6 @@ public Incident() [JsonProperty(PropertyName = "properties.status")] public string Status { get; set; } - /// - /// Gets or sets describes a team for the incident - /// - [JsonProperty(PropertyName = "properties.teamInformation")] - public TeamInformation TeamInformation { get; set; } - /// /// Gets or sets the title of the incident /// diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentBookmarkList.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentBookmarkList.cs deleted file mode 100644 index 721d7dc4a0a80..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentBookmarkList.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -// 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; - - /// - /// List of incident bookmarks. - /// - public partial class IncidentBookmarkList - { - /// - /// Initializes a new instance of the IncidentBookmarkList class. - /// - public IncidentBookmarkList() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IncidentBookmarkList class. - /// - /// Array of incident bookmarks. - public IncidentBookmarkList(IList value) - { - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets array of incident bookmarks. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Value == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Value"); - } - if (Value != null) - { - foreach (var element in Value) - { - if (element != null) - { - element.Validate(); - } - } - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentComment.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentComment.cs index ddd11a29a4ea4..d1031fc39c108 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentComment.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentComment.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models /// Represents an incident comment /// [Rest.Serialization.JsonTransformation] - public partial class IncidentComment : ResourceWithEtag + public partial class IncidentComment : Resource { /// /// Initializes a new instance of the IncidentComment class. @@ -33,26 +33,17 @@ public IncidentComment() /// Initializes a new instance of the IncidentComment class. /// /// The comment message - /// 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 + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// The time the comment was /// created - /// The time the comment was - /// updated /// Describes the client that created the /// comment - public IncidentComment(string message, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), System.DateTime? createdTimeUtc = default(System.DateTime?), System.DateTime? lastModifiedTimeUtc = default(System.DateTime?), ClientInfo author = default(ClientInfo)) - : base(id, name, type, systemData, etag) + public IncidentComment(string message, string id = default(string), string name = default(string), string type = default(string), System.DateTime? createdTimeUtc = default(System.DateTime?), ClientInfo author = default(ClientInfo)) + : base(id, name, type) { CreatedTimeUtc = createdTimeUtc; - LastModifiedTimeUtc = lastModifiedTimeUtc; Message = message; Author = author; CustomInit(); @@ -69,12 +60,6 @@ public IncidentComment() [JsonProperty(PropertyName = "properties.createdTimeUtc")] public System.DateTime? CreatedTimeUtc { get; private set; } - /// - /// Gets the time the comment was updated - /// - [JsonProperty(PropertyName = "properties.lastModifiedTimeUtc")] - public System.DateTime? LastModifiedTimeUtc { get; private set; } - /// /// Gets or sets the comment message /// diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentConfiguration.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentConfiguration.cs deleted file mode 100644 index a1ec0918d2a69..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentConfiguration.cs +++ /dev/null @@ -1,77 +0,0 @@ -// -// 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; - - /// - /// Incident Configuration property bag. - /// - public partial class IncidentConfiguration - { - /// - /// Initializes a new instance of the IncidentConfiguration class. - /// - public IncidentConfiguration() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IncidentConfiguration class. - /// - /// Create incidents from alerts triggered - /// by this analytics rule - /// Set how the alerts that are - /// triggered by this analytics rule, are grouped into - /// incidents - public IncidentConfiguration(bool createIncident, GroupingConfiguration groupingConfiguration = default(GroupingConfiguration)) - { - CreateIncident = createIncident; - GroupingConfiguration = groupingConfiguration; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets create incidents from alerts triggered by this - /// analytics rule - /// - [JsonProperty(PropertyName = "createIncident")] - public bool CreateIncident { get; set; } - - /// - /// Gets or sets set how the alerts that are triggered by this - /// analytics rule, are grouped into incidents - /// - [JsonProperty(PropertyName = "groupingConfiguration")] - public GroupingConfiguration GroupingConfiguration { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (GroupingConfiguration != null) - { - GroupingConfiguration.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentEntitiesResponse.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentEntitiesResponse.cs deleted file mode 100644 index 977788a73b0b0..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentEntitiesResponse.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// 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 incident related entities response. - /// - public partial class IncidentEntitiesResponse - { - /// - /// Initializes a new instance of the IncidentEntitiesResponse class. - /// - public IncidentEntitiesResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IncidentEntitiesResponse class. - /// - /// Array of the incident related - /// entities. - /// The metadata from the incident related - /// entities results. - public IncidentEntitiesResponse(IList entities = default(IList), IList metaData = default(IList)) - { - Entities = entities; - MetaData = metaData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets array of the incident related entities. - /// - [JsonProperty(PropertyName = "entities")] - public IList Entities { get; set; } - - /// - /// Gets or sets the metadata from the incident related entities - /// results. - /// - [JsonProperty(PropertyName = "metaData")] - public IList MetaData { 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 deleted file mode 100644 index 4731429847eb9..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentEntitiesResultsMetadata.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// 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; - - /// - /// Information of a specific aggregation in the incident related entities - /// result. - /// - public partial class IncidentEntitiesResultsMetadata - { - /// - /// Initializes a new instance of the IncidentEntitiesResultsMetadata - /// class. - /// - public IncidentEntitiesResultsMetadata() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IncidentEntitiesResultsMetadata - /// class. - /// - /// Total number of aggregations of the given kind - /// in the incident related entities result. - /// The kind of the aggregated entity. - /// Possible values include: 'Account', 'Host', 'File', - /// 'AzureResource', 'CloudApplication', 'DnsResolution', 'FileHash', - /// 'Ip', 'Malware', 'Process', 'RegistryKey', 'RegistryValue', - /// 'SecurityGroup', 'Url', 'IoTDevice', 'SecurityAlert', 'Bookmark', - /// 'MailCluster', 'MailMessage', 'Mailbox', 'SubmissionMail' - public IncidentEntitiesResultsMetadata(int count, string entityKind) - { - Count = count; - EntityKind = entityKind; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets total number of aggregations of the given kind in the - /// incident related entities result. - /// - [JsonProperty(PropertyName = "count")] - public int Count { get; set; } - - /// - /// Gets or sets the kind of the aggregated entity. Possible values - /// include: 'Account', 'Host', 'File', 'AzureResource', - /// 'CloudApplication', 'DnsResolution', 'FileHash', 'Ip', 'Malware', - /// 'Process', 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'Url', - /// 'IoTDevice', 'SecurityAlert', 'Bookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' - /// - [JsonProperty(PropertyName = "entityKind")] - public string EntityKind { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (EntityKind == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "EntityKind"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentInfo.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentInfo.cs index 4bff183b19a84..ad9298165dfde 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentInfo.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentInfo.cs @@ -31,7 +31,8 @@ public IncidentInfo() /// /// Incident Id /// The severity of the incident. Possible - /// values include: 'High', 'Medium', 'Low', 'Informational' + /// values include: 'Critical', 'High', 'Medium', 'Low', + /// 'Informational' /// The title of the incident /// Relation Name public IncidentInfo(string incidentId = default(string), string severity = default(string), string title = default(string), string relationName = default(string)) @@ -56,7 +57,7 @@ public IncidentInfo() /// /// Gets or sets the severity of the incident. Possible values include: - /// 'High', 'Medium', 'Low', 'Informational' + /// 'Critical', 'High', 'Medium', 'Low', 'Informational' /// [JsonProperty(PropertyName = "severity")] public string Severity { 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 7f0e76a11915e..0259c7dd01bdd 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 @@ -37,16 +37,12 @@ public IncidentOwnerInfo() /// assigned to. /// The user principal name of the user /// the incident is assigned to. - /// The type of the owner the incident is - /// assigned to. Possible values include: 'Unknown', 'User', - /// 'Group' - public IncidentOwnerInfo(string email = default(string), string assignedTo = default(string), System.Guid? objectId = default(System.Guid?), string userPrincipalName = default(string), string ownerType = default(string)) + public IncidentOwnerInfo(string email = default(string), string assignedTo = default(string), System.Guid? objectId = default(System.Guid?), string userPrincipalName = default(string)) { Email = email; AssignedTo = assignedTo; ObjectId = objectId; UserPrincipalName = userPrincipalName; - OwnerType = ownerType; CustomInit(); } @@ -80,12 +76,5 @@ public IncidentOwnerInfo() [JsonProperty(PropertyName = "userPrincipalName")] public string UserPrincipalName { get; set; } - /// - /// Gets 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; } - } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItem.cs deleted file mode 100644 index bbbca350341fb..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItem.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// 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 Insight Query. - /// - [Newtonsoft.Json.JsonObject("Insight")] - public partial class InsightQueryItem : EntityQueryItem - { - /// - /// Initializes a new instance of the InsightQueryItem class. - /// - public InsightQueryItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the InsightQueryItem class. - /// - /// Query Template ARM ID - /// Query Template ARM Name - /// ARM Type - /// Properties bag for - /// InsightQueryItem - public InsightQueryItem(string id = default(string), string name = default(string), string type = default(string), InsightQueryItemProperties properties = default(InsightQueryItemProperties)) - : base(id, name, type) - { - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets properties bag for InsightQueryItem - /// - [JsonProperty(PropertyName = "properties")] - public InsightQueryItemProperties Properties { get; set; } - - } -} 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 deleted file mode 100644 index ac1af8ad82335..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemProperties.cs +++ /dev/null @@ -1,122 +0,0 @@ -// -// 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; - - /// - /// Represents Insight Query. - /// - public partial class InsightQueryItemProperties : EntityQueryItemProperties - { - /// - /// Initializes a new instance of the InsightQueryItemProperties class. - /// - public InsightQueryItemProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the InsightQueryItemProperties class. - /// - /// Data types for template - /// The type of the entity. Possible - /// values include: 'Account', 'Host', 'File', 'AzureResource', - /// 'CloudApplication', 'DNS', 'FileHash', 'IP', 'Malware', 'Process', - /// 'RegistryKey', 'RegistryValue', 'SecurityGroup', 'URL', - /// 'IoTDevice', 'SecurityAlert', 'HuntingBookmark', 'MailCluster', - /// 'MailMessage', 'Mailbox', 'SubmissionMail' - /// Data types for - /// template - /// The query applied only to entities - /// matching to all filters - /// The insight display name. - /// The insight description. - /// The base query of the insight. - /// The insight table query. - /// The insight chart query. - /// The activity query - /// definitions. - /// The insight chart query. - /// The insight chart query. - public InsightQueryItemProperties(IList dataTypes = default(IList), string inputEntityType = default(string), IList> requiredInputFieldsSets = default(IList>), object entitiesFilter = default(object), string displayName = default(string), string description = default(string), string baseQuery = default(string), InsightQueryItemPropertiesTableQuery tableQuery = default(InsightQueryItemPropertiesTableQuery), object chartQuery = default(object), InsightQueryItemPropertiesAdditionalQuery additionalQuery = default(InsightQueryItemPropertiesAdditionalQuery), InsightQueryItemPropertiesDefaultTimeRange defaultTimeRange = default(InsightQueryItemPropertiesDefaultTimeRange), InsightQueryItemPropertiesReferenceTimeRange referenceTimeRange = default(InsightQueryItemPropertiesReferenceTimeRange)) - : base(dataTypes, inputEntityType, requiredInputFieldsSets, entitiesFilter) - { - DisplayName = displayName; - Description = description; - BaseQuery = baseQuery; - TableQuery = tableQuery; - ChartQuery = chartQuery; - AdditionalQuery = additionalQuery; - DefaultTimeRange = defaultTimeRange; - ReferenceTimeRange = referenceTimeRange; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the insight display name. - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the insight description. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// Gets or sets the base query of the insight. - /// - [JsonProperty(PropertyName = "baseQuery")] - public string BaseQuery { get; set; } - - /// - /// Gets or sets the insight table query. - /// - [JsonProperty(PropertyName = "tableQuery")] - public InsightQueryItemPropertiesTableQuery TableQuery { get; set; } - - /// - /// Gets or sets the insight chart query. - /// - [JsonProperty(PropertyName = "chartQuery")] - public object ChartQuery { get; set; } - - /// - /// Gets or sets the activity query definitions. - /// - [JsonProperty(PropertyName = "additionalQuery")] - public InsightQueryItemPropertiesAdditionalQuery AdditionalQuery { get; set; } - - /// - /// Gets or sets the insight chart query. - /// - [JsonProperty(PropertyName = "defaultTimeRange")] - public InsightQueryItemPropertiesDefaultTimeRange DefaultTimeRange { get; set; } - - /// - /// Gets or sets the insight chart query. - /// - [JsonProperty(PropertyName = "referenceTimeRange")] - public InsightQueryItemPropertiesReferenceTimeRange ReferenceTimeRange { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesAdditionalQuery.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesAdditionalQuery.cs deleted file mode 100644 index 60480cc3e7a28..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesAdditionalQuery.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// 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 activity query definitions. - /// - public partial class InsightQueryItemPropertiesAdditionalQuery - { - /// - /// Initializes a new instance of the - /// InsightQueryItemPropertiesAdditionalQuery class. - /// - public InsightQueryItemPropertiesAdditionalQuery() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// InsightQueryItemPropertiesAdditionalQuery class. - /// - /// The insight query. - /// The insight text. - public InsightQueryItemPropertiesAdditionalQuery(string query = default(string), string text = default(string)) - { - Query = query; - Text = text; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the insight query. - /// - [JsonProperty(PropertyName = "query")] - public string Query { get; set; } - - /// - /// Gets or sets the insight text. - /// - [JsonProperty(PropertyName = "text")] - public string Text { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesDefaultTimeRange.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesDefaultTimeRange.cs deleted file mode 100644 index f4392ca2832c5..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesDefaultTimeRange.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// 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 insight chart query. - /// - public partial class InsightQueryItemPropertiesDefaultTimeRange - { - /// - /// Initializes a new instance of the - /// InsightQueryItemPropertiesDefaultTimeRange class. - /// - public InsightQueryItemPropertiesDefaultTimeRange() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// InsightQueryItemPropertiesDefaultTimeRange class. - /// - /// The padding for the start time of the - /// query. - /// The padding for the end time of the - /// query. - public InsightQueryItemPropertiesDefaultTimeRange(string beforeRange = default(string), string afterRange = default(string)) - { - BeforeRange = beforeRange; - AfterRange = afterRange; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the padding for the start time of the query. - /// - [JsonProperty(PropertyName = "beforeRange")] - public string BeforeRange { get; set; } - - /// - /// Gets or sets the padding for the end time of the query. - /// - [JsonProperty(PropertyName = "afterRange")] - public string AfterRange { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesReferenceTimeRange.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesReferenceTimeRange.cs deleted file mode 100644 index dc43f315b7b42..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesReferenceTimeRange.cs +++ /dev/null @@ -1,54 +0,0 @@ -// -// 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 insight chart query. - /// - public partial class InsightQueryItemPropertiesReferenceTimeRange - { - /// - /// Initializes a new instance of the - /// InsightQueryItemPropertiesReferenceTimeRange class. - /// - public InsightQueryItemPropertiesReferenceTimeRange() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// InsightQueryItemPropertiesReferenceTimeRange class. - /// - /// Additional query time for looking - /// back. - public InsightQueryItemPropertiesReferenceTimeRange(string beforeRange = default(string)) - { - BeforeRange = beforeRange; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets additional query time for looking back. - /// - [JsonProperty(PropertyName = "beforeRange")] - public string BeforeRange { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesTableQuery.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesTableQuery.cs deleted file mode 100644 index e6c0155561d18..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesTableQuery.cs +++ /dev/null @@ -1,65 +0,0 @@ -// -// 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 insight table query. - /// - public partial class InsightQueryItemPropertiesTableQuery - { - /// - /// Initializes a new instance of the - /// InsightQueryItemPropertiesTableQuery class. - /// - public InsightQueryItemPropertiesTableQuery() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// InsightQueryItemPropertiesTableQuery class. - /// - /// List of insight column - /// definitions. - /// List of insight queries - /// definitions. - public InsightQueryItemPropertiesTableQuery(IList columnsDefinitions = default(IList), IList queriesDefinitions = default(IList)) - { - ColumnsDefinitions = columnsDefinitions; - QueriesDefinitions = queriesDefinitions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of insight column definitions. - /// - [JsonProperty(PropertyName = "columnsDefinitions")] - public IList ColumnsDefinitions { get; set; } - - /// - /// Gets or sets list of insight queries definitions. - /// - [JsonProperty(PropertyName = "queriesDefinitions")] - public IList QueriesDefinitions { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.cs deleted file mode 100644 index 68c0b92c15a7b..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -// 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 InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem - { - /// - /// Initializes a new instance of the - /// InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem class. - /// - public InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem class. - /// - /// Insight column header. - /// Insights Column type. Possible values - /// include: 'Number', 'String', 'Date', 'Entity' - /// Is query supports deep-link. - public InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem(string header = default(string), string outputType = default(string), bool? supportDeepLink = default(bool?)) - { - Header = header; - OutputType = outputType; - SupportDeepLink = supportDeepLink; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets insight column header. - /// - [JsonProperty(PropertyName = "header")] - public string Header { get; set; } - - /// - /// Gets or sets insights Column type. Possible values include: - /// 'Number', 'String', 'Date', 'Entity' - /// - [JsonProperty(PropertyName = "outputType")] - public string OutputType { get; set; } - - /// - /// Gets or sets is query supports deep-link. - /// - [JsonProperty(PropertyName = "supportDeepLink")] - public bool? SupportDeepLink { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.cs deleted file mode 100644 index 25c8c83e6b7f2..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem.cs +++ /dev/null @@ -1,76 +0,0 @@ -// -// 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 InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem - { - /// - /// Initializes a new instance of the - /// InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem class. - /// - public InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem class. - /// - /// Insight column header. - /// Insight column header. - /// Insight column header. - /// Insight column header. - public InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem(string filter = default(string), string summarize = default(string), string project = default(string), IList linkColumnsDefinitions = default(IList)) - { - Filter = filter; - Summarize = summarize; - Project = project; - LinkColumnsDefinitions = linkColumnsDefinitions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets insight column header. - /// - [JsonProperty(PropertyName = "filter")] - public string Filter { get; set; } - - /// - /// Gets or sets insight column header. - /// - [JsonProperty(PropertyName = "summarize")] - public string Summarize { get; set; } - - /// - /// Gets or sets insight column header. - /// - [JsonProperty(PropertyName = "project")] - public string Project { get; set; } - - /// - /// Gets or sets insight column header. - /// - [JsonProperty(PropertyName = "linkColumnsDefinitions")] - public IList LinkColumnsDefinitions { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItemLinkColumnsDefinitionsItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItemLinkColumnsDefinitionsItem.cs deleted file mode 100644 index e08d55d4383e1..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightQueryItemPropertiesTableQueryQueriesDefinitionsItemLinkColumnsDefinitionsItem.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// 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 InsightQueryItemPropertiesTableQueryQueriesDefinitionsItemLinkColumnsDefinitionsItem - { - /// - /// Initializes a new instance of the - /// InsightQueryItemPropertiesTableQueryQueriesDefinitionsItemLinkColumnsDefinitionsItem - /// class. - /// - public InsightQueryItemPropertiesTableQueryQueriesDefinitionsItemLinkColumnsDefinitionsItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// InsightQueryItemPropertiesTableQueryQueriesDefinitionsItemLinkColumnsDefinitionsItem - /// class. - /// - /// Insight Link Definition Projected - /// Name. - /// Insight Link Definition Query. - public InsightQueryItemPropertiesTableQueryQueriesDefinitionsItemLinkColumnsDefinitionsItem(string projectedName = default(string), string query = default(string)) - { - ProjectedName = projectedName; - Query = query; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets insight Link Definition Projected Name. - /// - [JsonProperty(PropertyName = "projectedName")] - public string ProjectedName { get; set; } - - /// - /// Gets or sets insight Link Definition Query. - /// - [JsonProperty(PropertyName = "Query")] - public string Query { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightsTableResult.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightsTableResult.cs deleted file mode 100644 index 07fdde8d4470d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightsTableResult.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// 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; - - /// - /// Query results for table insights query. - /// - public partial class InsightsTableResult - { - /// - /// Initializes a new instance of the InsightsTableResult class. - /// - public InsightsTableResult() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the InsightsTableResult class. - /// - /// Columns Metadata of the table - /// Rows data of the table - public InsightsTableResult(IList columns = default(IList), IList> rows = default(IList>)) - { - Columns = columns; - Rows = rows; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets columns Metadata of the table - /// - [JsonProperty(PropertyName = "columns")] - public IList Columns { get; set; } - - /// - /// Gets or sets rows data of the table - /// - [JsonProperty(PropertyName = "rows")] - public IList> Rows { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightsTableResultColumnsItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightsTableResultColumnsItem.cs deleted file mode 100644 index 0af432ad43c71..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InsightsTableResultColumnsItem.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// 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 InsightsTableResultColumnsItem - { - /// - /// Initializes a new instance of the InsightsTableResultColumnsItem - /// class. - /// - public InsightsTableResultColumnsItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the InsightsTableResultColumnsItem - /// class. - /// - /// the type of the colum - /// the name of the colum - public InsightsTableResultColumnsItem(string type = default(string), string name = default(string)) - { - Type = type; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the type of the colum - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets the name of the colum - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InstructionSteps.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InstructionSteps.cs deleted file mode 100644 index 17f6aa4273c1d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InstructionSteps.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// 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; - - /// - /// Instruction steps to enable the connector - /// - public partial class InstructionSteps - { - /// - /// Initializes a new instance of the InstructionSteps class. - /// - public InstructionSteps() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the InstructionSteps class. - /// - /// Instruction step title - /// Instruction step description - /// Instruction step details - public InstructionSteps(string title = default(string), string description = default(string), IList instructions = default(IList)) - { - Title = title; - Description = description; - Instructions = instructions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets instruction step title - /// - [JsonProperty(PropertyName = "title")] - public string Title { get; set; } - - /// - /// Gets or sets instruction step description - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// Gets or sets instruction step details - /// - [JsonProperty(PropertyName = "instructions")] - public IList Instructions { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InstructionStepsInstructionsItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InstructionStepsInstructionsItem.cs deleted file mode 100644 index f78d430c9203e..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/InstructionStepsInstructionsItem.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// 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 InstructionStepsInstructionsItem : ConnectorInstructionModelBase - { - /// - /// Initializes a new instance of the InstructionStepsInstructionsItem - /// class. - /// - public InstructionStepsInstructionsItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the InstructionStepsInstructionsItem - /// class. - /// - /// The kind of the setting. Possible values - /// include: 'CopyableLabel', 'InstructionStepsGroup', - /// 'InfoMessage' - /// The parameters for the setting - public InstructionStepsInstructionsItem(string type, object parameters = default(object)) - : base(type, parameters) - { - 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/IoTDeviceEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IoTDeviceEntity.cs deleted file mode 100644 index bf806cb66aa6c..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IoTDeviceEntity.cs +++ /dev/null @@ -1,225 +0,0 @@ -// -// 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 IoT device entity. - /// - [Newtonsoft.Json.JsonObject("IoTDevice")] - [Rest.Serialization.JsonTransformation] - public partial class IoTDeviceEntity : Entity - { - /// - /// Initializes a new instance of the IoTDeviceEntity class. - /// - public IoTDeviceEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IoTDeviceEntity 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 ID of the IoT Device in the IoT - /// Hub - /// The friendly name of the device - /// The source of the device - /// The ID of the security agent - /// running on the device - /// The type of the device - /// The vendor of the device - /// The ID of the edge device - /// The MAC address of the device - /// The model of the device - /// The serial number of the device - /// The firmware version of the - /// device - /// The operating system of the - /// device - /// The AzureResource entity id of the IoT - /// Hub - /// The Host entity id of this - /// device - /// The IP entity if of this - /// device - /// A list of TI contexts attached to - /// 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)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - DeviceId = deviceId; - DeviceName = deviceName; - Source = source; - IotSecurityAgentId = iotSecurityAgentId; - DeviceType = deviceType; - Vendor = vendor; - EdgeId = edgeId; - MacAddress = macAddress; - Model = model; - SerialNumber = serialNumber; - FirmwareVersion = firmwareVersion; - OperatingSystem = operatingSystem; - IotHubEntityId = iotHubEntityId; - HostEntityId = hostEntityId; - IpAddressEntityId = ipAddressEntityId; - ThreatIntelligence = threatIntelligence; - Protocols = protocols; - 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 ID of the IoT Device in the IoT Hub - /// - [JsonProperty(PropertyName = "properties.deviceId")] - public string DeviceId { get; private set; } - - /// - /// Gets the friendly name of the device - /// - [JsonProperty(PropertyName = "properties.deviceName")] - public string DeviceName { get; private set; } - - /// - /// Gets the source of the device - /// - [JsonProperty(PropertyName = "properties.source")] - public string Source { get; private set; } - - /// - /// Gets the ID of the security agent running on the device - /// - [JsonProperty(PropertyName = "properties.iotSecurityAgentId")] - public System.Guid? IotSecurityAgentId { get; private set; } - - /// - /// Gets the type of the device - /// - [JsonProperty(PropertyName = "properties.deviceType")] - public string DeviceType { get; private set; } - - /// - /// Gets the vendor of the device - /// - [JsonProperty(PropertyName = "properties.vendor")] - public string Vendor { get; private set; } - - /// - /// Gets the ID of the edge device - /// - [JsonProperty(PropertyName = "properties.edgeId")] - public string EdgeId { get; private set; } - - /// - /// Gets the MAC address of the device - /// - [JsonProperty(PropertyName = "properties.macAddress")] - public string MacAddress { get; private set; } - - /// - /// Gets the model of the device - /// - [JsonProperty(PropertyName = "properties.model")] - public string Model { get; private set; } - - /// - /// Gets the serial number of the device - /// - [JsonProperty(PropertyName = "properties.serialNumber")] - public string SerialNumber { get; private set; } - - /// - /// Gets the firmware version of the device - /// - [JsonProperty(PropertyName = "properties.firmwareVersion")] - public string FirmwareVersion { get; private set; } - - /// - /// Gets the operating system of the device - /// - [JsonProperty(PropertyName = "properties.operatingSystem")] - public string OperatingSystem { get; private set; } - - /// - /// Gets the AzureResource entity id of the IoT Hub - /// - [JsonProperty(PropertyName = "properties.iotHubEntityId")] - public string IotHubEntityId { get; private set; } - - /// - /// Gets the Host entity id of this device - /// - [JsonProperty(PropertyName = "properties.hostEntityId")] - public string HostEntityId { get; private set; } - - /// - /// Gets the IP entity if of this device - /// - [JsonProperty(PropertyName = "properties.ipAddressEntityId")] - public string IpAddressEntityId { get; private set; } - - /// - /// Gets a list of TI contexts attached to the IoTDevice entity. - /// - [JsonProperty(PropertyName = "properties.threatIntelligence")] - public IList ThreatIntelligence { get; private set; } - - /// - /// Gets a list of protocols of the IoTDevice entity. - /// - [JsonProperty(PropertyName = "properties.protocols")] - public IList Protocols { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IpEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IpEntity.cs deleted file mode 100644 index 92ad4e8230635..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IpEntity.cs +++ /dev/null @@ -1,108 +0,0 @@ -// -// 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 ip entity. - /// - [Newtonsoft.Json.JsonObject("Ip")] - [Rest.Serialization.JsonTransformation] - public partial class IpEntity : Entity - { - /// - /// Initializes a new instance of the IpEntity class. - /// - public IpEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IpEntity 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 IP address as string, e.g. 127.0.0.1 - /// (either in Ipv4 or Ipv6) - /// The geo-location context attached to the ip - /// entity - /// A list of TI contexts attached to - /// the ip entity. - public IpEntity(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 address = default(string), GeoLocation location = default(GeoLocation), IList threatIntelligence = default(IList)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - Address = address; - Location = location; - ThreatIntelligence = threatIntelligence; - 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 IP address as string, e.g. 127.0.0.1 (either in Ipv4 or - /// Ipv6) - /// - [JsonProperty(PropertyName = "properties.address")] - public string Address { get; private set; } - - /// - /// Gets or sets the geo-location context attached to the ip entity - /// - [JsonProperty(PropertyName = "properties.location")] - public GeoLocation Location { get; set; } - - /// - /// Gets a list of TI contexts attached to the ip entity. - /// - [JsonProperty(PropertyName = "properties.threatIntelligence")] - public IList ThreatIntelligence { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/KillChainIntent.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/KillChainIntent.cs deleted file mode 100644 index 8fe2ba76d4313..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/KillChainIntent.cs +++ /dev/null @@ -1,136 +0,0 @@ -// -// 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 KillChainIntent. - /// - public static class KillChainIntent - { - /// - /// The default value. - /// - public const string Unknown = "Unknown"; - /// - /// Probing could be an attempt to access a certain resource regardless - /// of a malicious intent or a failed attempt to gain access to a - /// target system to gather information prior to exploitation. This - /// step is usually detected as an attempt originating from outside the - /// network in attempt to scan the target system and find a way in. - /// - public const string Probing = "Probing"; - /// - /// Exploitation is the stage where an attacker manage to get foothold - /// on the attacked resource. This stage is applicable not only for - /// compute hosts, but also for resources such as user accounts, - /// certificates etc. Adversaries will often be able to control the - /// resource after this stage. - /// - public const string Exploitation = "Exploitation"; - /// - /// Persistence is any access, action, or configuration change to a - /// system that gives an adversary a persistent presence on that - /// system. Adversaries will often need to maintain access to systems - /// through interruptions such as system restarts, loss of credentials, - /// or other failures that would require a remote access tool to - /// restart or alternate backdoor for them to regain access. - /// - public const string Persistence = "Persistence"; - /// - /// Privilege escalation is the result of actions that allow an - /// adversary to obtain a higher level of permissions on a system or - /// network. Certain tools or actions require a higher level of - /// privilege to work and are likely necessary at many points - /// throughout an operation. User accounts with permissions to access - /// specific systems or perform specific functions necessary for - /// adversaries to achieve their objective may also be considered an - /// escalation of privilege. - /// - public const string PrivilegeEscalation = "PrivilegeEscalation"; - /// - /// Defense evasion consists of techniques an adversary may use to - /// evade detection or avoid other defenses. Sometimes these actions - /// are the same as or variations of techniques in other categories - /// that have the added benefit of subverting a particular defense or - /// mitigation. - /// - public const string DefenseEvasion = "DefenseEvasion"; - /// - /// Credential access represents techniques resulting in access to or - /// control over system, domain, or service credentials that are used - /// within an enterprise environment. Adversaries will likely attempt - /// to obtain legitimate credentials from users or administrator - /// accounts (local system administrator or domain users with - /// administrator access) to use within the network. With sufficient - /// access within a network, an adversary can create accounts for later - /// use within the environment. - /// - public const string CredentialAccess = "CredentialAccess"; - /// - /// Discovery consists of techniques that allow the adversary to gain - /// knowledge about the system and internal network. When adversaries - /// gain access to a new system, they must orient themselves to what - /// they now have control of and what benefits operating from that - /// system give to their current objective or overall goals during the - /// intrusion. The operating system provides many native tools that aid - /// in this post-compromise information-gathering phase. - /// - public const string Discovery = "Discovery"; - /// - /// Lateral movement consists of techniques that enable an adversary to - /// access and control remote systems on a network and could, but does - /// not necessarily, include execution of tools on remote systems. The - /// lateral movement techniques could allow an adversary to gather - /// information from a system without needing additional tools, such as - /// a remote access tool. An adversary can use lateral movement for - /// many purposes, including remote Execution of tools, pivoting to - /// additional systems, access to specific information or files, access - /// to additional credentials, or to cause an effect. - /// - public const string LateralMovement = "LateralMovement"; - /// - /// The execution tactic represents techniques that result in execution - /// of adversary-controlled code on a local or remote system. This - /// tactic is often used in conjunction with lateral movement to expand - /// access to remote systems on a network. - /// - public const string Execution = "Execution"; - /// - /// Collection consists of techniques used to identify and gather - /// information, such as sensitive files, from a target network prior - /// to exfiltration. This category also covers locations on a system or - /// network where the adversary may look for information to exfiltrate. - /// - public const string Collection = "Collection"; - /// - /// Exfiltration refers to techniques and attributes that result or aid - /// in the adversary removing files and information from a target - /// network. This category also covers locations on a system or network - /// where the adversary may look for information to exfiltrate. - /// - public const string Exfiltration = "Exfiltration"; - /// - /// The command and control tactic represents how adversaries - /// communicate with systems under their control within a target - /// network. - /// - public const string CommandAndControl = "CommandAndControl"; - /// - /// The impact intent primary objective is to directly reduce the - /// availability or integrity of a system, service, or network; - /// including manipulation of data to impact a business or operational - /// process. This would often refer to techniques such as ransom-ware, - /// defacement, data manipulation and others. - /// - public const string Impact = "Impact"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Kind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Kind.cs deleted file mode 100644 index 40245664f69f4..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Kind.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// 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 Kind. - /// - public static class Kind - { - public const string DataConnector = "DataConnector"; - public const string DataType = "DataType"; - public const string Workbook = "Workbook"; - public const string WorkbookTemplate = "WorkbookTemplate"; - public const string Playbook = "Playbook"; - public const string PlaybookTemplate = "PlaybookTemplate"; - public const string AnalyticsRuleTemplate = "AnalyticsRuleTemplate"; - public const string AnalyticsRule = "AnalyticsRule"; - public const string HuntingQuery = "HuntingQuery"; - public const string InvestigationQuery = "InvestigationQuery"; - public const string Parser = "Parser"; - public const string Watchlist = "Watchlist"; - public const string WatchlistTemplate = "WatchlistTemplate"; - public const string Solution = "Solution"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/LastDataReceivedDataType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/LastDataReceivedDataType.cs deleted file mode 100644 index 82a21d26c8329..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/LastDataReceivedDataType.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// 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; - - /// - /// Data type for last data received - /// - public partial class LastDataReceivedDataType - { - /// - /// Initializes a new instance of the LastDataReceivedDataType class. - /// - public LastDataReceivedDataType() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the LastDataReceivedDataType class. - /// - /// Name of the data type to show in the graph. can - /// be use with {{graphQueriesTableName}} placeholder - /// Query for indicate last data - /// received - public LastDataReceivedDataType(string name = default(string), string lastDataReceivedQuery = default(string)) - { - Name = name; - LastDataReceivedQuery = lastDataReceivedQuery; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the data type to show in the graph. can be use - /// with {{graphQueriesTableName}} placeholder - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets query for indicate last data received - /// - [JsonProperty(PropertyName = "lastDataReceivedQuery")] - public string LastDataReceivedQuery { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryTemplateKind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/LicenseStatus.cs similarity index 72% rename from sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryTemplateKind.cs rename to sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/LicenseStatus.cs index 6a5573517b807..5791bdcbd9b92 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EntityQueryTemplateKind.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/LicenseStatus.cs @@ -12,10 +12,11 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { /// - /// Defines values for EntityQueryTemplateKind. + /// Defines values for LicenseStatus. /// - public static class EntityQueryTemplateKind + public static class LicenseStatus { - public const string Activity = "Activity"; + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MCASCheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MCASCheckRequirements.cs deleted file mode 100644 index 2141fe88c009a..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MCASCheckRequirements.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents MCAS (Microsoft Cloud App Security) requirements check - /// request. - /// - [Newtonsoft.Json.JsonObject("MicrosoftCloudAppSecurity")] - [Rest.Serialization.JsonTransformation] - public partial class MCASCheckRequirements : DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the MCASCheckRequirements class. - /// - public MCASCheckRequirements() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MCASCheckRequirements class. - /// - /// The tenant id to connect to, and get the - /// data from. - public MCASCheckRequirements(string tenantId) - { - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MCASDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MCASDataConnector.cs index 75978d4c8e427..77df2ea8a0738 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MCASDataConnector.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MCASDataConnector.cs @@ -33,21 +33,16 @@ public MCASDataConnector() /// /// Initializes a new instance of the MCASDataConnector class. /// + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Etag of the azure resource /// The tenant id to connect to, and get the /// data from. /// The available data types for the /// connector. - /// 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 MCASDataConnector(string tenantId, MCASDataConnectorDataTypes dataTypes, 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) + public MCASDataConnector(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string tenantId = default(string), MCASDataConnectorDataTypes dataTypes = default(MCASDataConnectorDataTypes)) + : base(id, name, type, etag) { TenantId = tenantId; DataTypes = dataTypes; @@ -71,26 +66,5 @@ public MCASDataConnector() [JsonProperty(PropertyName = "properties.dataTypes")] public MCASDataConnectorDataTypes DataTypes { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - if (DataTypes == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataTypes"); - } - if (DataTypes != null) - { - DataTypes.Validate(); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MCASDataConnectorDataTypes.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MCASDataConnectorDataTypes.cs index 9e34dbe52654e..0c04dc116f3e1 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MCASDataConnectorDataTypes.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MCASDataConnectorDataTypes.cs @@ -33,7 +33,7 @@ public MCASDataConnectorDataTypes() /// Alerts data type connection. /// Discovery log data type /// connection. - public MCASDataConnectorDataTypes(DataConnectorDataTypeCommon alerts, DataConnectorDataTypeCommon discoveryLogs = default(DataConnectorDataTypeCommon)) + public MCASDataConnectorDataTypes(DataConnectorDataTypeCommon alerts = default(DataConnectorDataTypeCommon), DataConnectorDataTypeCommon discoveryLogs = default(DataConnectorDataTypeCommon)) : base(alerts) { DiscoveryLogs = discoveryLogs; @@ -51,19 +51,5 @@ public MCASDataConnectorDataTypes() [JsonProperty(PropertyName = "discoveryLogs")] public DataConnectorDataTypeCommon DiscoveryLogs { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (DiscoveryLogs != null) - { - DiscoveryLogs.Validate(); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MDATPCheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MDATPCheckRequirements.cs deleted file mode 100644 index 8bf39c59133e8..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MDATPCheckRequirements.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents MDATP (Microsoft Defender Advanced Threat Protection) - /// requirements check request. - /// - [Newtonsoft.Json.JsonObject("MicrosoftDefenderAdvancedThreatProtection")] - [Rest.Serialization.JsonTransformation] - public partial class MDATPCheckRequirements : DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the MDATPCheckRequirements class. - /// - public MDATPCheckRequirements() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MDATPCheckRequirements class. - /// - /// The tenant id to connect to, and get the - /// data from. - public MDATPCheckRequirements(string tenantId) - { - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MDATPDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MDATPDataConnector.cs index cfeaedadc5dd5..5cbec5f4150b6 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MDATPDataConnector.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MDATPDataConnector.cs @@ -34,21 +34,16 @@ public MDATPDataConnector() /// /// Initializes a new instance of the MDATPDataConnector class. /// + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Etag of the azure resource /// The tenant id to connect to, and get the /// data from. - /// 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 available data types for the /// connector. - public MDATPDataConnector(string tenantId, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), AlertsDataTypeOfDataConnector dataTypes = default(AlertsDataTypeOfDataConnector)) - : base(id, name, type, systemData, etag) + public MDATPDataConnector(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string tenantId = default(string), AlertsDataTypeOfDataConnector dataTypes = default(AlertsDataTypeOfDataConnector)) + : base(id, name, type, etag) { TenantId = tenantId; DataTypes = dataTypes; @@ -72,22 +67,5 @@ public MDATPDataConnector() [JsonProperty(PropertyName = "properties.dataTypes")] public AlertsDataTypeOfDataConnector DataTypes { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - if (DataTypes != null) - { - DataTypes.Validate(); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MLBehaviorAnalyticsAlertRule.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MLBehaviorAnalyticsAlertRule.cs deleted file mode 100644 index f4ab67d2d5a07..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MLBehaviorAnalyticsAlertRule.cs +++ /dev/null @@ -1,140 +0,0 @@ -// -// 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 MLBehaviorAnalytics alert rule. - /// - [Newtonsoft.Json.JsonObject("MLBehaviorAnalytics")] - [Rest.Serialization.JsonTransformation] - public partial class MLBehaviorAnalyticsAlertRule : AlertRule - { - /// - /// Initializes a new instance of the MLBehaviorAnalyticsAlertRule - /// class. - /// - public MLBehaviorAnalyticsAlertRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MLBehaviorAnalyticsAlertRule - /// class. - /// - /// The Name of the alert rule - /// template used to create this rule. - /// Determines whether this alert rule is enabled - /// or disabled. - /// 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 alert - /// rule. - /// The display name for alerts created by - /// this alert rule. - /// The last time that this alert rule - /// has been modified. - /// The severity for alerts created by this - /// alert rule. Possible values include: 'High', 'Medium', 'Low', - /// 'Informational' - /// The tactics of the alert rule - public MLBehaviorAnalyticsAlertRule(string alertRuleTemplateName, bool enabled, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string description = default(string), string displayName = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?), string severity = default(string), IList tactics = default(IList)) - : base(id, name, type, systemData, etag) - { - AlertRuleTemplateName = alertRuleTemplateName; - Description = description; - DisplayName = displayName; - Enabled = enabled; - LastModifiedUtc = lastModifiedUtc; - Severity = severity; - Tactics = tactics; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Name of the alert rule template used to create - /// this rule. - /// - [JsonProperty(PropertyName = "properties.alertRuleTemplateName")] - public string AlertRuleTemplateName { get; set; } - - /// - /// Gets the description of the alert rule. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } - - /// - /// Gets the display name for alerts created by this alert rule. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets or sets determines whether this alert rule is enabled or - /// disabled. - /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool Enabled { get; set; } - - /// - /// Gets the last time that this alert rule has been modified. - /// - [JsonProperty(PropertyName = "properties.lastModifiedUtc")] - public System.DateTime? LastModifiedUtc { get; private set; } - - /// - /// Gets the severity for alerts created by this alert rule. Possible - /// values include: 'High', 'Medium', 'Low', 'Informational' - /// - [JsonProperty(PropertyName = "properties.severity")] - public string Severity { get; private set; } - - /// - /// Gets the tactics of the alert rule - /// - [JsonProperty(PropertyName = "properties.tactics")] - public IList Tactics { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AlertRuleTemplateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AlertRuleTemplateName"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MLBehaviorAnalyticsAlertRuleTemplate.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MLBehaviorAnalyticsAlertRuleTemplate.cs deleted file mode 100644 index 4b9b054cff4b3..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MLBehaviorAnalyticsAlertRuleTemplate.cs +++ /dev/null @@ -1,158 +0,0 @@ -// -// 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 MLBehaviorAnalytics alert rule template. - /// - [Newtonsoft.Json.JsonObject("MLBehaviorAnalytics")] - [Rest.Serialization.JsonTransformation] - public partial class MLBehaviorAnalyticsAlertRuleTemplate : AlertRuleTemplate - { - /// - /// Initializes a new instance of the - /// MLBehaviorAnalyticsAlertRuleTemplate class. - /// - public MLBehaviorAnalyticsAlertRuleTemplate() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// MLBehaviorAnalyticsAlertRuleTemplate class. - /// - /// The severity for alerts created by this - /// alert rule. Possible values include: 'High', 'Medium', 'Low', - /// 'Informational' - /// 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 number of alert - /// rules that were created by this template - /// The last time that this alert rule - /// template has been updated. - /// The time that this alert rule template - /// has been added. - /// The description of the alert rule - /// template. - /// The display name for alert rule - /// template. - /// The required data sources for - /// this template - /// The alert rule template status. Possible - /// values include: 'Installed', 'Available', 'NotAvailable' - /// The tactics of the alert rule - /// template. - public MLBehaviorAnalyticsAlertRuleTemplate(string severity, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), int? alertRulesCreatedByTemplateCount = default(int?), System.DateTime? lastUpdatedDateUTC = default(System.DateTime?), System.DateTime? createdDateUTC = default(System.DateTime?), string description = default(string), string displayName = default(string), IList requiredDataConnectors = default(IList), string status = default(string), IList tactics = default(IList)) - : base(id, name, type, systemData) - { - AlertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; - LastUpdatedDateUTC = lastUpdatedDateUTC; - CreatedDateUTC = createdDateUTC; - Description = description; - DisplayName = displayName; - RequiredDataConnectors = requiredDataConnectors; - Status = status; - Severity = severity; - Tactics = tactics; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the number of alert rules that were created by this - /// template - /// - [JsonProperty(PropertyName = "properties.alertRulesCreatedByTemplateCount")] - public int? AlertRulesCreatedByTemplateCount { get; set; } - - /// - /// Gets the last time that this alert rule template has been updated. - /// - [JsonProperty(PropertyName = "properties.lastUpdatedDateUTC")] - public System.DateTime? LastUpdatedDateUTC { get; private set; } - - /// - /// Gets the time that this alert rule template has been added. - /// - [JsonProperty(PropertyName = "properties.createdDateUTC")] - public System.DateTime? CreatedDateUTC { get; private set; } - - /// - /// Gets or sets the description of the alert rule template. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the display name for alert rule template. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the required data sources for this template - /// - [JsonProperty(PropertyName = "properties.requiredDataConnectors")] - public IList RequiredDataConnectors { get; set; } - - /// - /// Gets or sets the alert rule template status. Possible values - /// include: 'Installed', 'Available', 'NotAvailable' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - - /// - /// Gets or sets the severity for alerts created by this alert rule. - /// Possible values include: 'High', 'Medium', 'Low', 'Informational' - /// - [JsonProperty(PropertyName = "properties.severity")] - public string Severity { get; set; } - - /// - /// Gets or sets the tactics of the alert rule template. - /// - [JsonProperty(PropertyName = "properties.tactics")] - public IList Tactics { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Severity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Severity"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTICheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTICheckRequirements.cs deleted file mode 100644 index e5c2176c2f643..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTICheckRequirements.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents Microsoft Threat Intelligence requirements check request. - /// - [Newtonsoft.Json.JsonObject("MicrosoftThreatIntelligence")] - [Rest.Serialization.JsonTransformation] - public partial class MSTICheckRequirements : DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the MSTICheckRequirements class. - /// - public MSTICheckRequirements() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MSTICheckRequirements class. - /// - /// The tenant id to connect to, and get the - /// data from. - public MSTICheckRequirements(string tenantId) - { - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTIDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTIDataConnector.cs deleted file mode 100644 index e1cb6bdd36252..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTIDataConnector.cs +++ /dev/null @@ -1,96 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents Microsoft Threat Intelligence data connector. - /// - [Newtonsoft.Json.JsonObject("MicrosoftThreatIntelligence")] - [Rest.Serialization.JsonTransformation] - public partial class MSTIDataConnector : DataConnector - { - /// - /// Initializes a new instance of the MSTIDataConnector class. - /// - public MSTIDataConnector() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MSTIDataConnector class. - /// - /// The tenant id to connect to, and get the - /// data from. - /// The available data types for the - /// connector. - /// 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 MSTIDataConnector(string tenantId, MSTIDataConnectorDataTypes dataTypes, 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) - { - TenantId = tenantId; - DataTypes = dataTypes; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Gets or sets the available data types for the connector. - /// - [JsonProperty(PropertyName = "properties.dataTypes")] - public MSTIDataConnectorDataTypes DataTypes { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - if (DataTypes == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataTypes"); - } - if (DataTypes != null) - { - DataTypes.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTIDataConnectorDataTypes.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTIDataConnectorDataTypes.cs deleted file mode 100644 index 3cf83d17cd1de..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTIDataConnectorDataTypes.cs +++ /dev/null @@ -1,90 +0,0 @@ -// -// 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; - - /// - /// The available data types for Microsoft Threat Intelligence Platforms - /// data connector. - /// - public partial class MSTIDataConnectorDataTypes - { - /// - /// Initializes a new instance of the MSTIDataConnectorDataTypes class. - /// - public MSTIDataConnectorDataTypes() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MSTIDataConnectorDataTypes class. - /// - /// Data type for Microsoft Threat - /// Intelligence Platforms data connector. - /// Data type for Microsoft - /// Threat Intelligence Platforms data connector. - public MSTIDataConnectorDataTypes(MSTIDataConnectorDataTypesBingSafetyPhishingURL bingSafetyPhishingURL, MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed microsoftEmergingThreatFeed) - { - BingSafetyPhishingURL = bingSafetyPhishingURL; - MicrosoftEmergingThreatFeed = microsoftEmergingThreatFeed; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets data type for Microsoft Threat Intelligence Platforms - /// data connector. - /// - [JsonProperty(PropertyName = "bingSafetyPhishingURL")] - public MSTIDataConnectorDataTypesBingSafetyPhishingURL BingSafetyPhishingURL { get; set; } - - /// - /// Gets or sets data type for Microsoft Threat Intelligence Platforms - /// data connector. - /// - [JsonProperty(PropertyName = "microsoftEmergingThreatFeed")] - public MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed MicrosoftEmergingThreatFeed { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (BingSafetyPhishingURL == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "BingSafetyPhishingURL"); - } - if (MicrosoftEmergingThreatFeed == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "MicrosoftEmergingThreatFeed"); - } - if (BingSafetyPhishingURL != null) - { - BingSafetyPhishingURL.Validate(); - } - if (MicrosoftEmergingThreatFeed != null) - { - MicrosoftEmergingThreatFeed.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTIDataConnectorDataTypesBingSafetyPhishingURL.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTIDataConnectorDataTypesBingSafetyPhishingURL.cs deleted file mode 100644 index 2677ca78ee994..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTIDataConnectorDataTypesBingSafetyPhishingURL.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// 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; - - /// - /// Data type for Microsoft Threat Intelligence Platforms data connector. - /// - public partial class MSTIDataConnectorDataTypesBingSafetyPhishingURL : DataConnectorDataTypeCommon - { - /// - /// Initializes a new instance of the - /// MSTIDataConnectorDataTypesBingSafetyPhishingURL class. - /// - public MSTIDataConnectorDataTypesBingSafetyPhishingURL() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// MSTIDataConnectorDataTypesBingSafetyPhishingURL class. - /// - /// Describe whether this data type connection is - /// enabled or not. Possible values include: 'Enabled', - /// 'Disabled' - /// lookback period - public MSTIDataConnectorDataTypesBingSafetyPhishingURL(string state, string lookbackPeriod) - : base(state) - { - LookbackPeriod = lookbackPeriod; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets lookback period - /// - [JsonProperty(PropertyName = "lookbackPeriod")] - public string LookbackPeriod { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (LookbackPeriod == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "LookbackPeriod"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed.cs deleted file mode 100644 index def7500ee9385..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// 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; - - /// - /// Data type for Microsoft Threat Intelligence Platforms data connector. - /// - public partial class MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed : DataConnectorDataTypeCommon - { - /// - /// Initializes a new instance of the - /// MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed class. - /// - public MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed class. - /// - /// Describe whether this data type connection is - /// enabled or not. Possible values include: 'Enabled', - /// 'Disabled' - /// lookback period - public MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed(string state, string lookbackPeriod) - : base(state) - { - LookbackPeriod = lookbackPeriod; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets lookback period - /// - [JsonProperty(PropertyName = "lookbackPeriod")] - public string LookbackPeriod { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (LookbackPeriod == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "LookbackPeriod"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MTPDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MTPDataConnector.cs deleted file mode 100644 index cdcc1410708f8..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MTPDataConnector.cs +++ /dev/null @@ -1,96 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents MTP (Microsoft Threat Protection) data connector. - /// - [Newtonsoft.Json.JsonObject("MicrosoftThreatProtection")] - [Rest.Serialization.JsonTransformation] - public partial class MTPDataConnector : DataConnector - { - /// - /// Initializes a new instance of the MTPDataConnector class. - /// - public MTPDataConnector() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MTPDataConnector class. - /// - /// The tenant id to connect to, and get the - /// data from. - /// The available data types for the - /// connector. - /// 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 MTPDataConnector(string tenantId, MTPDataConnectorDataTypes dataTypes, 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) - { - TenantId = tenantId; - DataTypes = dataTypes; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Gets or sets the available data types for the connector. - /// - [JsonProperty(PropertyName = "properties.dataTypes")] - public MTPDataConnectorDataTypes DataTypes { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - if (DataTypes == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataTypes"); - } - if (DataTypes != null) - { - DataTypes.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MTPDataConnectorDataTypes.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MTPDataConnectorDataTypes.cs deleted file mode 100644 index f915074d96ea5..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MTPDataConnectorDataTypes.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// 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; - - /// - /// The available data types for Microsoft Threat Protection Platforms data - /// connector. - /// - public partial class MTPDataConnectorDataTypes - { - /// - /// Initializes a new instance of the MTPDataConnectorDataTypes class. - /// - public MTPDataConnectorDataTypes() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MTPDataConnectorDataTypes class. - /// - /// Data type for Microsoft Threat Protection - /// Platforms data connector. - public MTPDataConnectorDataTypes(MTPDataConnectorDataTypesIncidents incidents) - { - Incidents = incidents; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets data type for Microsoft Threat Protection Platforms - /// data connector. - /// - [JsonProperty(PropertyName = "incidents")] - public MTPDataConnectorDataTypesIncidents Incidents { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Incidents == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Incidents"); - } - if (Incidents != null) - { - Incidents.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MTPDataConnectorDataTypesIncidents.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MTPDataConnectorDataTypesIncidents.cs deleted file mode 100644 index 9f99cdec5bc43..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MTPDataConnectorDataTypesIncidents.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// 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; - - /// - /// Data type for Microsoft Threat Protection Platforms data connector. - /// - public partial class MTPDataConnectorDataTypesIncidents : DataConnectorDataTypeCommon - { - /// - /// Initializes a new instance of the - /// MTPDataConnectorDataTypesIncidents class. - /// - public MTPDataConnectorDataTypesIncidents() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// MTPDataConnectorDataTypesIncidents class. - /// - /// Describe whether this data type connection is - /// enabled or not. Possible values include: 'Enabled', - /// 'Disabled' - public MTPDataConnectorDataTypesIncidents(string state) - : base(state) - { - 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/MailClusterEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MailClusterEntity.cs deleted file mode 100644 index 79d74752017a5..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MailClusterEntity.cs +++ /dev/null @@ -1,215 +0,0 @@ -// -// 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 mail cluster entity. - /// - [Newtonsoft.Json.JsonObject("MailCluster")] - [Rest.Serialization.JsonTransformation] - public partial class MailClusterEntity : Entity - { - /// - /// Initializes a new instance of the MailClusterEntity class. - /// - public MailClusterEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MailClusterEntity 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 mail message IDs that are part - /// of the mail cluster - /// Count of mail messages by - /// DeliveryStatus string representation - /// Count of mail messages by - /// ThreatType string representation - /// Count of mail messages by - /// ProtectionStatus string representation - /// The threats of mail messages that are part of - /// the mail cluster - /// The query that was used to identify the - /// messages of the mail cluster - /// The query time - /// The number of mail messages that are part - /// of the mail cluster - /// Is this a volume anomaly mail - /// cluster - /// The source of the mail cluster (default is - /// 'O365 ATP') - /// The id of the cluster - /// source - /// The type of the cluster - /// source - /// The cluster query start - /// time - /// The cluster query end - /// time - /// The cluster group - public MailClusterEntity(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary additionalData = default(IDictionary), string friendlyName = default(string), IList networkMessageIds = default(IList), object countByDeliveryStatus = default(object), object countByThreatType = default(object), object countByProtectionStatus = default(object), IList threats = default(IList), string query = default(string), System.DateTime? queryTime = default(System.DateTime?), int? mailCount = default(int?), bool? isVolumeAnomaly = default(bool?), string source = default(string), string clusterSourceIdentifier = default(string), string clusterSourceType = default(string), System.DateTime? clusterQueryStartTime = default(System.DateTime?), System.DateTime? clusterQueryEndTime = default(System.DateTime?), string clusterGroup = default(string)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - NetworkMessageIds = networkMessageIds; - CountByDeliveryStatus = countByDeliveryStatus; - CountByThreatType = countByThreatType; - CountByProtectionStatus = countByProtectionStatus; - Threats = threats; - Query = query; - QueryTime = queryTime; - MailCount = mailCount; - IsVolumeAnomaly = isVolumeAnomaly; - Source = source; - ClusterSourceIdentifier = clusterSourceIdentifier; - ClusterSourceType = clusterSourceType; - ClusterQueryStartTime = clusterQueryStartTime; - ClusterQueryEndTime = clusterQueryEndTime; - ClusterGroup = clusterGroup; - 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 mail message IDs that are part of the mail cluster - /// - [JsonProperty(PropertyName = "properties.networkMessageIds")] - public IList NetworkMessageIds { get; private set; } - - /// - /// Gets count of mail messages by DeliveryStatus string representation - /// - [JsonProperty(PropertyName = "properties.countByDeliveryStatus")] - public object CountByDeliveryStatus { get; private set; } - - /// - /// Gets count of mail messages by ThreatType string representation - /// - [JsonProperty(PropertyName = "properties.countByThreatType")] - public object CountByThreatType { get; private set; } - - /// - /// Gets count of mail messages by ProtectionStatus string - /// representation - /// - [JsonProperty(PropertyName = "properties.countByProtectionStatus")] - public object CountByProtectionStatus { get; private set; } - - /// - /// Gets the threats of mail messages that are part of the mail cluster - /// - [JsonProperty(PropertyName = "properties.threats")] - public IList Threats { get; private set; } - - /// - /// Gets the query that was used to identify the messages of the mail - /// cluster - /// - [JsonProperty(PropertyName = "properties.query")] - public string Query { get; private set; } - - /// - /// Gets the query time - /// - [JsonProperty(PropertyName = "properties.queryTime")] - public System.DateTime? QueryTime { get; private set; } - - /// - /// Gets the number of mail messages that are part of the mail cluster - /// - [JsonProperty(PropertyName = "properties.mailCount")] - public int? MailCount { get; private set; } - - /// - /// Gets is this a volume anomaly mail cluster - /// - [JsonProperty(PropertyName = "properties.isVolumeAnomaly")] - public bool? IsVolumeAnomaly { get; private set; } - - /// - /// Gets the source of the mail cluster (default is 'O365 ATP') - /// - [JsonProperty(PropertyName = "properties.source")] - public string Source { get; private set; } - - /// - /// Gets the id of the cluster source - /// - [JsonProperty(PropertyName = "properties.clusterSourceIdentifier")] - public string ClusterSourceIdentifier { get; private set; } - - /// - /// Gets the type of the cluster source - /// - [JsonProperty(PropertyName = "properties.clusterSourceType")] - public string ClusterSourceType { get; private set; } - - /// - /// Gets the cluster query start time - /// - [JsonProperty(PropertyName = "properties.clusterQueryStartTime")] - public System.DateTime? ClusterQueryStartTime { get; private set; } - - /// - /// Gets the cluster query end time - /// - [JsonProperty(PropertyName = "properties.clusterQueryEndTime")] - public System.DateTime? ClusterQueryEndTime { get; private set; } - - /// - /// Gets the cluster group - /// - [JsonProperty(PropertyName = "properties.clusterGroup")] - public string ClusterGroup { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MailMessageEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MailMessageEntity.cs deleted file mode 100644 index 3ae71bd9ae363..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MailMessageEntity.cs +++ /dev/null @@ -1,304 +0,0 @@ -// -// 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 mail message entity. - /// - [Newtonsoft.Json.JsonObject("MailMessage")] - [Rest.Serialization.JsonTransformation] - public partial class MailMessageEntity : Entity - { - /// - /// Initializes a new instance of the MailMessageEntity class. - /// - public MailMessageEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MailMessageEntity 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 File entity ids of this mail - /// message's attachments - /// The recipient of this mail message. Note - /// that in case of multiple recipients the mail message is forked and - /// each copy has one recipient - /// The Urls contained in this mail message - /// The threats of this mail message - /// The p1 sender's email address - /// The p1 sender's display - /// name - /// The p1 sender's domain - /// The sender's IP address - /// The p2 sender's email address - /// The p2 sender's display - /// name - /// The p2 sender's domain - /// The receive date of this message - /// The network message id of this mail - /// message - /// The internet message id of this - /// mail message - /// The subject of this mail message - /// The language of this mail message - /// The threat detection - /// methods - /// The bodyFingerprintBin1 - /// The bodyFingerprintBin2 - /// The bodyFingerprintBin3 - /// The bodyFingerprintBin4 - /// The bodyFingerprintBin5 - /// The directionality of this mail - /// message. Possible values include: 'Unknown', 'Inbound', 'Outbound', - /// 'Intraorg' - /// The delivery action of this mail - /// message like Delivered, Blocked, Replaced etc. Possible values - /// include: 'Unknown', 'DeliveredAsSpam', 'Delivered', 'Blocked', - /// 'Replaced' - /// The delivery location of this mail - /// message like Inbox, JunkFolder etc. Possible values include: - /// 'Unknown', 'Inbox', 'JunkFolder', 'DeletedFolder', 'Quarantine', - /// 'External', 'Failed', 'Dropped', 'Forwarded' - public MailMessageEntity(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary additionalData = default(IDictionary), string friendlyName = default(string), IList fileEntityIds = default(IList), string recipient = default(string), IList urls = default(IList), IList threats = default(IList), string p1Sender = default(string), string p1SenderDisplayName = default(string), string p1SenderDomain = default(string), string senderIP = default(string), string p2Sender = default(string), string p2SenderDisplayName = default(string), string p2SenderDomain = default(string), System.DateTime? receiveDate = default(System.DateTime?), System.Guid? networkMessageId = default(System.Guid?), string internetMessageId = default(string), string subject = default(string), string language = default(string), IList threatDetectionMethods = default(IList), int? bodyFingerprintBin1 = default(int?), int? bodyFingerprintBin2 = default(int?), int? bodyFingerprintBin3 = default(int?), int? bodyFingerprintBin4 = default(int?), int? bodyFingerprintBin5 = default(int?), string antispamDirection = default(string), DeliveryAction? deliveryAction = default(DeliveryAction?), DeliveryLocation? deliveryLocation = default(DeliveryLocation?)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - FileEntityIds = fileEntityIds; - Recipient = recipient; - Urls = urls; - Threats = threats; - P1Sender = p1Sender; - P1SenderDisplayName = p1SenderDisplayName; - P1SenderDomain = p1SenderDomain; - SenderIP = senderIP; - P2Sender = p2Sender; - P2SenderDisplayName = p2SenderDisplayName; - P2SenderDomain = p2SenderDomain; - ReceiveDate = receiveDate; - NetworkMessageId = networkMessageId; - InternetMessageId = internetMessageId; - Subject = subject; - Language = language; - ThreatDetectionMethods = threatDetectionMethods; - BodyFingerprintBin1 = bodyFingerprintBin1; - BodyFingerprintBin2 = bodyFingerprintBin2; - BodyFingerprintBin3 = bodyFingerprintBin3; - BodyFingerprintBin4 = bodyFingerprintBin4; - BodyFingerprintBin5 = bodyFingerprintBin5; - AntispamDirection = antispamDirection; - DeliveryAction = deliveryAction; - DeliveryLocation = deliveryLocation; - 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 File entity ids of this mail message's attachments - /// - [JsonProperty(PropertyName = "properties.fileEntityIds")] - public IList FileEntityIds { get; private set; } - - /// - /// Gets the recipient of this mail message. Note that in case of - /// multiple recipients the mail message is forked and each copy has - /// one recipient - /// - [JsonProperty(PropertyName = "properties.recipient")] - public string Recipient { get; private set; } - - /// - /// Gets the Urls contained in this mail message - /// - [JsonProperty(PropertyName = "properties.urls")] - public IList Urls { get; private set; } - - /// - /// Gets the threats of this mail message - /// - [JsonProperty(PropertyName = "properties.threats")] - public IList Threats { get; private set; } - - /// - /// Gets the p1 sender's email address - /// - [JsonProperty(PropertyName = "properties.p1Sender")] - public string P1Sender { get; private set; } - - /// - /// Gets the p1 sender's display name - /// - [JsonProperty(PropertyName = "properties.p1SenderDisplayName")] - public string P1SenderDisplayName { get; private set; } - - /// - /// Gets the p1 sender's domain - /// - [JsonProperty(PropertyName = "properties.p1SenderDomain")] - public string P1SenderDomain { get; private set; } - - /// - /// Gets the sender's IP address - /// - [JsonProperty(PropertyName = "properties.senderIP")] - public string SenderIP { get; private set; } - - /// - /// Gets the p2 sender's email address - /// - [JsonProperty(PropertyName = "properties.p2Sender")] - public string P2Sender { get; private set; } - - /// - /// Gets the p2 sender's display name - /// - [JsonProperty(PropertyName = "properties.p2SenderDisplayName")] - public string P2SenderDisplayName { get; private set; } - - /// - /// Gets the p2 sender's domain - /// - [JsonProperty(PropertyName = "properties.p2SenderDomain")] - public string P2SenderDomain { get; private set; } - - /// - /// Gets the receive date of this message - /// - [JsonProperty(PropertyName = "properties.receiveDate")] - public System.DateTime? ReceiveDate { get; private set; } - - /// - /// Gets the network message id of this mail message - /// - [JsonProperty(PropertyName = "properties.networkMessageId")] - public System.Guid? NetworkMessageId { get; private set; } - - /// - /// Gets the internet message id of this mail message - /// - [JsonProperty(PropertyName = "properties.internetMessageId")] - public string InternetMessageId { get; private set; } - - /// - /// Gets the subject of this mail message - /// - [JsonProperty(PropertyName = "properties.subject")] - public string Subject { get; private set; } - - /// - /// Gets the language of this mail message - /// - [JsonProperty(PropertyName = "properties.language")] - public string Language { get; private set; } - - /// - /// Gets the threat detection methods - /// - [JsonProperty(PropertyName = "properties.threatDetectionMethods")] - public IList ThreatDetectionMethods { get; private set; } - - /// - /// Gets or sets the bodyFingerprintBin1 - /// - [JsonProperty(PropertyName = "properties.bodyFingerprintBin1")] - public int? BodyFingerprintBin1 { get; set; } - - /// - /// Gets or sets the bodyFingerprintBin2 - /// - [JsonProperty(PropertyName = "properties.bodyFingerprintBin2")] - public int? BodyFingerprintBin2 { get; set; } - - /// - /// Gets or sets the bodyFingerprintBin3 - /// - [JsonProperty(PropertyName = "properties.bodyFingerprintBin3")] - public int? BodyFingerprintBin3 { get; set; } - - /// - /// Gets or sets the bodyFingerprintBin4 - /// - [JsonProperty(PropertyName = "properties.bodyFingerprintBin4")] - public int? BodyFingerprintBin4 { get; set; } - - /// - /// Gets or sets the bodyFingerprintBin5 - /// - [JsonProperty(PropertyName = "properties.bodyFingerprintBin5")] - public int? BodyFingerprintBin5 { get; set; } - - /// - /// Gets or sets the directionality of this mail message. Possible - /// values include: 'Unknown', 'Inbound', 'Outbound', 'Intraorg' - /// - [JsonProperty(PropertyName = "properties.antispamDirection")] - public string AntispamDirection { get; set; } - - /// - /// Gets or sets the delivery action of this mail message like - /// Delivered, Blocked, Replaced etc. Possible values include: - /// 'Unknown', 'DeliveredAsSpam', 'Delivered', 'Blocked', 'Replaced' - /// - [JsonProperty(PropertyName = "properties.deliveryAction")] - public DeliveryAction? DeliveryAction { get; set; } - - /// - /// Gets or sets the delivery location of this mail message like Inbox, - /// JunkFolder etc. Possible values include: 'Unknown', 'Inbox', - /// 'JunkFolder', 'DeletedFolder', 'Quarantine', 'External', 'Failed', - /// 'Dropped', 'Forwarded' - /// - [JsonProperty(PropertyName = "properties.deliveryLocation")] - public DeliveryLocation? DeliveryLocation { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MailboxEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MailboxEntity.cs deleted file mode 100644 index 27f98521c87bb..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MailboxEntity.cs +++ /dev/null @@ -1,117 +0,0 @@ -// -// 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 mailbox entity. - /// - [Newtonsoft.Json.JsonObject("Mailbox")] - [Rest.Serialization.JsonTransformation] - public partial class MailboxEntity : Entity - { - /// - /// Initializes a new instance of the MailboxEntity class. - /// - public MailboxEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MailboxEntity 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 mailbox's primary - /// address - /// The mailbox's display name - /// The mailbox's UPN - /// The AzureAD identifier of - /// mailbox. Similar to AadUserId in account entity but this property - /// is specific to mailbox object on office side - public MailboxEntity(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 mailboxPrimaryAddress = default(string), string displayName = default(string), string upn = default(string), System.Guid? externalDirectoryObjectId = default(System.Guid?)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - MailboxPrimaryAddress = mailboxPrimaryAddress; - DisplayName = displayName; - Upn = upn; - ExternalDirectoryObjectId = externalDirectoryObjectId; - 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 mailbox's primary address - /// - [JsonProperty(PropertyName = "properties.mailboxPrimaryAddress")] - public string MailboxPrimaryAddress { get; private set; } - - /// - /// Gets the mailbox's display name - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets the mailbox's UPN - /// - [JsonProperty(PropertyName = "properties.upn")] - public string Upn { get; private set; } - - /// - /// Gets the AzureAD identifier of mailbox. Similar to AadUserId in - /// account entity but this property is specific to mailbox object on - /// office side - /// - [JsonProperty(PropertyName = "properties.externalDirectoryObjectId")] - public System.Guid? ExternalDirectoryObjectId { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MalwareEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MalwareEntity.cs deleted file mode 100644 index d0db206af2a2d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MalwareEntity.cs +++ /dev/null @@ -1,118 +0,0 @@ -// -// 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 malware entity. - /// - [Newtonsoft.Json.JsonObject("Malware")] - [Rest.Serialization.JsonTransformation] - public partial class MalwareEntity : Entity - { - /// - /// Initializes a new instance of the MalwareEntity class. - /// - public MalwareEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MalwareEntity 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 malware category by the vendor, e.g. - /// Trojan - /// List of linked file entity identifiers - /// on which the malware was found - /// The malware name by the vendor, e.g. - /// Win32/Toga!rfn - /// List of linked process entity - /// identifiers on which the malware was found. - public MalwareEntity(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 category = default(string), IList fileEntityIds = default(IList), string malwareName = default(string), IList processEntityIds = default(IList)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - Category = category; - FileEntityIds = fileEntityIds; - MalwareName = malwareName; - ProcessEntityIds = processEntityIds; - 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 malware category by the vendor, e.g. Trojan - /// - [JsonProperty(PropertyName = "properties.category")] - public string Category { get; private set; } - - /// - /// Gets list of linked file entity identifiers on which the malware - /// was found - /// - [JsonProperty(PropertyName = "properties.fileEntityIds")] - public IList FileEntityIds { get; private set; } - - /// - /// Gets the malware name by the vendor, e.g. Win32/Toga!rfn - /// - [JsonProperty(PropertyName = "properties.malwareName")] - public string MalwareName { get; private set; } - - /// - /// Gets list of linked process entity identifiers on which the malware - /// was found. - /// - [JsonProperty(PropertyName = "properties.processEntityIds")] - public IList ProcessEntityIds { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MatchingMethod.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MatchingMethod.cs deleted file mode 100644 index 009decedc79f1..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MatchingMethod.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// 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 MatchingMethod. - /// - public static class MatchingMethod - { - /// - /// Grouping alerts into a single incident if all the entities match - /// - public const string AllEntities = "AllEntities"; - /// - /// Grouping any alerts triggered by this rule into a single incident - /// - public const string AnyAlert = "AnyAlert"; - /// - /// Grouping alerts into a single incident if the selected entities, - /// custom details and alert details match - /// - public const string Selected = "Selected"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataAuthor.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataAuthor.cs deleted file mode 100644 index 935c27b32e804..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataAuthor.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// 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; - - /// - /// Publisher or creator of the content item. - /// - public partial class MetadataAuthor - { - /// - /// Initializes a new instance of the MetadataAuthor class. - /// - public MetadataAuthor() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetadataAuthor class. - /// - /// Name of the author. Company or person. - /// Email of author contact - /// Link for author/vendor page - public MetadataAuthor(string name = default(string), string email = default(string), string link = default(string)) - { - Name = name; - Email = email; - Link = link; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets name of the author. Company or person. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets email of author contact - /// - [JsonProperty(PropertyName = "email")] - public string Email { get; set; } - - /// - /// Gets or sets link for author/vendor page - /// - [JsonProperty(PropertyName = "link")] - public string Link { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataCategories.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataCategories.cs deleted file mode 100644 index 81c2220f2e669..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataCategories.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// 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; - - /// - /// ies for the solution content item - /// - public partial class MetadataCategories - { - /// - /// Initializes a new instance of the MetadataCategories class. - /// - public MetadataCategories() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetadataCategories class. - /// - /// domain for the solution content item - /// Industry verticals for the solution content - /// item - public MetadataCategories(IList domains = default(IList), IList verticals = default(IList)) - { - Domains = domains; - Verticals = verticals; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets domain for the solution content item - /// - [JsonProperty(PropertyName = "domains")] - public IList Domains { get; set; } - - /// - /// Gets or sets industry verticals for the solution content item - /// - [JsonProperty(PropertyName = "verticals")] - public IList Verticals { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataDependencies.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataDependencies.cs deleted file mode 100644 index 6183f38a85245..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataDependencies.cs +++ /dev/null @@ -1,117 +0,0 @@ -// -// 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; - - /// - /// Dependencies for the content item, what other content items it requires - /// to work. Can describe more complex dependencies using a - /// recursive/nested structure. For a single dependency an id/kind/version - /// can be supplied or operator/criteria for complex dependencies. - /// - public partial class MetadataDependencies - { - /// - /// Initializes a new instance of the MetadataDependencies class. - /// - public MetadataDependencies() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetadataDependencies class. - /// - /// Id of the content item we depend on - /// Type of the content item we depend on. Possible - /// values include: 'DataConnector', 'DataType', 'Workbook', - /// 'WorkbookTemplate', 'Playbook', 'PlaybookTemplate', - /// 'AnalyticsRuleTemplate', 'AnalyticsRule', 'HuntingQuery', - /// 'InvestigationQuery', 'Parser', 'Watchlist', 'WatchlistTemplate', - /// 'Solution' - /// Version of the the content item we depend on. - /// Can be blank, * or missing to indicate any version fulfills the - /// dependency. If version does not match our defined numeric format - /// then an exact match is required. - /// Name of the content item - /// Operator used for list of - /// dependencies in criteria array. Possible values include: 'AND', - /// 'OR' - /// This is the list of dependencies we must - /// fulfill, according to the AND/OR operator - public MetadataDependencies(string contentId = default(string), string kind = default(string), string version = default(string), string name = default(string), string operatorProperty = default(string), IList criteria = default(IList)) - { - ContentId = contentId; - Kind = kind; - Version = version; - Name = name; - OperatorProperty = operatorProperty; - Criteria = criteria; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets id of the content item we depend on - /// - [JsonProperty(PropertyName = "contentId")] - public string ContentId { get; set; } - - /// - /// Gets or sets type of the content item we depend on. Possible values - /// include: 'DataConnector', 'DataType', 'Workbook', - /// 'WorkbookTemplate', 'Playbook', 'PlaybookTemplate', - /// 'AnalyticsRuleTemplate', 'AnalyticsRule', 'HuntingQuery', - /// 'InvestigationQuery', 'Parser', 'Watchlist', 'WatchlistTemplate', - /// 'Solution' - /// - [JsonProperty(PropertyName = "kind")] - public string Kind { get; set; } - - /// - /// Gets or sets version of the the content item we depend on. Can be - /// blank, * or missing to indicate any version fulfills the - /// dependency. If version does not match our defined numeric format - /// then an exact match is required. - /// - [JsonProperty(PropertyName = "version")] - public string Version { get; set; } - - /// - /// Gets or sets name of the content item - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets operator used for list of dependencies in criteria - /// array. Possible values include: 'AND', 'OR' - /// - [JsonProperty(PropertyName = "operator")] - public string OperatorProperty { get; set; } - - /// - /// Gets or sets this is the list of dependencies we must fulfill, - /// according to the AND/OR operator - /// - [JsonProperty(PropertyName = "criteria")] - public IList Criteria { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataModel.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataModel.cs deleted file mode 100644 index a9042e7f7bc2c..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataModel.cs +++ /dev/null @@ -1,223 +0,0 @@ -// -// 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; - - /// - /// Metadata resource definition. - /// - [Rest.Serialization.JsonTransformation] - public partial class MetadataModel : ResourceWithEtag - { - /// - /// Initializes a new instance of the MetadataModel class. - /// - public MetadataModel() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetadataModel class. - /// - /// Full parent resource ID of the content item - /// the metadata is for. This is the full resource ID including the - /// scope (subscription and resource group) - /// The kind of content the metadata is for. - /// Possible values include: 'DataConnector', 'DataType', 'Workbook', - /// 'WorkbookTemplate', 'Playbook', 'PlaybookTemplate', - /// 'AnalyticsRuleTemplate', 'AnalyticsRule', 'HuntingQuery', - /// 'InvestigationQuery', 'Parser', 'Watchlist', 'WatchlistTemplate', - /// 'Solution' - /// 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 - /// Static ID for the content. Used to - /// identify dependencies and content from solutions or community. - /// Hard-coded/static for out of the box content and solutions. Dynamic - /// for user-created. This is the resource name - /// Version of the content. Default and - /// recommended format is numeric (e.g. 1, 1.0, 1.0.0, 1.0.0.0), - /// following ARM template best practices. Can also be any string, but - /// then we cannot guarantee any version checks - /// Source of the content. This is where/how it - /// was created. - /// The creator of the content item. - /// Support information for the metadata - type, - /// name, contact information - /// Dependencies for the content item, what - /// other content items it requires to work. Can describe more complex - /// dependencies using a recursive/nested structure. For a single - /// dependency an id/kind/version can be supplied or operator/criteria - /// for complex formats. - /// Categories for the solution content - /// item - /// Providers for the solution content - /// item - /// first publish date solution content - /// item - /// last publish date for the solution - /// content item - public MetadataModel(string parentId, string kind, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string contentId = default(string), string version = default(string), MetadataSource source = default(MetadataSource), MetadataAuthor author = default(MetadataAuthor), MetadataSupport support = default(MetadataSupport), MetadataDependencies dependencies = default(MetadataDependencies), MetadataCategories categories = default(MetadataCategories), IList providers = default(IList), System.DateTime? firstPublishDate = default(System.DateTime?), System.DateTime? lastPublishDate = default(System.DateTime?)) - : base(id, name, type, systemData, etag) - { - ContentId = contentId; - ParentId = parentId; - Version = version; - Kind = kind; - Source = source; - Author = author; - Support = support; - Dependencies = dependencies; - Categories = categories; - Providers = providers; - FirstPublishDate = firstPublishDate; - LastPublishDate = lastPublishDate; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets static ID for the content. Used to identify - /// dependencies and content from solutions or community. - /// Hard-coded/static for out of the box content and solutions. Dynamic - /// for user-created. This is the resource name - /// - [JsonProperty(PropertyName = "properties.contentId")] - public string ContentId { get; set; } - - /// - /// Gets or sets full parent resource ID of the content item the - /// metadata is for. This is the full resource ID including the scope - /// (subscription and resource group) - /// - [JsonProperty(PropertyName = "properties.parentId")] - public string ParentId { get; set; } - - /// - /// Gets or sets version of the content. Default and recommended - /// format is numeric (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM - /// template best practices. Can also be any string, but then we - /// cannot guarantee any version checks - /// - [JsonProperty(PropertyName = "properties.version")] - public string Version { get; set; } - - /// - /// Gets or sets the kind of content the metadata is for. Possible - /// values include: 'DataConnector', 'DataType', 'Workbook', - /// 'WorkbookTemplate', 'Playbook', 'PlaybookTemplate', - /// 'AnalyticsRuleTemplate', 'AnalyticsRule', 'HuntingQuery', - /// 'InvestigationQuery', 'Parser', 'Watchlist', 'WatchlistTemplate', - /// 'Solution' - /// - [JsonProperty(PropertyName = "properties.kind")] - public string Kind { get; set; } - - /// - /// Gets or sets source of the content. This is where/how it was - /// created. - /// - [JsonProperty(PropertyName = "properties.source")] - public MetadataSource Source { get; set; } - - /// - /// Gets or sets the creator of the content item. - /// - [JsonProperty(PropertyName = "properties.author")] - public MetadataAuthor Author { get; set; } - - /// - /// Gets or sets support information for the metadata - type, name, - /// contact information - /// - [JsonProperty(PropertyName = "properties.support")] - public MetadataSupport Support { get; set; } - - /// - /// Gets or sets dependencies for the content item, what other content - /// items it requires to work. Can describe more complex dependencies - /// using a recursive/nested structure. For a single dependency an - /// id/kind/version can be supplied or operator/criteria for complex - /// formats. - /// - [JsonProperty(PropertyName = "properties.dependencies")] - public MetadataDependencies Dependencies { get; set; } - - /// - /// Gets or sets categories for the solution content item - /// - [JsonProperty(PropertyName = "properties.categories")] - public MetadataCategories Categories { get; set; } - - /// - /// Gets or sets providers for the solution content item - /// - [JsonProperty(PropertyName = "properties.providers")] - public IList Providers { get; set; } - - /// - /// Gets or sets first publish date solution content item - /// - [JsonConverter(typeof(DateJsonConverter))] - [JsonProperty(PropertyName = "properties.firstPublishDate")] - public System.DateTime? FirstPublishDate { get; set; } - - /// - /// Gets or sets last publish date for the solution content item - /// - [JsonConverter(typeof(DateJsonConverter))] - [JsonProperty(PropertyName = "properties.lastPublishDate")] - public System.DateTime? LastPublishDate { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ParentId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ParentId"); - } - if (Kind == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Kind"); - } - if (Source != null) - { - Source.Validate(); - } - if (Support != null) - { - Support.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataPatch.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataPatch.cs deleted file mode 100644 index adf330c9966a5..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataPatch.cs +++ /dev/null @@ -1,215 +0,0 @@ -// -// 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; - - /// - /// Metadata patch request body. - /// - [Rest.Serialization.JsonTransformation] - public partial class MetadataPatch : ResourceWithEtag - { - /// - /// Initializes a new instance of the MetadataPatch class. - /// - public MetadataPatch() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetadataPatch 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 - /// Static ID for the content. Used to - /// identify dependencies and content from solutions or community. - /// Hard-coded/static for out of the box content and solutions. Dynamic - /// for user-created. This is the resource name - /// Full parent resource ID of the content item - /// the metadata is for. This is the full resource ID including the - /// scope (subscription and resource group) - /// Version of the content. Default and - /// recommended format is numeric (e.g. 1, 1.0, 1.0.0, 1.0.0.0), - /// following ARM template best practices. Can also be any string, but - /// then we cannot guarantee any version checks - /// The kind of content the metadata is for. - /// Possible values include: 'DataConnector', 'DataType', 'Workbook', - /// 'WorkbookTemplate', 'Playbook', 'PlaybookTemplate', - /// 'AnalyticsRuleTemplate', 'AnalyticsRule', 'HuntingQuery', - /// 'InvestigationQuery', 'Parser', 'Watchlist', 'WatchlistTemplate', - /// 'Solution' - /// Source of the content. This is where/how it - /// was created. - /// The creator of the content item. - /// Support information for the metadata - type, - /// name, contact information - /// Dependencies for the content item, what - /// other content items it requires to work. Can describe more complex - /// dependencies using a recursive/nested structure. For a single - /// dependency an id/kind/version can be supplied or operator/criteria - /// for complex formats. - /// Categories for the solution content - /// item - /// Providers for the solution content - /// item - /// first publish date solution content - /// item - /// last publish date for the solution - /// content item - public MetadataPatch(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string contentId = default(string), string parentId = default(string), string version = default(string), string kind = default(string), MetadataSource source = default(MetadataSource), MetadataAuthor author = default(MetadataAuthor), MetadataSupport support = default(MetadataSupport), MetadataDependencies dependencies = default(MetadataDependencies), MetadataCategories categories = default(MetadataCategories), IList providers = default(IList), System.DateTime? firstPublishDate = default(System.DateTime?), System.DateTime? lastPublishDate = default(System.DateTime?)) - : base(id, name, type, systemData, etag) - { - ContentId = contentId; - ParentId = parentId; - Version = version; - Kind = kind; - Source = source; - Author = author; - Support = support; - Dependencies = dependencies; - Categories = categories; - Providers = providers; - FirstPublishDate = firstPublishDate; - LastPublishDate = lastPublishDate; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets static ID for the content. Used to identify - /// dependencies and content from solutions or community. - /// Hard-coded/static for out of the box content and solutions. Dynamic - /// for user-created. This is the resource name - /// - [JsonProperty(PropertyName = "properties.contentId")] - public string ContentId { get; set; } - - /// - /// Gets or sets full parent resource ID of the content item the - /// metadata is for. This is the full resource ID including the scope - /// (subscription and resource group) - /// - [JsonProperty(PropertyName = "properties.parentId")] - public string ParentId { get; set; } - - /// - /// Gets or sets version of the content. Default and recommended - /// format is numeric (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM - /// template best practices. Can also be any string, but then we - /// cannot guarantee any version checks - /// - [JsonProperty(PropertyName = "properties.version")] - public string Version { get; set; } - - /// - /// Gets or sets the kind of content the metadata is for. Possible - /// values include: 'DataConnector', 'DataType', 'Workbook', - /// 'WorkbookTemplate', 'Playbook', 'PlaybookTemplate', - /// 'AnalyticsRuleTemplate', 'AnalyticsRule', 'HuntingQuery', - /// 'InvestigationQuery', 'Parser', 'Watchlist', 'WatchlistTemplate', - /// 'Solution' - /// - [JsonProperty(PropertyName = "properties.kind")] - public string Kind { get; set; } - - /// - /// Gets or sets source of the content. This is where/how it was - /// created. - /// - [JsonProperty(PropertyName = "properties.source")] - public MetadataSource Source { get; set; } - - /// - /// Gets or sets the creator of the content item. - /// - [JsonProperty(PropertyName = "properties.author")] - public MetadataAuthor Author { get; set; } - - /// - /// Gets or sets support information for the metadata - type, name, - /// contact information - /// - [JsonProperty(PropertyName = "properties.support")] - public MetadataSupport Support { get; set; } - - /// - /// Gets or sets dependencies for the content item, what other content - /// items it requires to work. Can describe more complex dependencies - /// using a recursive/nested structure. For a single dependency an - /// id/kind/version can be supplied or operator/criteria for complex - /// formats. - /// - [JsonProperty(PropertyName = "properties.dependencies")] - public MetadataDependencies Dependencies { get; set; } - - /// - /// Gets or sets categories for the solution content item - /// - [JsonProperty(PropertyName = "properties.categories")] - public MetadataCategories Categories { get; set; } - - /// - /// Gets or sets providers for the solution content item - /// - [JsonProperty(PropertyName = "properties.providers")] - public IList Providers { get; set; } - - /// - /// Gets or sets first publish date solution content item - /// - [JsonConverter(typeof(DateJsonConverter))] - [JsonProperty(PropertyName = "properties.firstPublishDate")] - public System.DateTime? FirstPublishDate { get; set; } - - /// - /// Gets or sets last publish date for the solution content item - /// - [JsonConverter(typeof(DateJsonConverter))] - [JsonProperty(PropertyName = "properties.lastPublishDate")] - public System.DateTime? LastPublishDate { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Source != null) - { - Source.Validate(); - } - if (Support != null) - { - Support.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataSource.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataSource.cs deleted file mode 100644 index ce9528ca81910..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataSource.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// 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; - - /// - /// The original source of the content item, where it comes from. - /// - public partial class MetadataSource - { - /// - /// Initializes a new instance of the MetadataSource class. - /// - public MetadataSource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetadataSource class. - /// - /// Source type of the content. Possible values - /// include: 'LocalWorkspace', 'Community', 'Solution', - /// 'SourceRepository' - /// Name of the content source. The repo name, - /// solution name, LA workspace name etc. - /// ID of the content source. The solution ID, - /// workspace ID, etc - public MetadataSource(string kind, string name = default(string), string sourceId = default(string)) - { - Kind = kind; - Name = name; - SourceId = sourceId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets source type of the content. Possible values include: - /// 'LocalWorkspace', 'Community', 'Solution', 'SourceRepository' - /// - [JsonProperty(PropertyName = "kind")] - public string Kind { get; set; } - - /// - /// Gets or sets name of the content source. The repo name, solution - /// name, LA workspace name etc. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets ID of the content source. The solution ID, workspace - /// ID, etc - /// - [JsonProperty(PropertyName = "sourceId")] - public string SourceId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Kind == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Kind"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataSupport.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataSupport.cs deleted file mode 100644 index 0f9a81c34077e..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MetadataSupport.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -// 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; - - /// - /// Support information for the content item. - /// - public partial class MetadataSupport - { - /// - /// Initializes a new instance of the MetadataSupport class. - /// - public MetadataSupport() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MetadataSupport class. - /// - /// Type of support for content item. Possible - /// values include: 'Microsoft', 'Partner', 'Community' - /// Name of the support contact. Company or - /// person. - /// Email of support contact - /// Link for support help, like to support page to - /// open a ticket etc. - public MetadataSupport(string tier, string name = default(string), string email = default(string), string link = default(string)) - { - Tier = tier; - Name = name; - Email = email; - Link = link; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets type of support for content item. Possible values - /// include: 'Microsoft', 'Partner', 'Community' - /// - [JsonProperty(PropertyName = "tier")] - public string Tier { get; set; } - - /// - /// Gets or sets name of the support contact. Company or person. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets email of support contact - /// - [JsonProperty(PropertyName = "email")] - public string Email { get; set; } - - /// - /// Gets or sets link for support help, like to support page to open a - /// ticket etc. - /// - [JsonProperty(PropertyName = "link")] - public string Link { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Tier == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Tier"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityIncidentCreationAlertRule.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityIncidentCreationAlertRule.cs index c0379d7f97834..c8775e0769254 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityIncidentCreationAlertRule.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityIncidentCreationAlertRule.cs @@ -41,20 +41,14 @@ public MicrosoftSecurityIncidentCreationAlertRule() /// cases will be generated. Possible values include: 'Microsoft Cloud /// App Security', 'Azure Security Center', 'Azure Advanced Threat /// Protection', 'Azure Active Directory Identity Protection', 'Azure - /// Security Center for IoT', 'Office 365 Advanced Threat Protection', - /// 'Microsoft Defender Advanced Threat Protection' + /// Security Center for IoT' /// The display name for alerts created by /// this alert rule. /// Determines whether this alert rule is enabled /// or disabled. - /// 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. + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// Etag of the azure resource /// the alerts' displayNames on which /// the cases will be generated @@ -68,8 +62,8 @@ public MicrosoftSecurityIncidentCreationAlertRule() /// rule. /// The last time that this alert has /// been modified. - public MicrosoftSecurityIncidentCreationAlertRule(string productFilter, string displayName, bool enabled, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), IList displayNamesFilter = default(IList), IList displayNamesExcludeFilter = default(IList), IList severitiesFilter = default(IList), string alertRuleTemplateName = default(string), string description = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?)) - : base(id, name, type, systemData, etag) + public MicrosoftSecurityIncidentCreationAlertRule(string productFilter, string displayName, bool enabled, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), IList displayNamesFilter = default(IList), IList displayNamesExcludeFilter = default(IList), IList severitiesFilter = default(IList), string alertRuleTemplateName = default(string), string description = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?)) + : base(id, name, type, etag) { DisplayNamesFilter = displayNamesFilter; DisplayNamesExcludeFilter = displayNamesExcludeFilter; @@ -107,8 +101,7 @@ public MicrosoftSecurityIncidentCreationAlertRule() /// generated. Possible values include: 'Microsoft Cloud App Security', /// 'Azure Security Center', 'Azure Advanced Threat Protection', 'Azure /// Active Directory Identity Protection', 'Azure Security Center for - /// IoT', 'Office 365 Advanced Threat Protection', 'Microsoft Defender - /// Advanced Threat Protection' + /// IoT' /// [JsonProperty(PropertyName = "properties.productFilter")] public string ProductFilter { get; set; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.cs index 0ba49b7cad1ab..a5aa31e08a1a3 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityIncidentCreationAlertRuleCommonProperties.cs @@ -38,8 +38,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties() /// cases will be generated. Possible values include: 'Microsoft Cloud /// App Security', 'Azure Security Center', 'Azure Advanced Threat /// Protection', 'Azure Active Directory Identity Protection', 'Azure - /// Security Center for IoT', 'Office 365 Advanced Threat Protection', - /// 'Microsoft Defender Advanced Threat Protection' + /// Security Center for IoT' /// the alerts' displayNames on which /// the cases will be generated /// the alerts' displayNames on @@ -79,8 +78,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleCommonProperties() /// generated. Possible values include: 'Microsoft Cloud App Security', /// 'Azure Security Center', 'Azure Advanced Threat Protection', 'Azure /// Active Directory Identity Protection', 'Azure Security Center for - /// IoT', 'Office 365 Advanced Threat Protection', 'Microsoft Defender - /// Advanced Threat Protection' + /// IoT' /// [JsonProperty(PropertyName = "productFilter")] public string ProductFilter { get; set; } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityIncidentCreationAlertRuleTemplate.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityIncidentCreationAlertRuleTemplate.cs index cc5b9d4a8f531..e28afd8d01410 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityIncidentCreationAlertRuleTemplate.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityIncidentCreationAlertRuleTemplate.cs @@ -37,6 +37,14 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate() /// Initializes a new instance of the /// MicrosoftSecurityIncidentCreationAlertRuleTemplate class. /// + /// The alerts' productName on which the + /// cases will be generated. Possible values include: 'Microsoft Cloud + /// App Security', 'Azure Security Center', 'Azure Advanced Threat + /// Protection', 'Azure Active Directory Identity Protection', 'Azure + /// Security Center for IoT' + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// the number of alert /// rules that were created by this template /// The time that this alert rule template @@ -45,37 +53,20 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate() /// template. /// The display name for alert rule /// template. + /// The required data connectors + /// for this template /// The alert rule template status. Possible /// values include: 'Installed', 'Available', 'NotAvailable' - /// The alerts' productName on which the - /// cases will be generated. Possible values include: 'Microsoft Cloud - /// App Security', 'Azure Security Center', 'Azure Advanced Threat - /// Protection', 'Azure Active Directory Identity Protection', 'Azure - /// Security Center for IoT', 'Office 365 Advanced Threat Protection', - /// 'Microsoft Defender Advanced Threat Protection' - /// 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 last time that this alert rule - /// template has been updated. - /// The required data sources for - /// this template /// the alerts' displayNames on which /// the cases will be generated /// the alerts' displayNames on /// which the cases will not be generated /// the alerts' severities on which the /// cases will be generated - public MicrosoftSecurityIncidentCreationAlertRuleTemplate(int alertRulesCreatedByTemplateCount, System.DateTime createdDateUTC, string description, string displayName, string status, string productFilter, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.DateTime? lastUpdatedDateUTC = default(System.DateTime?), IList requiredDataConnectors = default(IList), IList displayNamesFilter = default(IList), IList displayNamesExcludeFilter = default(IList), IList severitiesFilter = default(IList)) - : base(id, name, type, systemData) + public MicrosoftSecurityIncidentCreationAlertRuleTemplate(string productFilter, string id = default(string), string name = default(string), string type = default(string), int? alertRulesCreatedByTemplateCount = default(int?), System.DateTime? createdDateUTC = default(System.DateTime?), string description = default(string), string displayName = default(string), IList requiredDataConnectors = default(IList), string status = default(string), IList displayNamesFilter = default(IList), IList displayNamesExcludeFilter = default(IList), IList severitiesFilter = default(IList)) + : base(id, name, type) { AlertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; - LastUpdatedDateUTC = lastUpdatedDateUTC; CreatedDateUTC = createdDateUTC; Description = description; DisplayName = displayName; @@ -98,19 +89,13 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate() /// template /// [JsonProperty(PropertyName = "properties.alertRulesCreatedByTemplateCount")] - public int AlertRulesCreatedByTemplateCount { get; set; } - - /// - /// Gets the last time that this alert rule template has been updated. - /// - [JsonProperty(PropertyName = "properties.lastUpdatedDateUTC")] - public System.DateTime? LastUpdatedDateUTC { get; private set; } + public int? AlertRulesCreatedByTemplateCount { get; set; } /// /// Gets the time that this alert rule template has been added. /// [JsonProperty(PropertyName = "properties.createdDateUTC")] - public System.DateTime CreatedDateUTC { get; private set; } + public System.DateTime? CreatedDateUTC { get; private set; } /// /// Gets or sets the description of the alert rule template. @@ -125,7 +110,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate() public string DisplayName { get; set; } /// - /// Gets or sets the required data sources for this template + /// Gets or sets the required data connectors for this template /// [JsonProperty(PropertyName = "properties.requiredDataConnectors")] public IList RequiredDataConnectors { get; set; } @@ -156,8 +141,7 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate() /// generated. Possible values include: 'Microsoft Cloud App Security', /// 'Azure Security Center', 'Azure Advanced Threat Protection', 'Azure /// Active Directory Identity Protection', 'Azure Security Center for - /// IoT', 'Office 365 Advanced Threat Protection', 'Microsoft Defender - /// Advanced Threat Protection' + /// IoT' /// [JsonProperty(PropertyName = "properties.productFilter")] public string ProductFilter { get; set; } @@ -177,18 +161,6 @@ public MicrosoftSecurityIncidentCreationAlertRuleTemplate() /// public virtual void Validate() { - if (Description == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Description"); - } - if (DisplayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); - } - if (Status == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Status"); - } if (ProductFilter == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ProductFilter"); diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityProductName.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityProductName.cs index f0652cf74a91f..253b3b48f9caa 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityProductName.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MicrosoftSecurityProductName.cs @@ -21,7 +21,5 @@ public static class MicrosoftSecurityProductName public const string AzureAdvancedThreatProtection = "Azure Advanced Threat Protection"; public const string AzureActiveDirectoryIdentityProtection = "Azure Active Directory Identity Protection"; public const string AzureSecurityCenterforIoT = "Azure Security Center for IoT"; - public const string Office365AdvancedThreatProtection = "Office 365 Advanced Threat Protection"; - public const string MicrosoftDefenderAdvancedThreatProtection = "Microsoft Defender Advanced Threat Protection"; } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MtpCheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MtpCheckRequirements.cs deleted file mode 100644 index 3eab2c1fda1e2..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/MtpCheckRequirements.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents MTP (Microsoft Threat Protection) requirements check - /// request. - /// - [Newtonsoft.Json.JsonObject("MicrosoftThreatProtection")] - [Rest.Serialization.JsonTransformation] - public partial class MtpCheckRequirements : DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the MtpCheckRequirements class. - /// - public MtpCheckRequirements() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MtpCheckRequirements class. - /// - /// The tenant id to connect to, and get the - /// data from. - public MtpCheckRequirements(string tenantId) - { - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - } - } -} 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 deleted file mode 100644 index 5779fd535d2fe..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/NrtAlertRule.cs +++ /dev/null @@ -1,223 +0,0 @@ -// -// 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 NRT alert rule. - /// - [Newtonsoft.Json.JsonObject("NRT")] - [Rest.Serialization.JsonTransformation] - public partial class NrtAlertRule : AlertRule - { - /// - /// Initializes a new instance of the NrtAlertRule class. - /// - public NrtAlertRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the NrtAlertRule class. - /// - /// The display name for alerts created by - /// this alert rule. - /// Determines whether this alert rule is enabled - /// or disabled. - /// The suppression (in ISO 8601 - /// duration format) to wait since last time this alert rule been - /// triggered. - /// Determines whether the suppression - /// for this alert rule is enabled or disabled. - /// 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 Name of the alert rule - /// template used to create this rule. - /// The version of the alert rule - /// template used to create this rule - in format <a.b.c>, where - /// all are numbers, for example 0 <1.0.2> - /// The description of the alert - /// rule. - /// The query that creates alerts for this - /// rule. - /// The last time that this alert rule - /// has been modified. - /// The severity for alerts created by this - /// alert rule. Possible values include: 'High', 'Medium', 'Low', - /// 'Informational' - /// The tactics of the alert rule - /// The settings of the incidents - /// that created from alerts triggered by this analytics rule - /// Dictionary of string key-value pairs of - /// columns to be attached to the alert - /// Array of the entity mappings of the - /// alert rule - /// The alert details override - /// settings - public NrtAlertRule(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 alertRuleTemplateName = default(string), string templateVersion = default(string), string description = default(string), string query = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?), string severity = default(string), IList tactics = default(IList), IncidentConfiguration incidentConfiguration = default(IncidentConfiguration), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride)) - : base(id, name, type, systemData, etag) - { - AlertRuleTemplateName = alertRuleTemplateName; - TemplateVersion = templateVersion; - Description = description; - Query = query; - DisplayName = displayName; - Enabled = enabled; - LastModifiedUtc = lastModifiedUtc; - SuppressionDuration = suppressionDuration; - SuppressionEnabled = suppressionEnabled; - Severity = severity; - Tactics = tactics; - IncidentConfiguration = incidentConfiguration; - CustomDetails = customDetails; - EntityMappings = entityMappings; - AlertDetailsOverride = alertDetailsOverride; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Name of the alert rule template used to create - /// this rule. - /// - [JsonProperty(PropertyName = "properties.alertRuleTemplateName")] - public string AlertRuleTemplateName { get; set; } - - /// - /// Gets or sets the version of the alert rule template used to create - /// this rule - in format &lt;a.b.c&gt;, where all are numbers, - /// for example 0 &lt;1.0.2&gt; - /// - [JsonProperty(PropertyName = "properties.templateVersion")] - public string TemplateVersion { get; set; } - - /// - /// Gets or sets the description of the alert rule. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the query that creates alerts for this rule. - /// - [JsonProperty(PropertyName = "properties.query")] - public string Query { get; set; } - - /// - /// Gets or sets the display name for alerts created by this alert - /// rule. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets determines whether this alert rule is enabled or - /// disabled. - /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool Enabled { get; set; } - - /// - /// Gets the last time that this alert rule has been modified. - /// - [JsonProperty(PropertyName = "properties.lastModifiedUtc")] - public System.DateTime? LastModifiedUtc { get; private set; } - - /// - /// Gets or sets the suppression (in ISO 8601 duration format) to wait - /// since last time this alert rule been triggered. - /// - [JsonProperty(PropertyName = "properties.suppressionDuration")] - public System.TimeSpan SuppressionDuration { get; set; } - - /// - /// Gets or sets determines whether the suppression for this alert rule - /// is enabled or disabled. - /// - [JsonProperty(PropertyName = "properties.suppressionEnabled")] - public bool SuppressionEnabled { get; set; } - - /// - /// Gets or sets the severity for alerts created by this alert rule. - /// Possible values include: 'High', 'Medium', 'Low', 'Informational' - /// - [JsonProperty(PropertyName = "properties.severity")] - public string Severity { get; set; } - - /// - /// Gets or sets the tactics of the alert rule - /// - [JsonProperty(PropertyName = "properties.tactics")] - public IList Tactics { get; set; } - - /// - /// Gets or sets the settings of the incidents that created from alerts - /// triggered by this analytics rule - /// - [JsonProperty(PropertyName = "properties.incidentConfiguration")] - public IncidentConfiguration IncidentConfiguration { get; set; } - - /// - /// Gets or sets dictionary of string key-value pairs of columns to be - /// attached to the alert - /// - [JsonProperty(PropertyName = "properties.customDetails")] - public IDictionary CustomDetails { get; set; } - - /// - /// Gets or sets array of the entity mappings of the alert rule - /// - [JsonProperty(PropertyName = "properties.entityMappings")] - public IList EntityMappings { get; set; } - - /// - /// Gets or sets the alert details override settings - /// - [JsonProperty(PropertyName = "properties.alertDetailsOverride")] - public AlertDetailsOverride AlertDetailsOverride { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DisplayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); - } - if (IncidentConfiguration != null) - { - IncidentConfiguration.Validate(); - } - } - } -} 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 deleted file mode 100644 index 0342a00dbbf29..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/NrtAlertRuleTemplate.cs +++ /dev/null @@ -1,224 +0,0 @@ -// -// 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 NRT alert rule template. - /// - [Newtonsoft.Json.JsonObject("NRT")] - [Rest.Serialization.JsonTransformation] - public partial class NrtAlertRuleTemplate : AlertRuleTemplate - { - /// - /// Initializes a new instance of the NrtAlertRuleTemplate class. - /// - public NrtAlertRuleTemplate() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the NrtAlertRuleTemplate class. - /// - /// the number of alert - /// rules that were created by this template - /// The description of the alert rule - /// template. - /// The display name for alert rule - /// template. - /// The alert rule template status. Possible - /// values include: 'Installed', 'Available', 'NotAvailable' - /// The query that creates alerts for this - /// rule. - /// The severity for alerts created by this - /// alert rule. Possible values include: 'High', 'Medium', 'Low', - /// 'Informational' - /// The version of this template - in format - /// <a.b.c>, where all are numbers. For example - /// <1.0.2>. - /// 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 last time that this alert rule - /// template has been updated. - /// The time that this alert rule template - /// has been added. - /// The required data sources for - /// this template - /// The tactics of the alert rule - /// Dictionary of string key-value pairs of - /// columns to be attached to the alert - /// Array of the entity mappings of the - /// alert rule - /// The alert details override - /// settings - public NrtAlertRuleTemplate(int alertRulesCreatedByTemplateCount, string description, string displayName, string status, string query, string severity, string version, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.DateTime? lastUpdatedDateUTC = default(System.DateTime?), System.DateTime? createdDateUTC = default(System.DateTime?), IList requiredDataConnectors = default(IList), IList tactics = default(IList), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride)) - : base(id, name, type, systemData) - { - AlertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; - LastUpdatedDateUTC = lastUpdatedDateUTC; - CreatedDateUTC = createdDateUTC; - Description = description; - DisplayName = displayName; - RequiredDataConnectors = requiredDataConnectors; - Status = status; - Query = query; - Severity = severity; - Tactics = tactics; - Version = version; - CustomDetails = customDetails; - EntityMappings = entityMappings; - AlertDetailsOverride = alertDetailsOverride; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the number of alert rules that were created by this - /// template - /// - [JsonProperty(PropertyName = "properties.alertRulesCreatedByTemplateCount")] - public int AlertRulesCreatedByTemplateCount { get; set; } - - /// - /// Gets the last time that this alert rule template has been updated. - /// - [JsonProperty(PropertyName = "properties.lastUpdatedDateUTC")] - public System.DateTime? LastUpdatedDateUTC { get; private set; } - - /// - /// Gets the time that this alert rule template has been added. - /// - [JsonProperty(PropertyName = "properties.createdDateUTC")] - public System.DateTime? CreatedDateUTC { get; private set; } - - /// - /// Gets or sets the description of the alert rule template. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the display name for alert rule template. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the required data sources for this template - /// - [JsonProperty(PropertyName = "properties.requiredDataConnectors")] - public IList RequiredDataConnectors { get; set; } - - /// - /// Gets or sets the alert rule template status. Possible values - /// include: 'Installed', 'Available', 'NotAvailable' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - - /// - /// Gets or sets the query that creates alerts for this rule. - /// - [JsonProperty(PropertyName = "properties.query")] - public string Query { get; set; } - - /// - /// Gets or sets the severity for alerts created by this alert rule. - /// Possible values include: 'High', 'Medium', 'Low', 'Informational' - /// - [JsonProperty(PropertyName = "properties.severity")] - public string Severity { get; set; } - - /// - /// Gets or sets the tactics of the alert rule - /// - [JsonProperty(PropertyName = "properties.tactics")] - public IList Tactics { get; set; } - - /// - /// Gets or sets the version of this template - in format - /// &lt;a.b.c&gt;, where all are numbers. For example - /// &lt;1.0.2&gt;. - /// - [JsonProperty(PropertyName = "properties.version")] - public string Version { get; set; } - - /// - /// Gets or sets dictionary of string key-value pairs of columns to be - /// attached to the alert - /// - [JsonProperty(PropertyName = "properties.customDetails")] - public IDictionary CustomDetails { get; set; } - - /// - /// Gets or sets array of the entity mappings of the alert rule - /// - [JsonProperty(PropertyName = "properties.entityMappings")] - public IList EntityMappings { get; set; } - - /// - /// Gets or sets the alert details override settings - /// - [JsonProperty(PropertyName = "properties.alertDetailsOverride")] - public AlertDetailsOverride AlertDetailsOverride { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Description == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Description"); - } - if (DisplayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); - } - if (Status == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Status"); - } - if (Query == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Query"); - } - if (Severity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Severity"); - } - if (Version == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Version"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OSFamily.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OSFamily.cs deleted file mode 100644 index 3bf17ab77d582..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OSFamily.cs +++ /dev/null @@ -1,93 +0,0 @@ -// -// 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 OSFamily. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum OSFamily - { - /// - /// Host with Linux operating system. - /// - [EnumMember(Value = "Linux")] - Linux, - /// - /// Host with Windows operating system. - /// - [EnumMember(Value = "Windows")] - Windows, - /// - /// Host with Android operating system. - /// - [EnumMember(Value = "Android")] - Android, - /// - /// Host with IOS operating system. - /// - [EnumMember(Value = "IOS")] - IOS, - /// - /// Host with Unknown operating system. - /// - [EnumMember(Value = "Unknown")] - Unknown - } - internal static class OSFamilyEnumExtension - { - internal static string ToSerializedValue(this OSFamily? value) - { - return value == null ? null : ((OSFamily)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this OSFamily value) - { - switch( value ) - { - case OSFamily.Linux: - return "Linux"; - case OSFamily.Windows: - return "Windows"; - case OSFamily.Android: - return "Android"; - case OSFamily.IOS: - return "IOS"; - case OSFamily.Unknown: - return "Unknown"; - } - return null; - } - - internal static OSFamily? ParseOSFamily(this string value) - { - switch( value ) - { - case "Linux": - return OSFamily.Linux; - case "Windows": - return OSFamily.Windows; - case "Android": - return OSFamily.Android; - case "IOS": - return OSFamily.IOS; - case "Unknown": - return OSFamily.Unknown; - } - return null; - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeATPCheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeATPCheckRequirements.cs deleted file mode 100644 index f502082fd5e92..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeATPCheckRequirements.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents OfficeATP (Office 365 Advanced Threat Protection) - /// requirements check request. - /// - [Newtonsoft.Json.JsonObject("OfficeATP")] - [Rest.Serialization.JsonTransformation] - public partial class OfficeATPCheckRequirements : DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the OfficeATPCheckRequirements class. - /// - public OfficeATPCheckRequirements() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the OfficeATPCheckRequirements class. - /// - /// The tenant id to connect to, and get the - /// data from. - public OfficeATPCheckRequirements(string tenantId) - { - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeATPDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeATPDataConnector.cs deleted file mode 100644 index ff69a4d45d122..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeATPDataConnector.cs +++ /dev/null @@ -1,93 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents OfficeATP (Office 365 Advanced Threat Protection) data - /// connector. - /// - [Newtonsoft.Json.JsonObject("OfficeATP")] - [Rest.Serialization.JsonTransformation] - public partial class OfficeATPDataConnector : DataConnector - { - /// - /// Initializes a new instance of the OfficeATPDataConnector class. - /// - public OfficeATPDataConnector() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the OfficeATPDataConnector class. - /// - /// The tenant id to connect to, and get the - /// data from. - /// 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 available data types for the - /// connector. - public OfficeATPDataConnector(string tenantId, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), AlertsDataTypeOfDataConnector dataTypes = default(AlertsDataTypeOfDataConnector)) - : base(id, name, type, systemData, etag) - { - TenantId = tenantId; - DataTypes = dataTypes; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Gets or sets the available data types for the connector. - /// - [JsonProperty(PropertyName = "properties.dataTypes")] - public AlertsDataTypeOfDataConnector DataTypes { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - if (DataTypes != null) - { - DataTypes.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeConsent.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeConsent.cs index 89877d0c88ffe..d07012d86d16c 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeConsent.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeConsent.cs @@ -32,23 +32,18 @@ public OfficeConsent() /// /// Initializes a new instance of the OfficeConsent 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. + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// The tenantId of the Office365 with the /// consent. - /// Help to easily cascade among the data - /// layers. - public OfficeConsent(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string tenantId = default(string), string consentId = default(string)) - : base(id, name, type, systemData) + /// The tenant name of the Office365 with the + /// consent. + public OfficeConsent(string id = default(string), string name = default(string), string type = default(string), string tenantId = default(string), string tenantName = default(string)) + : base(id, name, type) { TenantId = tenantId; - ConsentId = consentId; + TenantName = tenantName; CustomInit(); } @@ -64,10 +59,10 @@ public OfficeConsent() public string TenantId { get; set; } /// - /// Gets or sets help to easily cascade among the data layers. + /// Gets the tenant name of the Office365 with the consent. /// - [JsonProperty(PropertyName = "properties.consentId")] - public string ConsentId { get; set; } + [JsonProperty(PropertyName = "properties.tenantName")] + public string TenantName { get; private set; } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentAlertList.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeConsentList.cs similarity index 63% rename from sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentAlertList.cs rename to sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeConsentList.cs index 79db6d79bfc51..18fff9f137df9 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/IncidentAlertList.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeConsentList.cs @@ -17,24 +17,27 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models using System.Linq; /// - /// List of incident alerts. + /// List of all the office365 consents. /// - public partial class IncidentAlertList + public partial class OfficeConsentList { /// - /// Initializes a new instance of the IncidentAlertList class. + /// Initializes a new instance of the OfficeConsentList class. /// - public IncidentAlertList() + public OfficeConsentList() { CustomInit(); } /// - /// Initializes a new instance of the IncidentAlertList class. + /// Initializes a new instance of the OfficeConsentList class. /// - /// Array of incident alerts. - public IncidentAlertList(IList value) + /// Array of the consents. + /// URL to fetch the next set of office + /// consents. + public OfficeConsentList(IList value, string nextLink = default(string)) { + NextLink = nextLink; Value = value; CustomInit(); } @@ -45,10 +48,16 @@ public IncidentAlertList(IList value) partial void CustomInit(); /// - /// Gets or sets array of incident alerts. + /// Gets URL to fetch the next set of office consents. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; private set; } + + /// + /// Gets or sets array of the consents. /// [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + public IList Value { get; set; } /// /// Validate the object. diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnector.cs index a72f69fe2ed71..425a8b2bf0a33 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnector.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnector.cs @@ -33,21 +33,16 @@ public OfficeDataConnector() /// /// Initializes a new instance of the OfficeDataConnector class. /// + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Etag of the azure resource /// The tenant id to connect to, and get the /// data from. /// The available data types for the /// connector. - /// 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 OfficeDataConnector(string tenantId, OfficeDataConnectorDataTypes dataTypes, 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) + public OfficeDataConnector(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string tenantId = default(string), OfficeDataConnectorDataTypes dataTypes = default(OfficeDataConnectorDataTypes)) + : base(id, name, type, etag) { TenantId = tenantId; DataTypes = dataTypes; @@ -71,26 +66,5 @@ public OfficeDataConnector() [JsonProperty(PropertyName = "properties.dataTypes")] public OfficeDataConnectorDataTypes DataTypes { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - if (DataTypes == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataTypes"); - } - if (DataTypes != null) - { - DataTypes.Validate(); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnectorDataTypes.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnectorDataTypes.cs index ef946ee56bfa5..278bc09539aac 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnectorDataTypes.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnectorDataTypes.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -35,7 +34,7 @@ public OfficeDataConnectorDataTypes() /// Exchange data type connection. /// SharePoint data type connection. /// Teams data type connection. - public OfficeDataConnectorDataTypes(OfficeDataConnectorDataTypesExchange exchange, OfficeDataConnectorDataTypesSharePoint sharePoint, OfficeDataConnectorDataTypesTeams teams) + public OfficeDataConnectorDataTypes(OfficeDataConnectorDataTypesExchange exchange = default(OfficeDataConnectorDataTypesExchange), OfficeDataConnectorDataTypesSharePoint sharePoint = default(OfficeDataConnectorDataTypesSharePoint), OfficeDataConnectorDataTypesTeams teams = default(OfficeDataConnectorDataTypesTeams)) { Exchange = exchange; SharePoint = sharePoint; @@ -66,38 +65,5 @@ public OfficeDataConnectorDataTypes(OfficeDataConnectorDataTypesExchange exchang [JsonProperty(PropertyName = "teams")] public OfficeDataConnectorDataTypesTeams Teams { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Exchange == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Exchange"); - } - if (SharePoint == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SharePoint"); - } - if (Teams == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Teams"); - } - if (Exchange != null) - { - Exchange.Validate(); - } - if (SharePoint != null) - { - SharePoint.Validate(); - } - if (Teams != null) - { - Teams.Validate(); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnectorDataTypesExchange.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnectorDataTypesExchange.cs index c1ab6f6760053..b06d0c806844d 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnectorDataTypesExchange.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnectorDataTypesExchange.cs @@ -33,7 +33,7 @@ public OfficeDataConnectorDataTypesExchange() /// Describe whether this data type connection is /// enabled or not. Possible values include: 'Enabled', /// 'Disabled' - public OfficeDataConnectorDataTypesExchange(string state) + public OfficeDataConnectorDataTypesExchange(string state = default(string)) : base(state) { CustomInit(); @@ -44,15 +44,5 @@ public OfficeDataConnectorDataTypesExchange(string state) /// 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/OfficeDataConnectorDataTypesSharePoint.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnectorDataTypesSharePoint.cs index 1245549e0981a..ffe852f246520 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnectorDataTypesSharePoint.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnectorDataTypesSharePoint.cs @@ -33,7 +33,7 @@ public OfficeDataConnectorDataTypesSharePoint() /// Describe whether this data type connection is /// enabled or not. Possible values include: 'Enabled', /// 'Disabled' - public OfficeDataConnectorDataTypesSharePoint(string state) + public OfficeDataConnectorDataTypesSharePoint(string state = default(string)) : base(state) { CustomInit(); @@ -44,15 +44,5 @@ public OfficeDataConnectorDataTypesSharePoint(string state) /// 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/OfficeDataConnectorDataTypesTeams.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnectorDataTypesTeams.cs index b64270bb0cccb..583503a8e8e4c 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnectorDataTypesTeams.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeDataConnectorDataTypesTeams.cs @@ -33,7 +33,7 @@ public OfficeDataConnectorDataTypesTeams() /// Describe whether this data type connection is /// enabled or not. Possible values include: 'Enabled', /// 'Disabled' - public OfficeDataConnectorDataTypesTeams(string state) + public OfficeDataConnectorDataTypesTeams(string state = default(string)) : base(state) { CustomInit(); @@ -44,15 +44,5 @@ public OfficeDataConnectorDataTypesTeams(string state) /// 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/OfficeIRMCheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeIRMCheckRequirements.cs deleted file mode 100644 index ed07e1ce2e7f0..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeIRMCheckRequirements.cs +++ /dev/null @@ -1,70 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents OfficeIRM (Microsoft Insider Risk Management) requirements - /// check request. - /// - [Newtonsoft.Json.JsonObject("OfficeIRM")] - [Rest.Serialization.JsonTransformation] - public partial class OfficeIRMCheckRequirements : DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the OfficeIRMCheckRequirements class. - /// - public OfficeIRMCheckRequirements() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the OfficeIRMCheckRequirements class. - /// - /// The tenant id to connect to, and get the - /// data from. - public OfficeIRMCheckRequirements(string tenantId) - { - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeIRMDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeIRMDataConnector.cs deleted file mode 100644 index 1ab1000ca0cef..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OfficeIRMDataConnector.cs +++ /dev/null @@ -1,93 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents OfficeIRM (Microsoft Insider Risk Management) data - /// connector. - /// - [Newtonsoft.Json.JsonObject("OfficeIRM")] - [Rest.Serialization.JsonTransformation] - public partial class OfficeIRMDataConnector : DataConnector - { - /// - /// Initializes a new instance of the OfficeIRMDataConnector class. - /// - public OfficeIRMDataConnector() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the OfficeIRMDataConnector class. - /// - /// The tenant id to connect to, and get the - /// data from. - /// 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 available data types for the - /// connector. - public OfficeIRMDataConnector(string tenantId, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), AlertsDataTypeOfDataConnector dataTypes = default(AlertsDataTypeOfDataConnector)) - : base(id, name, type, systemData, etag) - { - TenantId = tenantId; - DataTypes = dataTypes; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Gets or sets the available data types for the connector. - /// - [JsonProperty(PropertyName = "properties.dataTypes")] - public AlertsDataTypeOfDataConnector DataTypes { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - if (DataTypes != null) - { - DataTypes.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Operation.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Operation.cs index ab1fe5e7014ff..31a7102091967 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Operation.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Operation.cs @@ -32,14 +32,11 @@ public Operation() /// Properties of the operation /// Name of the operation /// The origin of the operation - /// Indicates whether the operation is a - /// data action - public Operation(OperationDisplay display = default(OperationDisplay), string name = default(string), string origin = default(string), bool? isDataAction = default(bool?)) + public Operation(OperationDisplay display = default(OperationDisplay), string name = default(string), string origin = default(string)) { Display = display; Name = name; Origin = origin; - IsDataAction = isDataAction; CustomInit(); } @@ -66,11 +63,5 @@ public Operation() [JsonProperty(PropertyName = "origin")] public string Origin { get; set; } - /// - /// Gets or sets indicates whether the operation is a data action - /// - [JsonProperty(PropertyName = "isDataAction")] - public bool? IsDataAction { get; set; } - } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OperatorModel.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OperatorModel.cs deleted file mode 100644 index 141d60ebf8373..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OperatorModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -// 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 OperatorModel. - /// - public static class OperatorModel - { - public const string AND = "AND"; - public const string OR = "OR"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OutputType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OutputType.cs deleted file mode 100644 index e628c22c53b24..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OutputType.cs +++ /dev/null @@ -1,24 +0,0 @@ -// -// 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 OutputType. - /// - public static class OutputType - { - public const string Number = "Number"; - public const string String = "String"; - public const string Date = "Date"; - public const string Entity = "Entity"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OwnerType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OwnerType.cs deleted file mode 100644 index 6ee411a86504d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/OwnerType.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// 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 OwnerType. - /// - public static class OwnerType - { - /// - /// The incident owner type is unknown - /// - public const string Unknown = "Unknown"; - /// - /// The incident owner type is an AAD user - /// - public const string User = "User"; - /// - /// The incident owner type is an AAD group - /// - public const string Group = "Group"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PermissionProviderScope.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PermissionProviderScope.cs deleted file mode 100644 index 636281a580f02..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PermissionProviderScope.cs +++ /dev/null @@ -1,23 +0,0 @@ -// -// 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 PermissionProviderScope. - /// - public static class PermissionProviderScope - { - public const string ResourceGroup = "ResourceGroup"; - public const string Subscription = "Subscription"; - public const string Workspace = "Workspace"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Permissions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Permissions.cs deleted file mode 100644 index fcd18ba1cac46..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Permissions.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// 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; - - /// - /// Permissions required for the connector - /// - public partial class Permissions - { - /// - /// Initializes a new instance of the Permissions class. - /// - public Permissions() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Permissions class. - /// - /// Resource provider permissions - /// required for the connector - /// Customs permissions required for the - /// connector - public Permissions(IList resourceProvider = default(IList), IList customs = default(IList)) - { - ResourceProvider = resourceProvider; - Customs = customs; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource provider permissions required for the - /// connector - /// - [JsonProperty(PropertyName = "resourceProvider")] - public IList ResourceProvider { get; set; } - - /// - /// Gets or sets customs permissions required for the connector - /// - [JsonProperty(PropertyName = "customs")] - public IList Customs { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PermissionsCustomsItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PermissionsCustomsItem.cs deleted file mode 100644 index ce66c3377ab90..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PermissionsCustomsItem.cs +++ /dev/null @@ -1,42 +0,0 @@ -// -// 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 PermissionsCustomsItem : Customs - { - /// - /// Initializes a new instance of the PermissionsCustomsItem class. - /// - public PermissionsCustomsItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PermissionsCustomsItem class. - /// - /// Customs permissions name - /// Customs permissions description - public PermissionsCustomsItem(string name = default(string), string description = default(string)) - : base(name, description) - { - 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/PermissionsResourceProviderItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PermissionsResourceProviderItem.cs deleted file mode 100644 index c61dfdb410fbf..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PermissionsResourceProviderItem.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// 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 PermissionsResourceProviderItem : ResourceProvider - { - /// - /// Initializes a new instance of the PermissionsResourceProviderItem - /// class. - /// - public PermissionsResourceProviderItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PermissionsResourceProviderItem - /// class. - /// - /// Provider name. Possible values include: - /// 'Microsoft.OperationalInsights/solutions', - /// 'Microsoft.OperationalInsights/workspaces', - /// 'Microsoft.OperationalInsights/workspaces/datasources', - /// 'microsoft.aadiam/diagnosticSettings', - /// 'Microsoft.OperationalInsights/workspaces/sharedKeys', - /// 'Microsoft.Authorization/policyAssignments' - /// Permission description - /// text - /// Permission provider display - /// name - /// Permission provider scope. Possible values - /// include: 'ResourceGroup', 'Subscription', 'Workspace' - /// Required permissions for the - /// connector - public PermissionsResourceProviderItem(string provider = default(string), string permissionsDisplayText = default(string), string providerDisplayName = default(string), string scope = default(string), RequiredPermissions requiredPermissions = default(RequiredPermissions)) - : base(provider, permissionsDisplayText, providerDisplayName, scope, requiredPermissions) - { - 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/PollingFrequency.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PollingFrequency.cs deleted file mode 100644 index 0f73095405004..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/PollingFrequency.cs +++ /dev/null @@ -1,32 +0,0 @@ -// -// 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 PollingFrequency. - /// - public static class PollingFrequency - { - /// - /// Once a minute - /// - public const string OnceAMinute = "OnceAMinute"; - /// - /// Once an hour - /// - public const string OnceAnHour = "OnceAnHour"; - /// - /// Once a day - /// - public const string OnceADay = "OnceADay"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ProcessEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ProcessEntity.cs deleted file mode 100644 index 02f6eb64a9dd3..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ProcessEntity.cs +++ /dev/null @@ -1,161 +0,0 @@ -// -// 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 process entity. - /// - [Newtonsoft.Json.JsonObject("Process")] - [Rest.Serialization.JsonTransformation] - public partial class ProcessEntity : Entity - { - /// - /// Initializes a new instance of the ProcessEntity class. - /// - public ProcessEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ProcessEntity 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 account entity id running the - /// processes. - /// The command line used to create the - /// process - /// The time when the process started to - /// run - /// The elevation token associated with - /// the process. Possible values include: 'Default', 'Full', - /// 'Limited' - /// The host entity id on which the process - /// was running - /// The session entity id in - /// which the process was running - /// Image file entity id - /// The parent process entity - /// id. - /// The process ID - public ProcessEntity(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 accountEntityId = default(string), string commandLine = default(string), System.DateTime? creationTimeUtc = default(System.DateTime?), ElevationToken? elevationToken = default(ElevationToken?), string hostEntityId = default(string), string hostLogonSessionEntityId = default(string), string imageFileEntityId = default(string), string parentProcessEntityId = default(string), string processId = default(string)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - AccountEntityId = accountEntityId; - CommandLine = commandLine; - CreationTimeUtc = creationTimeUtc; - ElevationToken = elevationToken; - HostEntityId = hostEntityId; - HostLogonSessionEntityId = hostLogonSessionEntityId; - ImageFileEntityId = imageFileEntityId; - ParentProcessEntityId = parentProcessEntityId; - ProcessId = processId; - 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 account entity id running the processes. - /// - [JsonProperty(PropertyName = "properties.accountEntityId")] - public string AccountEntityId { get; private set; } - - /// - /// Gets the command line used to create the process - /// - [JsonProperty(PropertyName = "properties.commandLine")] - public string CommandLine { get; private set; } - - /// - /// Gets the time when the process started to run - /// - [JsonProperty(PropertyName = "properties.creationTimeUtc")] - public System.DateTime? CreationTimeUtc { get; private set; } - - /// - /// Gets or sets the elevation token associated with the process. - /// Possible values include: 'Default', 'Full', 'Limited' - /// - [JsonProperty(PropertyName = "properties.elevationToken")] - public ElevationToken? ElevationToken { get; set; } - - /// - /// Gets the host entity id on which the process was running - /// - [JsonProperty(PropertyName = "properties.hostEntityId")] - public string HostEntityId { get; private set; } - - /// - /// Gets the session entity id in which the process was running - /// - [JsonProperty(PropertyName = "properties.hostLogonSessionEntityId")] - public string HostLogonSessionEntityId { get; private set; } - - /// - /// Gets image file entity id - /// - [JsonProperty(PropertyName = "properties.imageFileEntityId")] - public string ImageFileEntityId { get; private set; } - - /// - /// Gets the parent process entity id. - /// - [JsonProperty(PropertyName = "properties.parentProcessEntityId")] - public string ParentProcessEntityId { get; private set; } - - /// - /// Gets the process ID - /// - [JsonProperty(PropertyName = "properties.processId")] - public string ProcessId { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ProviderName.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ProviderName.cs deleted file mode 100644 index 8827ea3f71290..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ProviderName.cs +++ /dev/null @@ -1,26 +0,0 @@ -// -// 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 ProviderName. - /// - public static class ProviderName - { - public const string MicrosoftOperationalInsightsSolutions = "Microsoft.OperationalInsights/solutions"; - public const string MicrosoftOperationalInsightsWorkspaces = "Microsoft.OperationalInsights/workspaces"; - public const string MicrosoftOperationalInsightsWorkspacesDatasources = "Microsoft.OperationalInsights/workspaces/datasources"; - public const string MicrosoftaadiamDiagnosticSettings = "microsoft.aadiam/diagnosticSettings"; - public const string MicrosoftOperationalInsightsWorkspacesSharedKeys = "Microsoft.OperationalInsights/workspaces/sharedKeys"; - public const string MicrosoftAuthorizationPolicyAssignments = "Microsoft.Authorization/policyAssignments"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ProxyResource.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ProxyResource.cs deleted file mode 100644 index 26002268bddab..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ProxyResource.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// 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; - - /// - /// Proxy Resource - /// - /// - /// The resource model definition for a Azure Resource Manager proxy - /// resource. It will not have tags and a location - /// - public partial class ProxyResource : Resource - { - /// - /// Initializes a new instance of the ProxyResource class. - /// - public ProxyResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ProxyResource 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. - public ProxyResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type, systemData) - { - 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/QueryBasedAlertRuleProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/QueryBasedAlertRuleProperties.cs deleted file mode 100644 index 6f2009efbb73f..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/QueryBasedAlertRuleProperties.cs +++ /dev/null @@ -1,212 +0,0 @@ -// -// 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; - - /// - /// Query based alert rule base property bag. - /// - public partial class QueryBasedAlertRuleProperties - { - /// - /// Initializes a new instance of the QueryBasedAlertRuleProperties - /// class. - /// - public QueryBasedAlertRuleProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the QueryBasedAlertRuleProperties - /// class. - /// - /// The display name for alerts created by - /// this alert rule. - /// Determines whether this alert rule is enabled - /// or disabled. - /// The suppression (in ISO 8601 - /// duration format) to wait since last time this alert rule been - /// triggered. - /// Determines whether the suppression - /// for this alert rule is enabled or disabled. - /// The Name of the alert rule - /// template used to create this rule. - /// The version of the alert rule - /// template used to create this rule - in format <a.b.c>, where - /// all are numbers, for example 0 <1.0.2> - /// The description of the alert - /// rule. - /// The query that creates alerts for this - /// rule. - /// The last time that this alert rule - /// has been modified. - /// The severity for alerts created by this - /// alert rule. Possible values include: 'High', 'Medium', 'Low', - /// 'Informational' - /// The tactics of the alert rule - /// The settings of the incidents - /// that created from alerts triggered by this analytics rule - /// Dictionary of string key-value pairs of - /// columns to be attached to the alert - /// Array of the entity mappings of the - /// alert rule - /// The alert details override - /// settings - public QueryBasedAlertRuleProperties(string displayName, bool enabled, System.TimeSpan suppressionDuration, bool suppressionEnabled, string alertRuleTemplateName = default(string), string templateVersion = default(string), string description = default(string), string query = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?), string severity = default(string), IList tactics = default(IList), IncidentConfiguration incidentConfiguration = default(IncidentConfiguration), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride)) - { - AlertRuleTemplateName = alertRuleTemplateName; - TemplateVersion = templateVersion; - Description = description; - Query = query; - DisplayName = displayName; - Enabled = enabled; - LastModifiedUtc = lastModifiedUtc; - SuppressionDuration = suppressionDuration; - SuppressionEnabled = suppressionEnabled; - Severity = severity; - Tactics = tactics; - IncidentConfiguration = incidentConfiguration; - CustomDetails = customDetails; - EntityMappings = entityMappings; - AlertDetailsOverride = alertDetailsOverride; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Name of the alert rule template used to create - /// this rule. - /// - [JsonProperty(PropertyName = "alertRuleTemplateName")] - public string AlertRuleTemplateName { get; set; } - - /// - /// Gets or sets the version of the alert rule template used to create - /// this rule - in format &lt;a.b.c&gt;, where all are numbers, - /// for example 0 &lt;1.0.2&gt; - /// - [JsonProperty(PropertyName = "templateVersion")] - public string TemplateVersion { get; set; } - - /// - /// Gets or sets the description of the alert rule. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// Gets or sets the query that creates alerts for this rule. - /// - [JsonProperty(PropertyName = "query")] - public string Query { get; set; } - - /// - /// Gets or sets the display name for alerts created by this alert - /// rule. - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets determines whether this alert rule is enabled or - /// disabled. - /// - [JsonProperty(PropertyName = "enabled")] - public bool Enabled { get; set; } - - /// - /// Gets the last time that this alert rule has been modified. - /// - [JsonProperty(PropertyName = "lastModifiedUtc")] - public System.DateTime? LastModifiedUtc { get; private set; } - - /// - /// Gets or sets the suppression (in ISO 8601 duration format) to wait - /// since last time this alert rule been triggered. - /// - [JsonProperty(PropertyName = "suppressionDuration")] - public System.TimeSpan SuppressionDuration { get; set; } - - /// - /// Gets or sets determines whether the suppression for this alert rule - /// is enabled or disabled. - /// - [JsonProperty(PropertyName = "suppressionEnabled")] - public bool SuppressionEnabled { get; set; } - - /// - /// Gets or sets the severity for alerts created by this alert rule. - /// Possible values include: 'High', 'Medium', 'Low', 'Informational' - /// - [JsonProperty(PropertyName = "severity")] - public string Severity { get; set; } - - /// - /// Gets or sets the tactics of the alert rule - /// - [JsonProperty(PropertyName = "tactics")] - public IList Tactics { get; set; } - - /// - /// Gets or sets the settings of the incidents that created from alerts - /// triggered by this analytics rule - /// - [JsonProperty(PropertyName = "incidentConfiguration")] - public IncidentConfiguration IncidentConfiguration { get; set; } - - /// - /// Gets or sets dictionary of string key-value pairs of columns to be - /// attached to the alert - /// - [JsonProperty(PropertyName = "customDetails")] - public IDictionary CustomDetails { get; set; } - - /// - /// Gets or sets array of the entity mappings of the alert rule - /// - [JsonProperty(PropertyName = "entityMappings")] - public IList EntityMappings { get; set; } - - /// - /// Gets or sets the alert details override settings - /// - [JsonProperty(PropertyName = "alertDetailsOverride")] - public AlertDetailsOverride AlertDetailsOverride { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DisplayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); - } - if (IncidentConfiguration != null) - { - IncidentConfiguration.Validate(); - } - } - } -} 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 deleted file mode 100644 index 49894eafac852..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/QueryBasedAlertRuleTemplateProperties.cs +++ /dev/null @@ -1,115 +0,0 @@ -// -// 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; - - /// - /// Query based alert rule template base property bag. - /// - public partial class QueryBasedAlertRuleTemplateProperties - { - /// - /// Initializes a new instance of the - /// QueryBasedAlertRuleTemplateProperties class. - /// - public QueryBasedAlertRuleTemplateProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// QueryBasedAlertRuleTemplateProperties class. - /// - /// The query that creates alerts for this - /// rule. - /// The severity for alerts created by this - /// alert rule. Possible values include: 'High', 'Medium', 'Low', - /// 'Informational' - /// The tactics of the alert rule - /// The version of this template - in format - /// <a.b.c>, where all are numbers. For example - /// <1.0.2>. - /// Dictionary of string key-value pairs of - /// columns to be attached to the alert - /// Array of the entity mappings of the - /// alert rule - /// The alert details override - /// settings - public QueryBasedAlertRuleTemplateProperties(string query = default(string), string severity = default(string), IList tactics = default(IList), string version = default(string), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride)) - { - Query = query; - Severity = severity; - Tactics = tactics; - Version = version; - CustomDetails = customDetails; - EntityMappings = entityMappings; - AlertDetailsOverride = alertDetailsOverride; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the query that creates alerts for this rule. - /// - [JsonProperty(PropertyName = "query")] - public string Query { get; set; } - - /// - /// Gets or sets the severity for alerts created by this alert rule. - /// Possible values include: 'High', 'Medium', 'Low', 'Informational' - /// - [JsonProperty(PropertyName = "severity")] - public string Severity { get; set; } - - /// - /// Gets or sets the tactics of the alert rule - /// - [JsonProperty(PropertyName = "tactics")] - public IList Tactics { get; set; } - - /// - /// Gets or sets the version of this template - in format - /// &lt;a.b.c&gt;, where all are numbers. For example - /// &lt;1.0.2&gt;. - /// - [JsonProperty(PropertyName = "version")] - public string Version { get; set; } - - /// - /// Gets or sets dictionary of string key-value pairs of columns to be - /// attached to the alert - /// - [JsonProperty(PropertyName = "customDetails")] - public IDictionary CustomDetails { get; set; } - - /// - /// Gets or sets array of the entity mappings of the alert rule - /// - [JsonProperty(PropertyName = "entityMappings")] - public IList EntityMappings { get; set; } - - /// - /// Gets or sets the alert details override settings - /// - [JsonProperty(PropertyName = "alertDetailsOverride")] - public AlertDetailsOverride AlertDetailsOverride { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RegistryHive.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RegistryHive.cs deleted file mode 100644 index 0860ca0264f82..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RegistryHive.cs +++ /dev/null @@ -1,60 +0,0 @@ -// -// 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 RegistryHive. - /// - public static class RegistryHive - { - /// - /// HKEY_LOCAL_MACHINE - /// - public const string HKEYLOCALMACHINE = "HKEY_LOCAL_MACHINE"; - /// - /// HKEY_CLASSES_ROOT - /// - public const string HKEYCLASSESROOT = "HKEY_CLASSES_ROOT"; - /// - /// HKEY_CURRENT_CONFIG - /// - public const string HKEYCURRENTCONFIG = "HKEY_CURRENT_CONFIG"; - /// - /// HKEY_USERS - /// - public const string HKEYUSERS = "HKEY_USERS"; - /// - /// HKEY_CURRENT_USER_LOCAL_SETTINGS - /// - public const string HKEYCURRENTUSERLOCALSETTINGS = "HKEY_CURRENT_USER_LOCAL_SETTINGS"; - /// - /// HKEY_PERFORMANCE_DATA - /// - public const string HKEYPERFORMANCEDATA = "HKEY_PERFORMANCE_DATA"; - /// - /// HKEY_PERFORMANCE_NLSTEXT - /// - public const string HKEYPERFORMANCENLSTEXT = "HKEY_PERFORMANCE_NLSTEXT"; - /// - /// HKEY_PERFORMANCE_TEXT - /// - public const string HKEYPERFORMANCETEXT = "HKEY_PERFORMANCE_TEXT"; - /// - /// HKEY_A - /// - public const string HKEYA = "HKEY_A"; - /// - /// HKEY_CURRENT_USER - /// - public const string HKEYCURRENTUSER = "HKEY_CURRENT_USER"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RegistryKeyEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RegistryKeyEntity.cs deleted file mode 100644 index 3663e6f019789..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RegistryKeyEntity.cs +++ /dev/null @@ -1,105 +0,0 @@ -// -// 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 registry key entity. - /// - [Newtonsoft.Json.JsonObject("RegistryKey")] - [Rest.Serialization.JsonTransformation] - public partial class RegistryKeyEntity : Entity - { - /// - /// Initializes a new instance of the RegistryKeyEntity class. - /// - public RegistryKeyEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RegistryKeyEntity 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 hive that holds the registry key. Possible - /// values include: 'HKEY_LOCAL_MACHINE', 'HKEY_CLASSES_ROOT', - /// 'HKEY_CURRENT_CONFIG', 'HKEY_USERS', - /// 'HKEY_CURRENT_USER_LOCAL_SETTINGS', 'HKEY_PERFORMANCE_DATA', - /// 'HKEY_PERFORMANCE_NLSTEXT', 'HKEY_PERFORMANCE_TEXT', 'HKEY_A', - /// 'HKEY_CURRENT_USER' - /// The registry key path. - public RegistryKeyEntity(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 hive = default(string), string key = default(string)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - Hive = hive; - Key = key; - 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 hive that holds the registry key. Possible values include: - /// 'HKEY_LOCAL_MACHINE', 'HKEY_CLASSES_ROOT', 'HKEY_CURRENT_CONFIG', - /// 'HKEY_USERS', 'HKEY_CURRENT_USER_LOCAL_SETTINGS', - /// 'HKEY_PERFORMANCE_DATA', 'HKEY_PERFORMANCE_NLSTEXT', - /// 'HKEY_PERFORMANCE_TEXT', 'HKEY_A', 'HKEY_CURRENT_USER' - /// - [JsonProperty(PropertyName = "properties.hive")] - public string Hive { get; private set; } - - /// - /// Gets the registry key path. - /// - [JsonProperty(PropertyName = "properties.key")] - public string Key { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RegistryValueEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RegistryValueEntity.cs deleted file mode 100644 index 6ffb7d0590cb1..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RegistryValueEntity.cs +++ /dev/null @@ -1,120 +0,0 @@ -// -// 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 registry value entity. - /// - [Newtonsoft.Json.JsonObject("RegistryValue")] - [Rest.Serialization.JsonTransformation] - public partial class RegistryValueEntity : Entity - { - /// - /// Initializes a new instance of the RegistryValueEntity class. - /// - public RegistryValueEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RegistryValueEntity 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 registry key entity id. - /// String formatted representation of the - /// value data. - /// The registry value name. - /// Specifies the data types to use when - /// storing values in the registry, or identifies the data type of a - /// value in the registry. Possible values include: 'None', 'Unknown', - /// 'String', 'ExpandString', 'Binary', 'DWord', 'MultiString', - /// 'QWord' - public RegistryValueEntity(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 keyEntityId = default(string), string valueData = default(string), string valueName = default(string), string valueType = default(string)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - KeyEntityId = keyEntityId; - ValueData = valueData; - ValueName = valueName; - ValueType = valueType; - 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 registry key entity id. - /// - [JsonProperty(PropertyName = "properties.keyEntityId")] - public string KeyEntityId { get; private set; } - - /// - /// Gets string formatted representation of the value data. - /// - [JsonProperty(PropertyName = "properties.valueData")] - public string ValueData { get; private set; } - - /// - /// Gets the registry value name. - /// - [JsonProperty(PropertyName = "properties.valueName")] - public string ValueName { get; private set; } - - /// - /// Gets specifies the data types to use when storing values in the - /// registry, or identifies the data type of a value in the registry. - /// Possible values include: 'None', 'Unknown', 'String', - /// 'ExpandString', 'Binary', 'DWord', 'MultiString', 'QWord' - /// - [JsonProperty(PropertyName = "properties.valueType")] - public string ValueType { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RegistryValueKind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RegistryValueKind.cs deleted file mode 100644 index 76710dc818473..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RegistryValueKind.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// 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 RegistryValueKind. - /// - public static class RegistryValueKind - { - /// - /// None - /// - public const string None = "None"; - /// - /// Unknown value type - /// - public const string Unknown = "Unknown"; - /// - /// String value type - /// - public const string String = "String"; - /// - /// ExpandString value type - /// - public const string ExpandString = "ExpandString"; - /// - /// Binary value type - /// - public const string Binary = "Binary"; - /// - /// DWord value type - /// - public const string DWord = "DWord"; - /// - /// MultiString value type - /// - public const string MultiString = "MultiString"; - /// - /// QWord value type - /// - public const string QWord = "QWord"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Relation.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Relation.cs deleted file mode 100644 index ece75207014c3..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Relation.cs +++ /dev/null @@ -1,105 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents a relation between two resources - /// - [Rest.Serialization.JsonTransformation] - public partial class Relation : ResourceWithEtag - { - /// - /// Initializes a new instance of the Relation class. - /// - public Relation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Relation class. - /// - /// The resource ID of the related - /// resource - /// 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 name of the related - /// resource - /// The resource type of the related - /// resource - /// The resource kind of the related - /// resource - public Relation(string relatedResourceId, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string relatedResourceName = default(string), string relatedResourceType = default(string), string relatedResourceKind = default(string)) - : base(id, name, type, systemData, etag) - { - RelatedResourceId = relatedResourceId; - RelatedResourceName = relatedResourceName; - RelatedResourceType = relatedResourceType; - RelatedResourceKind = relatedResourceKind; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the resource ID of the related resource - /// - [JsonProperty(PropertyName = "properties.relatedResourceId")] - public string RelatedResourceId { get; set; } - - /// - /// Gets the name of the related resource - /// - [JsonProperty(PropertyName = "properties.relatedResourceName")] - public string RelatedResourceName { get; private set; } - - /// - /// Gets the resource type of the related resource - /// - [JsonProperty(PropertyName = "properties.relatedResourceType")] - public string RelatedResourceType { get; private set; } - - /// - /// Gets the resource kind of the related resource - /// - [JsonProperty(PropertyName = "properties.relatedResourceKind")] - public string RelatedResourceKind { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (RelatedResourceId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "RelatedResourceId"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Repo.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Repo.cs deleted file mode 100644 index bb4e6ae21c906..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Repo.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// 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; - - /// - /// Represents a repository. - /// - public partial class Repo - { - /// - /// Initializes a new instance of the Repo class. - /// - public Repo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Repo class. - /// - /// The url to access the repository. - /// The name of the repository. - /// Array of branches. - public Repo(string url = default(string), string fullName = default(string), IList branches = default(IList)) - { - Url = url; - FullName = fullName; - Branches = branches; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the url to access the repository. - /// - [JsonProperty(PropertyName = "url")] - public string Url { get; set; } - - /// - /// Gets or sets the name of the repository. - /// - [JsonProperty(PropertyName = "fullName")] - public string FullName { get; set; } - - /// - /// Gets or sets array of branches. - /// - [JsonProperty(PropertyName = "branches")] - public IList Branches { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RepoType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RepoType.cs deleted file mode 100644 index f1000048317f5..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RepoType.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -// 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 RepoType. - /// - public static class RepoType - { - public const string Github = "Github"; - public const string DevOps = "DevOps"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Repository.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Repository.cs deleted file mode 100644 index 1fb4a78bab6f5..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Repository.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// 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; - - /// - /// metadata of a repository. - /// - public partial class Repository - { - /// - /// Initializes a new instance of the Repository class. - /// - public Repository() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Repository class. - /// - /// Url of repository. - /// Branch name of repository. - /// Display url of repository. - /// Url to access repository action - /// logs. - /// Dictionary of source control content type - /// and path mapping. - public Repository(string url = default(string), string branch = default(string), string displayUrl = default(string), string deploymentLogsUrl = default(string), IList pathMapping = default(IList)) - { - Url = url; - Branch = branch; - DisplayUrl = displayUrl; - DeploymentLogsUrl = deploymentLogsUrl; - PathMapping = pathMapping; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets url of repository. - /// - [JsonProperty(PropertyName = "url")] - public string Url { get; set; } - - /// - /// Gets or sets branch name of repository. - /// - [JsonProperty(PropertyName = "branch")] - public string Branch { get; set; } - - /// - /// Gets or sets display url of repository. - /// - [JsonProperty(PropertyName = "displayUrl")] - public string DisplayUrl { get; set; } - - /// - /// Gets or sets url to access repository action logs. - /// - [JsonProperty(PropertyName = "deploymentLogsUrl")] - public string DeploymentLogsUrl { get; set; } - - /// - /// Gets or sets dictionary of source control content type and path - /// mapping. - /// - [JsonProperty(PropertyName = "pathMapping")] - public IList PathMapping { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RequiredPermissions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RequiredPermissions.cs deleted file mode 100644 index 91d9347cfa250..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/RequiredPermissions.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// 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; - - /// - /// Required permissions for the connector - /// - public partial class RequiredPermissions - { - /// - /// Initializes a new instance of the RequiredPermissions class. - /// - public RequiredPermissions() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the RequiredPermissions class. - /// - /// action permission - /// write permission - /// read permission - /// delete permission - public RequiredPermissions(bool? action = default(bool?), bool? write = default(bool?), bool? read = default(bool?), bool? delete = default(bool?)) - { - Action = action; - Write = write; - Read = read; - Delete = delete; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets action permission - /// - [JsonProperty(PropertyName = "action")] - public bool? Action { get; set; } - - /// - /// Gets or sets write permission - /// - [JsonProperty(PropertyName = "write")] - public bool? Write { get; set; } - - /// - /// Gets or sets read permission - /// - [JsonProperty(PropertyName = "read")] - public bool? Read { get; set; } - - /// - /// Gets or sets delete permission - /// - [JsonProperty(PropertyName = "delete")] - public bool? Delete { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Resource.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Resource.cs index 650557babf57e..d200b48f9b425 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Resource.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Resource.cs @@ -16,12 +16,8 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models using System.Linq; /// - /// Resource + /// An azure resource object /// - /// - /// Common fields that are returned in the response for all Azure Resource - /// Manager resources - /// public partial class Resource : IResource { /// @@ -35,20 +31,14 @@ public Resource() /// /// Initializes a new instance of the Resource 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. - public Resource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) + /// Azure resource Id + /// Azure resource name + /// Azure resource type + public Resource(string id = default(string), string name = default(string), string type = default(string)) { Id = id; Name = name; Type = type; - SystemData = systemData; CustomInit(); } @@ -58,32 +48,22 @@ public Resource() partial void CustomInit(); /// - /// Gets fully qualified resource ID for the resource. Ex - - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// Gets azure resource Id /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Gets the name of the resource + /// Gets azure resource name /// [JsonProperty(PropertyName = "name")] public string Name { get; private set; } /// - /// Gets the type of the resource. E.g. - /// "Microsoft.Compute/virtualMachines" or - /// "Microsoft.Storage/storageAccounts" + /// Gets azure resource type /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } - /// - /// Gets azure Resource Manager metadata containing createdBy and - /// modifiedBy information. - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceProvider.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceProvider.cs deleted file mode 100644 index 2cc1bce54ecdf..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceProvider.cs +++ /dev/null @@ -1,100 +0,0 @@ -// -// 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; - - /// - /// Resource provider permissions required for the connector - /// - public partial class ResourceProvider - { - /// - /// Initializes a new instance of the ResourceProvider class. - /// - public ResourceProvider() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ResourceProvider class. - /// - /// Provider name. Possible values include: - /// 'Microsoft.OperationalInsights/solutions', - /// 'Microsoft.OperationalInsights/workspaces', - /// 'Microsoft.OperationalInsights/workspaces/datasources', - /// 'microsoft.aadiam/diagnosticSettings', - /// 'Microsoft.OperationalInsights/workspaces/sharedKeys', - /// 'Microsoft.Authorization/policyAssignments' - /// Permission description - /// text - /// Permission provider display - /// name - /// Permission provider scope. Possible values - /// include: 'ResourceGroup', 'Subscription', 'Workspace' - /// Required permissions for the - /// connector - public ResourceProvider(string provider = default(string), string permissionsDisplayText = default(string), string providerDisplayName = default(string), string scope = default(string), RequiredPermissions requiredPermissions = default(RequiredPermissions)) - { - Provider = provider; - PermissionsDisplayText = permissionsDisplayText; - ProviderDisplayName = providerDisplayName; - Scope = scope; - RequiredPermissions = requiredPermissions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets provider name. Possible values include: - /// 'Microsoft.OperationalInsights/solutions', - /// 'Microsoft.OperationalInsights/workspaces', - /// 'Microsoft.OperationalInsights/workspaces/datasources', - /// 'microsoft.aadiam/diagnosticSettings', - /// 'Microsoft.OperationalInsights/workspaces/sharedKeys', - /// 'Microsoft.Authorization/policyAssignments' - /// - [JsonProperty(PropertyName = "provider")] - public string Provider { get; set; } - - /// - /// Gets or sets permission description text - /// - [JsonProperty(PropertyName = "permissionsDisplayText")] - public string PermissionsDisplayText { get; set; } - - /// - /// Gets or sets permission provider display name - /// - [JsonProperty(PropertyName = "providerDisplayName")] - public string ProviderDisplayName { get; set; } - - /// - /// Gets or sets permission provider scope. Possible values include: - /// 'ResourceGroup', 'Subscription', 'Workspace' - /// - [JsonProperty(PropertyName = "scope")] - public string Scope { get; set; } - - /// - /// Gets or sets required permissions for the connector - /// - [JsonProperty(PropertyName = "requiredPermissions")] - public RequiredPermissions RequiredPermissions { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceWithEtag.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceWithEtag.cs index 06227e57b6b53..16b8a40cb14bc 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceWithEtag.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ResourceWithEtag.cs @@ -10,13 +10,15 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { + using Microsoft.Rest; + using Microsoft.Rest.Azure; using Newtonsoft.Json; using System.Linq; /// /// An azure resource object with an Etag property /// - public partial class ResourceWithEtag : Resource + public partial class ResourceWithEtag : IResource { /// /// Initializes a new instance of the ResourceWithEtag class. @@ -29,18 +31,15 @@ public ResourceWithEtag() /// /// Initializes a new instance of the ResourceWithEtag 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. + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// Etag of the azure resource - public ResourceWithEtag(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) + public ResourceWithEtag(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) { + Id = id; + Name = name; + Type = type; Etag = etag; CustomInit(); } @@ -50,6 +49,24 @@ public ResourceWithEtag() /// partial void CustomInit(); + /// + /// Gets azure resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets azure resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets azure resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + /// /// Gets or sets etag of the azure resource /// diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SampleQueries.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SampleQueries.cs deleted file mode 100644 index aa70cec53c767..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SampleQueries.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// 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 sample queries for the connector - /// - public partial class SampleQueries - { - /// - /// Initializes a new instance of the SampleQueries class. - /// - public SampleQueries() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SampleQueries class. - /// - /// The sample query description - /// the sample query - public SampleQueries(string description = default(string), string query = default(string)) - { - Description = description; - Query = query; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the sample query description - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// Gets or sets the sample query - /// - [JsonProperty(PropertyName = "query")] - public string Query { get; set; } - - } -} 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 1f01349a721e8..cc53fa1d1090a 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 @@ -35,17 +35,6 @@ public ScheduledAlertRule() /// /// Initializes a new instance of the ScheduledAlertRule class. /// - /// The frequency (in ISO 8601 duration - /// format) for this alert rule to run. - /// The period (in ISO 8601 duration format) - /// that this alert rule looks at. - /// The operation against the threshold - /// that triggers alert rule. Possible values include: 'GreaterThan', - /// 'LessThan', 'Equal', 'NotEqual' - /// The threshold triggers this alert - /// rule. - /// The query that creates alerts for this - /// rule. /// The display name for alerts created by /// this alert rule. /// Determines whether this alert rule is enabled @@ -55,61 +44,48 @@ public ScheduledAlertRule() /// triggered. /// Determines whether the suppression /// for this alert rule is enabled or disabled. + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Etag of the azure resource + /// The query that creates alerts for this + /// rule. + /// The frequency (in ISO 8601 duration + /// format) for this alert rule to run. + /// The period (in ISO 8601 duration format) + /// that this alert rule looks at. /// The severity for alerts created by this /// alert rule. Possible values include: 'High', 'Medium', 'Low', /// 'Informational' - /// 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 event grouping - /// settings. + /// The operation against the threshold + /// that triggers alert rule. Possible values include: 'GreaterThan', + /// 'LessThan', 'Equal', 'NotEqual' + /// The threshold triggers this alert + /// rule. /// The Name of the alert rule /// template used to create this rule. - /// The version of the alert rule - /// template used to create this rule - in format <a.b.c>, where - /// all are numbers, for example 0 <1.0.2> /// The description of the alert /// rule. /// The last time that this alert rule /// has been modified. /// The tactics of the alert rule - /// The settings of the incidents - /// that created from alerts triggered by this analytics rule - /// Dictionary of string key-value pairs of - /// columns to be attached to the alert - /// Array of the entity mappings of the - /// alert rule - /// The alert details override - /// settings - public ScheduledAlertRule(System.TimeSpan queryFrequency, System.TimeSpan queryPeriod, TriggerOperator triggerOperator, int triggerThreshold, 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), EventGroupingSettings eventGroupingSettings = default(EventGroupingSettings), string alertRuleTemplateName = default(string), string templateVersion = default(string), string description = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?), IList tactics = default(IList), IncidentConfiguration incidentConfiguration = default(IncidentConfiguration), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride)) - : base(id, name, type, systemData, etag) + public ScheduledAlertRule(string displayName, bool enabled, System.TimeSpan suppressionDuration, bool suppressionEnabled, string id = default(string), string name = default(string), string type = default(string), 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?), string alertRuleTemplateName = default(string), string description = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?), IList tactics = default(IList)) + : base(id, name, type, etag) { + Query = query; QueryFrequency = queryFrequency; QueryPeriod = queryPeriod; + Severity = severity; TriggerOperator = triggerOperator; TriggerThreshold = triggerThreshold; - EventGroupingSettings = eventGroupingSettings; AlertRuleTemplateName = alertRuleTemplateName; - TemplateVersion = templateVersion; Description = description; - Query = query; DisplayName = displayName; Enabled = enabled; LastModifiedUtc = lastModifiedUtc; SuppressionDuration = suppressionDuration; SuppressionEnabled = suppressionEnabled; - Severity = severity; Tactics = tactics; - IncidentConfiguration = incidentConfiguration; - CustomDetails = customDetails; - EntityMappings = entityMappings; - AlertDetailsOverride = alertDetailsOverride; CustomInit(); } @@ -118,19 +94,32 @@ public ScheduledAlertRule() /// partial void CustomInit(); + /// + /// Gets or sets the query that creates alerts for this rule. + /// + [JsonProperty(PropertyName = "properties.query")] + public string Query { get; set; } + /// /// Gets or sets the frequency (in ISO 8601 duration format) for this /// alert rule to run. /// [JsonProperty(PropertyName = "properties.queryFrequency")] - public System.TimeSpan QueryFrequency { get; set; } + public System.TimeSpan? QueryFrequency { get; set; } /// /// Gets or sets the period (in ISO 8601 duration format) that this /// alert rule looks at. /// [JsonProperty(PropertyName = "properties.queryPeriod")] - public System.TimeSpan QueryPeriod { get; set; } + public System.TimeSpan? QueryPeriod { get; set; } + + /// + /// Gets or sets the severity for alerts created by this alert rule. + /// Possible values include: 'High', 'Medium', 'Low', 'Informational' + /// + [JsonProperty(PropertyName = "properties.severity")] + public string Severity { get; set; } /// /// Gets or sets the operation against the threshold that triggers @@ -138,19 +127,13 @@ public ScheduledAlertRule() /// 'Equal', 'NotEqual' /// [JsonProperty(PropertyName = "properties.triggerOperator")] - public TriggerOperator TriggerOperator { get; set; } + public TriggerOperator? TriggerOperator { get; set; } /// /// Gets or sets the threshold triggers this alert rule. /// [JsonProperty(PropertyName = "properties.triggerThreshold")] - public int TriggerThreshold { get; set; } - - /// - /// Gets or sets the event grouping settings. - /// - [JsonProperty(PropertyName = "properties.eventGroupingSettings")] - public EventGroupingSettings EventGroupingSettings { get; set; } + public int? TriggerThreshold { get; set; } /// /// Gets or sets the Name of the alert rule template used to create @@ -159,26 +142,12 @@ public ScheduledAlertRule() [JsonProperty(PropertyName = "properties.alertRuleTemplateName")] public string AlertRuleTemplateName { get; set; } - /// - /// Gets or sets the version of the alert rule template used to create - /// this rule - in format &lt;a.b.c&gt;, where all are numbers, - /// for example 0 &lt;1.0.2&gt; - /// - [JsonProperty(PropertyName = "properties.templateVersion")] - public string TemplateVersion { get; set; } - /// /// Gets or sets the description of the alert rule. /// [JsonProperty(PropertyName = "properties.description")] public string Description { get; set; } - /// - /// Gets or sets the query that creates alerts for this rule. - /// - [JsonProperty(PropertyName = "properties.query")] - public string Query { get; set; } - /// /// Gets or sets the display name for alerts created by this alert /// rule. @@ -213,45 +182,12 @@ public ScheduledAlertRule() [JsonProperty(PropertyName = "properties.suppressionEnabled")] public bool SuppressionEnabled { get; set; } - /// - /// Gets or sets the severity for alerts created by this alert rule. - /// Possible values include: 'High', 'Medium', 'Low', 'Informational' - /// - [JsonProperty(PropertyName = "properties.severity")] - public string Severity { get; set; } - /// /// Gets or sets the tactics of the alert rule /// [JsonProperty(PropertyName = "properties.tactics")] public IList Tactics { get; set; } - /// - /// Gets or sets the settings of the incidents that created from alerts - /// triggered by this analytics rule - /// - [JsonProperty(PropertyName = "properties.incidentConfiguration")] - public IncidentConfiguration IncidentConfiguration { get; set; } - - /// - /// Gets or sets dictionary of string key-value pairs of columns to be - /// attached to the alert - /// - [JsonProperty(PropertyName = "properties.customDetails")] - public IDictionary CustomDetails { get; set; } - - /// - /// Gets or sets array of the entity mappings of the alert rule - /// - [JsonProperty(PropertyName = "properties.entityMappings")] - public IList EntityMappings { get; set; } - - /// - /// Gets or sets the alert details override settings - /// - [JsonProperty(PropertyName = "properties.alertDetailsOverride")] - public AlertDetailsOverride AlertDetailsOverride { get; set; } - /// /// Validate the object. /// @@ -260,22 +196,10 @@ public ScheduledAlertRule() /// public virtual void Validate() { - if (Query == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Query"); - } if (DisplayName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); } - if (Severity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Severity"); - } - if (IncidentConfiguration != null) - { - IncidentConfiguration.Validate(); - } } } } 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 321288f6cb519..028dfc8a8eac0 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 @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models using System.Linq; /// - /// Scheduled alert rule template property bag. + /// Schedule alert rule template property bag. /// public partial class ScheduledAlertRuleCommonProperties { @@ -31,24 +31,28 @@ public ScheduledAlertRuleCommonProperties() /// Initializes a new instance of the /// ScheduledAlertRuleCommonProperties class. /// + /// The query that creates alerts for this + /// rule. /// The frequency (in ISO 8601 duration /// format) for this alert rule to run. /// The period (in ISO 8601 duration format) /// that this alert rule looks at. + /// The severity for alerts created by this + /// alert rule. Possible values include: 'High', 'Medium', 'Low', + /// 'Informational' /// The operation against the threshold /// that triggers alert rule. Possible values include: 'GreaterThan', /// 'LessThan', 'Equal', 'NotEqual' /// The threshold triggers this alert /// rule. - /// The event grouping - /// settings. - public ScheduledAlertRuleCommonProperties(System.TimeSpan? queryFrequency = default(System.TimeSpan?), System.TimeSpan? queryPeriod = default(System.TimeSpan?), TriggerOperator? triggerOperator = default(TriggerOperator?), int? triggerThreshold = default(int?), EventGroupingSettings eventGroupingSettings = default(EventGroupingSettings)) + 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?)) { + Query = query; QueryFrequency = queryFrequency; QueryPeriod = queryPeriod; + Severity = severity; TriggerOperator = triggerOperator; TriggerThreshold = triggerThreshold; - EventGroupingSettings = eventGroupingSettings; CustomInit(); } @@ -57,6 +61,12 @@ public ScheduledAlertRuleCommonProperties() /// partial void CustomInit(); + /// + /// Gets or sets the query that creates alerts for this rule. + /// + [JsonProperty(PropertyName = "query")] + public string Query { get; set; } + /// /// Gets or sets the frequency (in ISO 8601 duration format) for this /// alert rule to run. @@ -71,6 +81,13 @@ public ScheduledAlertRuleCommonProperties() [JsonProperty(PropertyName = "queryPeriod")] public System.TimeSpan? QueryPeriod { get; set; } + /// + /// Gets or sets the severity for alerts created by this alert rule. + /// Possible values include: 'High', 'Medium', 'Low', 'Informational' + /// + [JsonProperty(PropertyName = "severity")] + public string Severity { get; set; } + /// /// Gets or sets the operation against the threshold that triggers /// alert rule. Possible values include: 'GreaterThan', 'LessThan', @@ -85,11 +102,5 @@ public ScheduledAlertRuleCommonProperties() [JsonProperty(PropertyName = "triggerThreshold")] public int? TriggerThreshold { get; set; } - /// - /// Gets or sets the event grouping settings. - /// - [JsonProperty(PropertyName = "eventGroupingSettings")] - public EventGroupingSettings EventGroupingSettings { 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 5f92ec9eb2d1f..5308116350d2d 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 @@ -35,76 +35,53 @@ public ScheduledAlertRuleTemplate() /// /// Initializes a new instance of the ScheduledAlertRuleTemplate class. /// + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// the number of alert /// rules that were created by this template + /// The time that this alert rule template + /// has been added. /// The description of the alert rule /// template. /// The display name for alert rule /// template. + /// The required data connectors + /// for this template /// The alert rule template status. Possible /// values include: 'Installed', 'Available', 'NotAvailable' /// The query that creates alerts for this /// rule. - /// The severity for alerts created by this - /// alert rule. Possible values include: 'High', 'Medium', 'Low', - /// 'Informational' - /// The version of this template - in format - /// <a.b.c>, where all are numbers. For example - /// <1.0.2>. /// The frequency (in ISO 8601 duration /// format) for this alert rule to run. /// The period (in ISO 8601 duration format) /// that this alert rule looks at. + /// The severity for alerts created by this + /// alert rule. Possible values include: 'High', 'Medium', 'Low', + /// 'Informational' /// The operation against the threshold /// that triggers alert rule. Possible values include: 'GreaterThan', /// 'LessThan', 'Equal', 'NotEqual' /// The threshold triggers this alert /// rule. - /// 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 last time that this alert rule - /// template has been updated. - /// The time that this alert rule template - /// has been added. - /// The required data sources for - /// this template - /// The tactics of the alert rule - /// Dictionary of string key-value pairs of - /// columns to be attached to the alert - /// Array of the entity mappings of the - /// alert rule - /// The alert details override - /// settings - /// The event grouping - /// settings. - public ScheduledAlertRuleTemplate(int alertRulesCreatedByTemplateCount, string description, string displayName, string status, string query, string severity, string version, System.TimeSpan queryFrequency, System.TimeSpan queryPeriod, TriggerOperator triggerOperator, int triggerThreshold, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), System.DateTime? lastUpdatedDateUTC = default(System.DateTime?), System.DateTime? createdDateUTC = default(System.DateTime?), IList requiredDataConnectors = default(IList), IList tactics = default(IList), IDictionary customDetails = default(IDictionary), IList entityMappings = default(IList), AlertDetailsOverride alertDetailsOverride = default(AlertDetailsOverride), EventGroupingSettings eventGroupingSettings = default(EventGroupingSettings)) - : base(id, name, type, systemData) + /// The tactics of the alert rule + /// template + public ScheduledAlertRuleTemplate(string id = default(string), string name = default(string), string type = default(string), int? alertRulesCreatedByTemplateCount = default(int?), System.DateTime? createdDateUTC = 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)) + : base(id, name, type) { AlertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; - LastUpdatedDateUTC = lastUpdatedDateUTC; CreatedDateUTC = createdDateUTC; Description = description; DisplayName = displayName; RequiredDataConnectors = requiredDataConnectors; Status = status; Query = query; - Severity = severity; - Tactics = tactics; - Version = version; - CustomDetails = customDetails; - EntityMappings = entityMappings; - AlertDetailsOverride = alertDetailsOverride; QueryFrequency = queryFrequency; QueryPeriod = queryPeriod; + Severity = severity; TriggerOperator = triggerOperator; TriggerThreshold = triggerThreshold; - EventGroupingSettings = eventGroupingSettings; + Tactics = tactics; CustomInit(); } @@ -118,13 +95,7 @@ public ScheduledAlertRuleTemplate() /// template /// [JsonProperty(PropertyName = "properties.alertRulesCreatedByTemplateCount")] - public int AlertRulesCreatedByTemplateCount { get; set; } - - /// - /// Gets the last time that this alert rule template has been updated. - /// - [JsonProperty(PropertyName = "properties.lastUpdatedDateUTC")] - public System.DateTime? LastUpdatedDateUTC { get; private set; } + public int? AlertRulesCreatedByTemplateCount { get; set; } /// /// Gets the time that this alert rule template has been added. @@ -145,7 +116,7 @@ public ScheduledAlertRuleTemplate() public string DisplayName { get; set; } /// - /// Gets or sets the required data sources for this template + /// Gets or sets the required data connectors for this template /// [JsonProperty(PropertyName = "properties.requiredDataConnectors")] public IList RequiredDataConnectors { get; set; } @@ -163,59 +134,26 @@ public ScheduledAlertRuleTemplate() [JsonProperty(PropertyName = "properties.query")] public string Query { get; set; } - /// - /// Gets or sets the severity for alerts created by this alert rule. - /// Possible values include: 'High', 'Medium', 'Low', 'Informational' - /// - [JsonProperty(PropertyName = "properties.severity")] - public string Severity { get; set; } - - /// - /// Gets or sets the tactics of the alert rule - /// - [JsonProperty(PropertyName = "properties.tactics")] - public IList Tactics { get; set; } - - /// - /// Gets or sets the version of this template - in format - /// &lt;a.b.c&gt;, where all are numbers. For example - /// &lt;1.0.2&gt;. - /// - [JsonProperty(PropertyName = "properties.version")] - public string Version { get; set; } - - /// - /// Gets or sets dictionary of string key-value pairs of columns to be - /// attached to the alert - /// - [JsonProperty(PropertyName = "properties.customDetails")] - public IDictionary CustomDetails { get; set; } - - /// - /// Gets or sets array of the entity mappings of the alert rule - /// - [JsonProperty(PropertyName = "properties.entityMappings")] - public IList EntityMappings { get; set; } - - /// - /// Gets or sets the alert details override settings - /// - [JsonProperty(PropertyName = "properties.alertDetailsOverride")] - public AlertDetailsOverride AlertDetailsOverride { get; set; } - /// /// Gets or sets the frequency (in ISO 8601 duration format) for this /// alert rule to run. /// [JsonProperty(PropertyName = "properties.queryFrequency")] - public System.TimeSpan QueryFrequency { get; set; } + public System.TimeSpan? QueryFrequency { get; set; } /// /// Gets or sets the period (in ISO 8601 duration format) that this /// alert rule looks at. /// [JsonProperty(PropertyName = "properties.queryPeriod")] - public System.TimeSpan QueryPeriod { get; set; } + public System.TimeSpan? QueryPeriod { get; set; } + + /// + /// Gets or sets the severity for alerts created by this alert rule. + /// Possible values include: 'High', 'Medium', 'Low', 'Informational' + /// + [JsonProperty(PropertyName = "properties.severity")] + public string Severity { get; set; } /// /// Gets or sets the operation against the threshold that triggers @@ -223,52 +161,19 @@ public ScheduledAlertRuleTemplate() /// 'Equal', 'NotEqual' /// [JsonProperty(PropertyName = "properties.triggerOperator")] - public TriggerOperator TriggerOperator { get; set; } + public TriggerOperator? TriggerOperator { get; set; } /// /// Gets or sets the threshold triggers this alert rule. /// [JsonProperty(PropertyName = "properties.triggerThreshold")] - public int TriggerThreshold { get; set; } + public int? TriggerThreshold { get; set; } /// - /// Gets or sets the event grouping settings. + /// Gets or sets the tactics of the alert rule template /// - [JsonProperty(PropertyName = "properties.eventGroupingSettings")] - public EventGroupingSettings EventGroupingSettings { get; set; } + [JsonProperty(PropertyName = "properties.tactics")] + public IList Tactics { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Description == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Description"); - } - if (DisplayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); - } - if (Status == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Status"); - } - if (Query == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Query"); - } - if (Severity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Severity"); - } - if (Version == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Version"); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityAlert.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityAlert.cs deleted file mode 100644 index b739518403f8a..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityAlert.cs +++ /dev/null @@ -1,320 +0,0 @@ -// -// 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 security alert entity. - /// - [Rest.Serialization.JsonTransformation] - public partial class SecurityAlert : Entity - { - /// - /// Initializes a new instance of the SecurityAlert class. - /// - public SecurityAlert() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SecurityAlert 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 display name of the - /// alert. - /// The type name of the alert. - /// Display name of the main entity - /// being reported on. - /// The confidence level of this alert. - /// Possible values include: 'Unknown', 'Low', 'High' - /// The confidence reasons - /// The confidence score of the - /// alert. - /// The confidence score - /// calculation status, i.e. indicating if score calculation is pending - /// for this alert, not applicable or final. Possible values include: - /// 'NotApplicable', 'InProcess', 'NotFinal', 'Final' - /// Alert description. - /// The impact end time of the alert (the time - /// of the last event contributing to the alert). - /// Holds the alert intent stage(s) mapping for - /// this alert. Possible values include: 'Unknown', 'Probing', - /// 'Exploitation', 'Persistence', 'PrivilegeEscalation', - /// 'DefenseEvasion', 'CredentialAccess', 'Discovery', - /// 'LateralMovement', 'Execution', 'Collection', 'Exfiltration', - /// 'CommandAndControl', 'Impact' - /// The identifier of the alert inside - /// the product which generated the alert. - /// The time the alert was made - /// available for consumption. - /// The name of a component inside - /// the product which generated the alert. - /// The name of the product which published - /// this alert. - /// The version of the product generating - /// the alert. - /// Manual action items to take to - /// remediate the alert. - /// The severity of the alert. Possible values - /// include: 'High', 'Medium', 'Low', 'Informational' - /// The impact start time of the alert (the - /// time of the first event contributing to the alert). - /// The lifecycle status of the alert. Possible - /// values include: 'Unknown', 'New', 'Resolved', 'Dismissed', - /// 'InProgress' - /// Holds the product identifier of the - /// alert for the product. - /// The tactics of the alert - /// The time the alert was - /// generated. - /// The name of the vendor that raise the - /// alert. - /// The uri link of the alert. - /// The list of resource identifiers - /// of the alert. - public SecurityAlert(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 alertDisplayName = default(string), string alertType = default(string), string compromisedEntity = default(string), string confidenceLevel = default(string), IList confidenceReasons = default(IList), double? confidenceScore = default(double?), string confidenceScoreStatus = default(string), string description = default(string), System.DateTime? endTimeUtc = default(System.DateTime?), string intent = default(string), string providerAlertId = default(string), System.DateTime? processingEndTime = default(System.DateTime?), string productComponentName = default(string), string productName = default(string), string productVersion = default(string), IList remediationSteps = default(IList), string severity = default(string), System.DateTime? startTimeUtc = default(System.DateTime?), string status = default(string), string systemAlertId = default(string), IList tactics = default(IList), System.DateTime? timeGenerated = default(System.DateTime?), string vendorName = default(string), string alertLink = default(string), IList resourceIdentifiers = default(IList)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - AlertDisplayName = alertDisplayName; - AlertType = alertType; - CompromisedEntity = compromisedEntity; - ConfidenceLevel = confidenceLevel; - ConfidenceReasons = confidenceReasons; - ConfidenceScore = confidenceScore; - ConfidenceScoreStatus = confidenceScoreStatus; - Description = description; - EndTimeUtc = endTimeUtc; - Intent = intent; - ProviderAlertId = providerAlertId; - ProcessingEndTime = processingEndTime; - ProductComponentName = productComponentName; - ProductName = productName; - ProductVersion = productVersion; - RemediationSteps = remediationSteps; - Severity = severity; - StartTimeUtc = startTimeUtc; - Status = status; - SystemAlertId = systemAlertId; - Tactics = tactics; - TimeGenerated = timeGenerated; - VendorName = vendorName; - AlertLink = alertLink; - ResourceIdentifiers = resourceIdentifiers; - 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 display name of the alert. - /// - [JsonProperty(PropertyName = "properties.alertDisplayName")] - public string AlertDisplayName { get; private set; } - - /// - /// Gets the type name of the alert. - /// - [JsonProperty(PropertyName = "properties.alertType")] - public string AlertType { get; private set; } - - /// - /// Gets display name of the main entity being reported on. - /// - [JsonProperty(PropertyName = "properties.compromisedEntity")] - public string CompromisedEntity { get; private set; } - - /// - /// Gets the confidence level of this alert. Possible values include: - /// 'Unknown', 'Low', 'High' - /// - [JsonProperty(PropertyName = "properties.confidenceLevel")] - public string ConfidenceLevel { get; private set; } - - /// - /// Gets the confidence reasons - /// - [JsonProperty(PropertyName = "properties.confidenceReasons")] - public IList ConfidenceReasons { get; private set; } - - /// - /// Gets the confidence score of the alert. - /// - [JsonProperty(PropertyName = "properties.confidenceScore")] - public double? ConfidenceScore { get; private set; } - - /// - /// Gets the confidence score calculation status, i.e. indicating if - /// score calculation is pending for this alert, not applicable or - /// final. Possible values include: 'NotApplicable', 'InProcess', - /// 'NotFinal', 'Final' - /// - [JsonProperty(PropertyName = "properties.confidenceScoreStatus")] - public string ConfidenceScoreStatus { get; private set; } - - /// - /// Gets alert description. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } - - /// - /// Gets the impact end time of the alert (the time of the last event - /// contributing to the alert). - /// - [JsonProperty(PropertyName = "properties.endTimeUtc")] - public System.DateTime? EndTimeUtc { get; private set; } - - /// - /// Gets holds the alert intent stage(s) mapping for this alert. - /// Possible values include: 'Unknown', 'Probing', 'Exploitation', - /// 'Persistence', 'PrivilegeEscalation', 'DefenseEvasion', - /// 'CredentialAccess', 'Discovery', 'LateralMovement', 'Execution', - /// 'Collection', 'Exfiltration', 'CommandAndControl', 'Impact' - /// - [JsonProperty(PropertyName = "properties.intent")] - public string Intent { get; private set; } - - /// - /// Gets the identifier of the alert inside the product which generated - /// the alert. - /// - [JsonProperty(PropertyName = "properties.providerAlertId")] - public string ProviderAlertId { get; private set; } - - /// - /// Gets the time the alert was made available for consumption. - /// - [JsonProperty(PropertyName = "properties.processingEndTime")] - public System.DateTime? ProcessingEndTime { get; private set; } - - /// - /// Gets the name of a component inside the product which generated the - /// alert. - /// - [JsonProperty(PropertyName = "properties.productComponentName")] - public string ProductComponentName { get; private set; } - - /// - /// Gets the name of the product which published this alert. - /// - [JsonProperty(PropertyName = "properties.productName")] - public string ProductName { get; private set; } - - /// - /// Gets the version of the product generating the alert. - /// - [JsonProperty(PropertyName = "properties.productVersion")] - public string ProductVersion { get; private set; } - - /// - /// Gets manual action items to take to remediate the alert. - /// - [JsonProperty(PropertyName = "properties.remediationSteps")] - public IList RemediationSteps { get; private set; } - - /// - /// Gets or sets the severity of the alert. Possible values include: - /// 'High', 'Medium', 'Low', 'Informational' - /// - [JsonProperty(PropertyName = "properties.severity")] - public string Severity { get; set; } - - /// - /// Gets the impact start time of the alert (the time of the first - /// event contributing to the alert). - /// - [JsonProperty(PropertyName = "properties.startTimeUtc")] - public System.DateTime? StartTimeUtc { get; private set; } - - /// - /// Gets the lifecycle status of the alert. Possible values include: - /// 'Unknown', 'New', 'Resolved', 'Dismissed', 'InProgress' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; private set; } - - /// - /// Gets holds the product identifier of the alert for the product. - /// - [JsonProperty(PropertyName = "properties.systemAlertId")] - public string SystemAlertId { get; private set; } - - /// - /// Gets the tactics of the alert - /// - [JsonProperty(PropertyName = "properties.tactics")] - public IList Tactics { get; private set; } - - /// - /// Gets the time the alert was generated. - /// - [JsonProperty(PropertyName = "properties.timeGenerated")] - public System.DateTime? TimeGenerated { get; private set; } - - /// - /// Gets the name of the vendor that raise the alert. - /// - [JsonProperty(PropertyName = "properties.vendorName")] - public string VendorName { get; private set; } - - /// - /// Gets the uri link of the alert. - /// - [JsonProperty(PropertyName = "properties.alertLink")] - public string AlertLink { get; private set; } - - /// - /// Gets the list of resource identifiers of the alert. - /// - [JsonProperty(PropertyName = "properties.resourceIdentifiers")] - public IList ResourceIdentifiers { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityAlertPropertiesConfidenceReasonsItem.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityAlertPropertiesConfidenceReasonsItem.cs deleted file mode 100644 index 8abc0caf73252..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityAlertPropertiesConfidenceReasonsItem.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// 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; - - /// - /// confidence reason item - /// - public partial class SecurityAlertPropertiesConfidenceReasonsItem - { - /// - /// Initializes a new instance of the - /// SecurityAlertPropertiesConfidenceReasonsItem class. - /// - public SecurityAlertPropertiesConfidenceReasonsItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// SecurityAlertPropertiesConfidenceReasonsItem class. - /// - /// The reason's description - /// The type (category) of the reason - public SecurityAlertPropertiesConfidenceReasonsItem(string reason = default(string), string reasonType = default(string)) - { - Reason = reason; - ReasonType = reasonType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the reason's description - /// - [JsonProperty(PropertyName = "reason")] - public string Reason { get; private set; } - - /// - /// Gets the type (category) of the reason - /// - [JsonProperty(PropertyName = "reasonType")] - public string ReasonType { get; private 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 deleted file mode 100644 index 76eecbbfbd76a..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityAlertTimelineItem.cs +++ /dev/null @@ -1,144 +0,0 @@ -// -// 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; - - /// - /// Represents security alert timeline item. - /// - [Newtonsoft.Json.JsonObject("SecurityAlert")] - public partial class SecurityAlertTimelineItem : EntityTimelineItem - { - /// - /// Initializes a new instance of the SecurityAlertTimelineItem class. - /// - public SecurityAlertTimelineItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SecurityAlertTimelineItem class. - /// - /// The alert azure resource id. - /// The alert name. - /// The alert severity. Possible values include: - /// 'High', 'Medium', 'Low', 'Informational' - /// The alert end time. - /// The alert start time. - /// The alert generated time. - /// 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)) - { - AzureResourceId = azureResourceId; - ProductName = productName; - Description = description; - DisplayName = displayName; - Severity = severity; - EndTimeUtc = endTimeUtc; - StartTimeUtc = startTimeUtc; - TimeGenerated = timeGenerated; - AlertType = alertType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the alert azure resource id. - /// - [JsonProperty(PropertyName = "azureResourceId")] - public string AzureResourceId { get; set; } - - /// - /// Gets or sets the alert product name. - /// - [JsonProperty(PropertyName = "productName")] - public string ProductName { get; set; } - - /// - /// Gets or sets the alert description. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// Gets or sets the alert name. - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the alert severity. Possible values include: 'High', - /// 'Medium', 'Low', 'Informational' - /// - [JsonProperty(PropertyName = "severity")] - public string Severity { get; set; } - - /// - /// Gets or sets the alert end time. - /// - [JsonProperty(PropertyName = "endTimeUtc")] - public System.DateTime EndTimeUtc { get; set; } - - /// - /// Gets or sets the alert start time. - /// - [JsonProperty(PropertyName = "startTimeUtc")] - public System.DateTime StartTimeUtc { get; set; } - - /// - /// Gets or sets the alert generated time. - /// - [JsonProperty(PropertyName = "timeGenerated")] - public System.DateTime TimeGenerated { get; set; } - - /// - /// Gets or sets the name of the alert type. - /// - [JsonProperty(PropertyName = "alertType")] - public string AlertType { 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"); - } - if (Severity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Severity"); - } - if (AlertType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AlertType"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityGroupEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityGroupEntity.cs deleted file mode 100644 index 3bf63df902af4..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SecurityGroupEntity.cs +++ /dev/null @@ -1,110 +0,0 @@ -// -// 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 security group entity. - /// - [Newtonsoft.Json.JsonObject("SecurityGroup")] - [Rest.Serialization.JsonTransformation] - public partial class SecurityGroupEntity : Entity - { - /// - /// Initializes a new instance of the SecurityGroupEntity class. - /// - public SecurityGroupEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SecurityGroupEntity 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 group distinguished - /// name - /// A single-value attribute that is the - /// unique identifier for the object, assigned by active - /// directory. - /// The SID attribute is a single-value attribute - /// that specifies the security identifier (SID) of the group - public SecurityGroupEntity(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 distinguishedName = default(string), System.Guid? objectGuid = default(System.Guid?), string sid = default(string)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - DistinguishedName = distinguishedName; - ObjectGuid = objectGuid; - Sid = sid; - 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 group distinguished name - /// - [JsonProperty(PropertyName = "properties.distinguishedName")] - public string DistinguishedName { get; private set; } - - /// - /// Gets a single-value attribute that is the unique identifier for the - /// object, assigned by active directory. - /// - [JsonProperty(PropertyName = "properties.objectGuid")] - public System.Guid? ObjectGuid { get; private set; } - - /// - /// Gets the SID attribute is a single-value attribute that specifies - /// the security identifier (SID) of the group - /// - [JsonProperty(PropertyName = "properties.sid")] - public string Sid { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SentinelOnboardingState.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SentinelOnboardingState.cs deleted file mode 100644 index fb38115ef69d0..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SentinelOnboardingState.cs +++ /dev/null @@ -1,65 +0,0 @@ -// -// 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.Linq; - - /// - /// Sentinel onboarding state - /// - [Rest.Serialization.JsonTransformation] - public partial class SentinelOnboardingState : ResourceWithEtag - { - /// - /// Initializes a new instance of the SentinelOnboardingState class. - /// - public SentinelOnboardingState() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SentinelOnboardingState 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 - /// Flag that indicates the status of - /// the CMK setting - public SentinelOnboardingState(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), bool? customerManagedKey = default(bool?)) - : base(id, name, type, systemData, etag) - { - CustomerManagedKey = customerManagedKey; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets flag that indicates the status of the CMK setting - /// - [JsonProperty(PropertyName = "properties.customerManagedKey")] - public bool? CustomerManagedKey { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SentinelOnboardingStatesList.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SentinelOnboardingStatesList.cs deleted file mode 100644 index 57a9e733d13c7..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SentinelOnboardingStatesList.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// 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; - - /// - /// List of the Sentinel onboarding states - /// - public partial class SentinelOnboardingStatesList - { - /// - /// Initializes a new instance of the SentinelOnboardingStatesList - /// class. - /// - public SentinelOnboardingStatesList() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SentinelOnboardingStatesList - /// class. - /// - /// Array of Sentinel onboarding states - public SentinelOnboardingStatesList(IList value) - { - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets array of Sentinel onboarding states - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Value == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Value"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectivityType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SettingKind.cs similarity index 70% rename from sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectivityType.cs rename to sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SettingKind.cs index 8b5d84f0479fa..663b0f801f7f0 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ConnectivityType.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SettingKind.cs @@ -12,10 +12,11 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { /// - /// Defines values for ConnectivityType. + /// Defines values for SettingKind. /// - public static class ConnectivityType + public static class SettingKind { - public const string IsConnectedQuery = "IsConnectedQuery"; + public const string UebaSettings = "UebaSettings"; + public const string ToggleSettings = "ToggleSettings"; } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SettingList.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SettingList.cs deleted file mode 100644 index 4823ae5fbfa8f..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SettingList.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// 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; - - /// - /// List of all the settings. - /// - public partial class SettingList - { - /// - /// Initializes a new instance of the SettingList class. - /// - public SettingList() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SettingList class. - /// - /// Array of settings. - public SettingList(IList value) - { - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets array of settings. - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Value == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Value"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SettingType.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SettingType.cs deleted file mode 100644 index c9a26f01175fb..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SettingType.cs +++ /dev/null @@ -1,23 +0,0 @@ -// -// 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 SettingType. - /// - public static class SettingType - { - public const string CopyableLabel = "CopyableLabel"; - public const string InstructionStepsGroup = "InstructionStepsGroup"; - public const string InfoMessage = "InfoMessage"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Settings.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Settings.cs index f7ec6d075a19c..8c278ec9b2f50 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Settings.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Settings.cs @@ -13,7 +13,7 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models using System.Linq; /// - /// The Setting. + /// The Settings. /// public partial class Settings : ResourceWithEtag { @@ -28,17 +28,12 @@ public Settings() /// /// Initializes a new instance of the Settings 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. + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// Etag of the azure resource - public Settings(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) + public Settings(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + : base(id, name, type, etag) { CustomInit(); } 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 deleted file mode 100644 index 9a17eef0feacc..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Sku.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// 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 pricing tier of the solution - /// - public partial class Sku - { - /// - /// Initializes a new instance of the Sku class. - /// - public Sku() - { - CustomInit(); - } - - /// - /// 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?)) - { - Name = name; - CapacityReservationLevel = capacityReservationLevel; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the kind of the tier. Possible values include: - /// 'PerGB', 'CapacityReservation' - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the amount of reservation level - /// - [JsonProperty(PropertyName = "capacityReservationLevel")] - public int? CapacityReservationLevel { 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/SkuKind.cs deleted file mode 100644 index bba13758ad265..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SkuKind.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -// 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 SkuKind. - /// - public static class SkuKind - { - public const string PerGB = "PerGB"; - public const string CapacityReservation = "CapacityReservation"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Source.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Source.cs deleted file mode 100644 index 12261c5c8fa68..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Source.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -// 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 Source. - /// - public static class Source - { - public const string Localfile = "Local file"; - public const string Remotestorage = "Remote storage"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SourceControl.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SourceControl.cs deleted file mode 100644 index cff123c279113..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SourceControl.cs +++ /dev/null @@ -1,137 +0,0 @@ -// -// 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 SourceControl in Azure Security Insights. - /// - [Rest.Serialization.JsonTransformation] - public partial class SourceControl : ResourceWithEtag - { - /// - /// Initializes a new instance of the SourceControl class. - /// - public SourceControl() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SourceControl class. - /// - /// The display name of the source - /// control - /// The repository type of the source control. - /// Possible values include: 'Github', 'DevOps' - /// Array of source control content - /// types. - /// Repository metadata. - /// 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 id (a Guid) of the source - /// control - /// A description of the source - /// control - public SourceControl(string displayName, string repoType, IList contentTypes, Repository repository, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string sourceControlId = default(string), string description = default(string)) - : base(id, name, type, systemData, etag) - { - SourceControlId = sourceControlId; - DisplayName = displayName; - Description = description; - RepoType = repoType; - ContentTypes = contentTypes; - Repository = repository; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the id (a Guid) of the source control - /// - [JsonProperty(PropertyName = "properties.id")] - public string SourceControlId { get; set; } - - /// - /// Gets or sets the display name of the source control - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets a description of the source control - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the repository type of the source control. Possible - /// values include: 'Github', 'DevOps' - /// - [JsonProperty(PropertyName = "properties.repoType")] - public string RepoType { get; set; } - - /// - /// Gets or sets array of source control content types. - /// - [JsonProperty(PropertyName = "properties.contentTypes")] - public IList ContentTypes { get; set; } - - /// - /// Gets or sets repository metadata. - /// - [JsonProperty(PropertyName = "properties.repository")] - public Repository Repository { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DisplayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); - } - if (RepoType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "RepoType"); - } - if (ContentTypes == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ContentTypes"); - } - if (Repository == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Repository"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SourceKind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SourceKind.cs deleted file mode 100644 index 17f8665ec8b06..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SourceKind.cs +++ /dev/null @@ -1,24 +0,0 @@ -// -// 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 SourceKind. - /// - public static class SourceKind - { - public const string LocalWorkspace = "LocalWorkspace"; - public const string Community = "Community"; - public const string Solution = "Solution"; - public const string SourceRepository = "SourceRepository"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CustomEntityQueryKind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/StatusInMcas.cs similarity index 72% rename from sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CustomEntityQueryKind.cs rename to sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/StatusInMcas.cs index 67fafc2169c41..397794960d901 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/CustomEntityQueryKind.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/StatusInMcas.cs @@ -12,10 +12,11 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { /// - /// Defines values for CustomEntityQueryKind. + /// Defines values for StatusInMcas. /// - public static class CustomEntityQueryKind + public static class StatusInMcas { - public const string Activity = "Activity"; + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SubmissionMailEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SubmissionMailEntity.cs deleted file mode 100644 index 429d1745cb61f..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SubmissionMailEntity.cs +++ /dev/null @@ -1,164 +0,0 @@ -// -// 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 submission mail entity. - /// - [Newtonsoft.Json.JsonObject("SubmissionMail")] - [Rest.Serialization.JsonTransformation] - public partial class SubmissionMailEntity : Entity - { - /// - /// Initializes a new instance of the SubmissionMailEntity class. - /// - public SubmissionMailEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SubmissionMailEntity 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 network message id of email to - /// which submission belongs - /// The submission id - /// The submitter - /// The submission date - /// The Time stamp when the message is received - /// (Mail) - /// The recipient of the mail - /// The sender of the mail - /// The sender's IP - /// The subject of submission mail - /// The submission type for the given - /// instance. This maps to Junk, Phish, Malware or NotJunk. - public SubmissionMailEntity(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary additionalData = default(IDictionary), string friendlyName = default(string), System.Guid? networkMessageId = default(System.Guid?), System.Guid? submissionId = default(System.Guid?), string submitter = default(string), System.DateTime? submissionDate = default(System.DateTime?), System.DateTime? timestamp = default(System.DateTime?), string recipient = default(string), string sender = default(string), string senderIp = default(string), string subject = default(string), string reportType = default(string)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - NetworkMessageId = networkMessageId; - SubmissionId = submissionId; - Submitter = submitter; - SubmissionDate = submissionDate; - Timestamp = timestamp; - Recipient = recipient; - Sender = sender; - SenderIp = senderIp; - Subject = subject; - ReportType = reportType; - 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 network message id of email to which submission belongs - /// - [JsonProperty(PropertyName = "properties.networkMessageId")] - public System.Guid? NetworkMessageId { get; private set; } - - /// - /// Gets the submission id - /// - [JsonProperty(PropertyName = "properties.submissionId")] - public System.Guid? SubmissionId { get; private set; } - - /// - /// Gets the submitter - /// - [JsonProperty(PropertyName = "properties.submitter")] - public string Submitter { get; private set; } - - /// - /// Gets the submission date - /// - [JsonProperty(PropertyName = "properties.submissionDate")] - public System.DateTime? SubmissionDate { get; private set; } - - /// - /// Gets the Time stamp when the message is received (Mail) - /// - [JsonProperty(PropertyName = "properties.timestamp")] - public System.DateTime? Timestamp { get; private set; } - - /// - /// Gets the recipient of the mail - /// - [JsonProperty(PropertyName = "properties.recipient")] - public string Recipient { get; private set; } - - /// - /// Gets the sender of the mail - /// - [JsonProperty(PropertyName = "properties.sender")] - public string Sender { get; private set; } - - /// - /// Gets the sender's IP - /// - [JsonProperty(PropertyName = "properties.senderIp")] - public string SenderIp { get; private set; } - - /// - /// Gets the subject of submission mail - /// - [JsonProperty(PropertyName = "properties.subject")] - public string Subject { get; private set; } - - /// - /// Gets the submission type for the given instance. This maps to Junk, - /// Phish, Malware or NotJunk. - /// - [JsonProperty(PropertyName = "properties.reportType")] - public string ReportType { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SupportTier.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SupportTier.cs deleted file mode 100644 index 4bdf9668124f7..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SupportTier.cs +++ /dev/null @@ -1,23 +0,0 @@ -// -// 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 SupportTier. - /// - public static class SupportTier - { - public const string Microsoft = "Microsoft"; - public const string Partner = "Partner"; - public const string Community = "Community"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SystemData.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SystemData.cs deleted file mode 100644 index fc614c190b311..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/SystemData.cs +++ /dev/null @@ -1,103 +0,0 @@ -// -// 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; - - /// - /// Metadata pertaining to creation and last modification of the resource. - /// - public partial class SystemData - { - /// - /// Initializes a new instance of the SystemData class. - /// - public SystemData() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SystemData class. - /// - /// The identity that created the - /// resource. - /// The type of identity that created the - /// resource. Possible values include: 'User', 'Application', - /// 'ManagedIdentity', 'Key' - /// The timestamp of resource creation - /// (UTC). - /// The identity that last modified the - /// resource. - /// The type of identity that last - /// modified the resource. Possible values include: 'User', - /// 'Application', 'ManagedIdentity', 'Key' - /// The timestamp of resource last - /// modification (UTC) - public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) - { - CreatedBy = createdBy; - CreatedByType = createdByType; - CreatedAt = createdAt; - LastModifiedBy = lastModifiedBy; - LastModifiedByType = lastModifiedByType; - LastModifiedAt = lastModifiedAt; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the identity that created the resource. - /// - [JsonProperty(PropertyName = "createdBy")] - public string CreatedBy { get; set; } - - /// - /// Gets or sets the type of identity that created the resource. - /// Possible values include: 'User', 'Application', 'ManagedIdentity', - /// 'Key' - /// - [JsonProperty(PropertyName = "createdByType")] - public string CreatedByType { get; set; } - - /// - /// Gets or sets the timestamp of resource creation (UTC). - /// - [JsonProperty(PropertyName = "createdAt")] - public System.DateTime? CreatedAt { get; set; } - - /// - /// Gets or sets the identity that last modified the resource. - /// - [JsonProperty(PropertyName = "lastModifiedBy")] - public string LastModifiedBy { get; set; } - - /// - /// Gets or sets the type of identity that last modified the resource. - /// Possible values include: 'User', 'Application', 'ManagedIdentity', - /// 'Key' - /// - [JsonProperty(PropertyName = "lastModifiedByType")] - public string LastModifiedByType { get; set; } - - /// - /// Gets or sets the timestamp of resource last modification (UTC) - /// - [JsonProperty(PropertyName = "lastModifiedAt")] - public System.DateTime? LastModifiedAt { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TICheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TICheckRequirements.cs deleted file mode 100644 index 1c791f26a4549..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TICheckRequirements.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// 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.Linq; - - /// - /// Threat Intelligence Platforms data connector check requirements - /// - [Newtonsoft.Json.JsonObject("ThreatIntelligence")] - [Rest.Serialization.JsonTransformation] - public partial class TICheckRequirements : DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the TICheckRequirements class. - /// - public TICheckRequirements() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TICheckRequirements class. - /// - /// The tenant id to connect to, and get the - /// data from. - public TICheckRequirements(string tenantId) - { - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TIDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TIDataConnector.cs index 57be1bbe19a90..caa1fc0f80a62 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TIDataConnector.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TIDataConnector.cs @@ -33,23 +33,18 @@ public TIDataConnector() /// /// Initializes a new instance of the TIDataConnector class. /// + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Etag of the azure resource /// The tenant id to connect to, and get the /// data from. - /// The available data types for the - /// connector. - /// 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 lookback period for the feed to /// be imported. - public TIDataConnector(string tenantId, TIDataConnectorDataTypes dataTypes, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), System.DateTime? tipLookbackPeriod = default(System.DateTime?)) - : base(id, name, type, systemData, etag) + /// The available data types for the + /// connector. + public TIDataConnector(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string tenantId = default(string), System.DateTime? tipLookbackPeriod = default(System.DateTime?), TIDataConnectorDataTypes dataTypes = default(TIDataConnectorDataTypes)) + : base(id, name, type, etag) { TenantId = tenantId; TipLookbackPeriod = tipLookbackPeriod; @@ -80,26 +75,5 @@ public TIDataConnector() [JsonProperty(PropertyName = "properties.dataTypes")] public TIDataConnectorDataTypes DataTypes { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - if (DataTypes == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataTypes"); - } - if (DataTypes != null) - { - DataTypes.Validate(); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TIDataConnectorDataTypes.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TIDataConnectorDataTypes.cs index 84fd0a33bd05b..92fdaf0c1d617 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TIDataConnectorDataTypes.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TIDataConnectorDataTypes.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -32,7 +31,7 @@ public TIDataConnectorDataTypes() /// /// Data type for indicators /// connection. - public TIDataConnectorDataTypes(TIDataConnectorDataTypesIndicators indicators) + public TIDataConnectorDataTypes(TIDataConnectorDataTypesIndicators indicators = default(TIDataConnectorDataTypesIndicators)) { Indicators = indicators; CustomInit(); @@ -49,22 +48,5 @@ public TIDataConnectorDataTypes(TIDataConnectorDataTypesIndicators indicators) [JsonProperty(PropertyName = "indicators")] public TIDataConnectorDataTypesIndicators Indicators { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Indicators == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Indicators"); - } - if (Indicators != null) - { - Indicators.Validate(); - } - } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TIDataConnectorDataTypesIndicators.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TIDataConnectorDataTypesIndicators.cs index 6fb216152973b..75d4809736719 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TIDataConnectorDataTypesIndicators.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TIDataConnectorDataTypesIndicators.cs @@ -33,7 +33,7 @@ public TIDataConnectorDataTypesIndicators() /// Describe whether this data type connection is /// enabled or not. Possible values include: 'Enabled', /// 'Disabled' - public TIDataConnectorDataTypesIndicators(string state) + public TIDataConnectorDataTypesIndicators(string state = default(string)) : base(state) { CustomInit(); @@ -44,15 +44,5 @@ public TIDataConnectorDataTypesIndicators(string state) /// 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/TeamInformation.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TeamInformation.cs deleted file mode 100644 index bbe85604b9f59..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TeamInformation.cs +++ /dev/null @@ -1,85 +0,0 @@ -// -// 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 team information - /// - public partial class TeamInformation - { - /// - /// Initializes a new instance of the TeamInformation class. - /// - public TeamInformation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TeamInformation class. - /// - /// Team ID - /// The primary channel URL of the - /// team - /// The time the team was - /// created - /// The name of the team - /// The description of the team - public TeamInformation(string teamId = default(string), string primaryChannelUrl = default(string), System.DateTime? teamCreationTimeUtc = default(System.DateTime?), string name = default(string), string description = default(string)) - { - TeamId = teamId; - PrimaryChannelUrl = primaryChannelUrl; - TeamCreationTimeUtc = teamCreationTimeUtc; - Name = name; - Description = description; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets team ID - /// - [JsonProperty(PropertyName = "teamId")] - public string TeamId { get; private set; } - - /// - /// Gets the primary channel URL of the team - /// - [JsonProperty(PropertyName = "primaryChannelUrl")] - public string PrimaryChannelUrl { get; private set; } - - /// - /// Gets the time the team was created - /// - [JsonProperty(PropertyName = "teamCreationTimeUtc")] - public System.DateTime? TeamCreationTimeUtc { get; private set; } - - /// - /// Gets the name of the team - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets the description of the team - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TeamProperties.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TeamProperties.cs deleted file mode 100644 index 1aa427d3cde29..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TeamProperties.cs +++ /dev/null @@ -1,93 +0,0 @@ -// -// 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; - - /// - /// Describes team properties - /// - public partial class TeamProperties - { - /// - /// Initializes a new instance of the TeamProperties class. - /// - public TeamProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TeamProperties class. - /// - /// The name of the team - /// The description of the team - /// List of member IDs to add to the - /// team - /// List of group IDs to add their members to - /// the team - public TeamProperties(string teamName, string teamDescription = default(string), IList memberIds = default(IList), IList groupIds = default(IList)) - { - TeamName = teamName; - TeamDescription = teamDescription; - MemberIds = memberIds; - GroupIds = groupIds; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the team - /// - [JsonProperty(PropertyName = "teamName")] - public string TeamName { get; set; } - - /// - /// Gets or sets the description of the team - /// - [JsonProperty(PropertyName = "teamDescription")] - public string TeamDescription { get; set; } - - /// - /// Gets or sets list of member IDs to add to the team - /// - [JsonProperty(PropertyName = "memberIds")] - public IList MemberIds { get; set; } - - /// - /// Gets or sets list of group IDs to add their members to the team - /// - [JsonProperty(PropertyName = "groupIds")] - public IList GroupIds { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TeamName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TeamName"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceAlertRule.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceAlertRule.cs deleted file mode 100644 index c78df85390b62..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceAlertRule.cs +++ /dev/null @@ -1,140 +0,0 @@ -// -// 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 Threat Intelligence alert rule. - /// - [Newtonsoft.Json.JsonObject("ThreatIntelligence")] - [Rest.Serialization.JsonTransformation] - public partial class ThreatIntelligenceAlertRule : AlertRule - { - /// - /// Initializes a new instance of the ThreatIntelligenceAlertRule - /// class. - /// - public ThreatIntelligenceAlertRule() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ThreatIntelligenceAlertRule - /// class. - /// - /// The Name of the alert rule - /// template used to create this rule. - /// Determines whether this alert rule is enabled - /// or disabled. - /// 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 alert - /// rule. - /// The display name for alerts created by - /// this alert rule. - /// The last time that this alert has - /// been modified. - /// The severity for alerts created by this - /// alert rule. Possible values include: 'High', 'Medium', 'Low', - /// 'Informational' - /// The tactics of the alert rule - public ThreatIntelligenceAlertRule(string alertRuleTemplateName, bool enabled, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string description = default(string), string displayName = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?), string severity = default(string), IList tactics = default(IList)) - : base(id, name, type, systemData, etag) - { - AlertRuleTemplateName = alertRuleTemplateName; - Description = description; - DisplayName = displayName; - Enabled = enabled; - LastModifiedUtc = lastModifiedUtc; - Severity = severity; - Tactics = tactics; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the Name of the alert rule template used to create - /// this rule. - /// - [JsonProperty(PropertyName = "properties.alertRuleTemplateName")] - public string AlertRuleTemplateName { get; set; } - - /// - /// Gets the description of the alert rule. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } - - /// - /// Gets the display name for alerts created by this alert rule. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; private set; } - - /// - /// Gets or sets determines whether this alert rule is enabled or - /// disabled. - /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool Enabled { get; set; } - - /// - /// Gets the last time that this alert has been modified. - /// - [JsonProperty(PropertyName = "properties.lastModifiedUtc")] - public System.DateTime? LastModifiedUtc { get; private set; } - - /// - /// Gets the severity for alerts created by this alert rule. Possible - /// values include: 'High', 'Medium', 'Low', 'Informational' - /// - [JsonProperty(PropertyName = "properties.severity")] - public string Severity { get; private set; } - - /// - /// Gets the tactics of the alert rule - /// - [JsonProperty(PropertyName = "properties.tactics")] - public IList Tactics { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AlertRuleTemplateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AlertRuleTemplateName"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceAlertRuleTemplate.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceAlertRuleTemplate.cs deleted file mode 100644 index 1f12d65eec38b..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceAlertRuleTemplate.cs +++ /dev/null @@ -1,158 +0,0 @@ -// -// 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 Threat Intelligence alert rule template. - /// - [Newtonsoft.Json.JsonObject("ThreatIntelligence")] - [Rest.Serialization.JsonTransformation] - public partial class ThreatIntelligenceAlertRuleTemplate : AlertRuleTemplate - { - /// - /// Initializes a new instance of the - /// ThreatIntelligenceAlertRuleTemplate class. - /// - public ThreatIntelligenceAlertRuleTemplate() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ThreatIntelligenceAlertRuleTemplate class. - /// - /// The severity for alerts created by this - /// alert rule. Possible values include: 'High', 'Medium', 'Low', - /// 'Informational' - /// 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 number of alert - /// rules that were created by this template - /// The last time that this alert rule - /// template has been updated. - /// The time that this alert rule template - /// has been added. - /// The description of the alert rule - /// template. - /// The display name for alert rule - /// template. - /// The required data sources for - /// this template - /// The alert rule template status. Possible - /// values include: 'Installed', 'Available', 'NotAvailable' - /// The tactics of the alert rule - /// template - public ThreatIntelligenceAlertRuleTemplate(string severity, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), int? alertRulesCreatedByTemplateCount = default(int?), System.DateTime? lastUpdatedDateUTC = default(System.DateTime?), System.DateTime? createdDateUTC = default(System.DateTime?), string description = default(string), string displayName = default(string), IList requiredDataConnectors = default(IList), string status = default(string), IList tactics = default(IList)) - : base(id, name, type, systemData) - { - AlertRulesCreatedByTemplateCount = alertRulesCreatedByTemplateCount; - LastUpdatedDateUTC = lastUpdatedDateUTC; - CreatedDateUTC = createdDateUTC; - Description = description; - DisplayName = displayName; - RequiredDataConnectors = requiredDataConnectors; - Status = status; - Severity = severity; - Tactics = tactics; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the number of alert rules that were created by this - /// template - /// - [JsonProperty(PropertyName = "properties.alertRulesCreatedByTemplateCount")] - public int? AlertRulesCreatedByTemplateCount { get; set; } - - /// - /// Gets the last time that this alert rule template has been updated. - /// - [JsonProperty(PropertyName = "properties.lastUpdatedDateUTC")] - public System.DateTime? LastUpdatedDateUTC { get; private set; } - - /// - /// Gets the time that this alert rule template has been added. - /// - [JsonProperty(PropertyName = "properties.createdDateUTC")] - public System.DateTime? CreatedDateUTC { get; private set; } - - /// - /// Gets or sets the description of the alert rule template. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the display name for alert rule template. - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the required data sources for this template - /// - [JsonProperty(PropertyName = "properties.requiredDataConnectors")] - public IList RequiredDataConnectors { get; set; } - - /// - /// Gets or sets the alert rule template status. Possible values - /// include: 'Installed', 'Available', 'NotAvailable' - /// - [JsonProperty(PropertyName = "properties.status")] - public string Status { get; set; } - - /// - /// Gets or sets the severity for alerts created by this alert rule. - /// Possible values include: 'High', 'Medium', 'Low', 'Informational' - /// - [JsonProperty(PropertyName = "properties.severity")] - public string Severity { get; set; } - - /// - /// Gets or sets the tactics of the alert rule template - /// - [JsonProperty(PropertyName = "properties.tactics")] - public IList Tactics { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Severity == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Severity"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceAppendTags.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceAppendTags.cs deleted file mode 100644 index 2b45b4e8ac260..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceAppendTags.cs +++ /dev/null @@ -1,56 +0,0 @@ -// -// 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; - - /// - /// Array of tags to be appended to the threat intelligence indicator. - /// - public partial class ThreatIntelligenceAppendTags - { - /// - /// Initializes a new instance of the ThreatIntelligenceAppendTags - /// class. - /// - public ThreatIntelligenceAppendTags() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ThreatIntelligenceAppendTags - /// class. - /// - /// List of tags to be - /// appended. - public ThreatIntelligenceAppendTags(IList threatIntelligenceTags = default(IList)) - { - ThreatIntelligenceTags = threatIntelligenceTags; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets list of tags to be appended. - /// - [JsonProperty(PropertyName = "threatIntelligenceTags")] - public IList ThreatIntelligenceTags { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceExternalReference.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceExternalReference.cs deleted file mode 100644 index e1386be79a9b8..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceExternalReference.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// 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 external reference - /// - public partial class ThreatIntelligenceExternalReference - { - /// - /// Initializes a new instance of the - /// ThreatIntelligenceExternalReference class. - /// - public ThreatIntelligenceExternalReference() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ThreatIntelligenceExternalReference class. - /// - /// External reference description - /// External reference ID - /// External reference source name - /// External reference URL - /// External reference hashes - public ThreatIntelligenceExternalReference(string description = default(string), string externalId = default(string), string sourceName = default(string), string url = default(string), IDictionary hashes = default(IDictionary)) - { - Description = description; - ExternalId = externalId; - SourceName = sourceName; - Url = url; - Hashes = hashes; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets external reference description - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// Gets or sets external reference ID - /// - [JsonProperty(PropertyName = "externalId")] - public string ExternalId { get; set; } - - /// - /// Gets or sets external reference source name - /// - [JsonProperty(PropertyName = "sourceName")] - public string SourceName { get; set; } - - /// - /// Gets or sets external reference URL - /// - [JsonProperty(PropertyName = "url")] - public string Url { get; set; } - - /// - /// Gets or sets external reference hashes - /// - [JsonProperty(PropertyName = "hashes")] - public IDictionary Hashes { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceFilteringCriteria.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceFilteringCriteria.cs deleted file mode 100644 index 9bf5d277fd86d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceFilteringCriteria.cs +++ /dev/null @@ -1,156 +0,0 @@ -// -// 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; - - /// - /// Filtering criteria for querying threat intelligence indicators. - /// - public partial class ThreatIntelligenceFilteringCriteria - { - /// - /// Initializes a new instance of the - /// ThreatIntelligenceFilteringCriteria class. - /// - public ThreatIntelligenceFilteringCriteria() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ThreatIntelligenceFilteringCriteria class. - /// - /// Page size - /// Minimum confidence. - /// Maximum confidence. - /// Start time for ValidUntil - /// filter. - /// End time for ValidUntil filter. - /// Parameter to include/exclude disabled - /// indicators. - /// Columns to sort by and sorting order - /// Sources of threat intelligence - /// indicators - /// Pattern types - /// Threat types of threat intelligence - /// indicators - /// Ids of threat intelligence indicators - /// Keywords for searching threat intelligence - /// indicators - /// Skip token. - public ThreatIntelligenceFilteringCriteria(int? pageSize = default(int?), int? minConfidence = default(int?), int? maxConfidence = default(int?), string minValidUntil = default(string), string maxValidUntil = default(string), bool? includeDisabled = default(bool?), IList sortBy = default(IList), IList sources = default(IList), IList patternTypes = default(IList), IList threatTypes = default(IList), IList ids = default(IList), IList keywords = default(IList), string skipToken = default(string)) - { - PageSize = pageSize; - MinConfidence = minConfidence; - MaxConfidence = maxConfidence; - MinValidUntil = minValidUntil; - MaxValidUntil = maxValidUntil; - IncludeDisabled = includeDisabled; - SortBy = sortBy; - Sources = sources; - PatternTypes = patternTypes; - ThreatTypes = threatTypes; - Ids = ids; - Keywords = keywords; - SkipToken = skipToken; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets page size - /// - [JsonProperty(PropertyName = "pageSize")] - public int? PageSize { get; set; } - - /// - /// Gets or sets minimum confidence. - /// - [JsonProperty(PropertyName = "minConfidence")] - public int? MinConfidence { get; set; } - - /// - /// Gets or sets maximum confidence. - /// - [JsonProperty(PropertyName = "maxConfidence")] - public int? MaxConfidence { get; set; } - - /// - /// Gets or sets start time for ValidUntil filter. - /// - [JsonProperty(PropertyName = "minValidUntil")] - public string MinValidUntil { get; set; } - - /// - /// Gets or sets end time for ValidUntil filter. - /// - [JsonProperty(PropertyName = "maxValidUntil")] - public string MaxValidUntil { get; set; } - - /// - /// Gets or sets parameter to include/exclude disabled indicators. - /// - [JsonProperty(PropertyName = "includeDisabled")] - public bool? IncludeDisabled { get; set; } - - /// - /// Gets or sets columns to sort by and sorting order - /// - [JsonProperty(PropertyName = "sortBy")] - public IList SortBy { get; set; } - - /// - /// Gets or sets sources of threat intelligence indicators - /// - [JsonProperty(PropertyName = "sources")] - public IList Sources { get; set; } - - /// - /// Gets or sets pattern types - /// - [JsonProperty(PropertyName = "patternTypes")] - public IList PatternTypes { get; set; } - - /// - /// Gets or sets threat types of threat intelligence indicators - /// - [JsonProperty(PropertyName = "threatTypes")] - public IList ThreatTypes { get; set; } - - /// - /// Gets or sets ids of threat intelligence indicators - /// - [JsonProperty(PropertyName = "ids")] - public IList Ids { get; set; } - - /// - /// Gets or sets keywords for searching threat intelligence indicators - /// - [JsonProperty(PropertyName = "keywords")] - public IList Keywords { get; set; } - - /// - /// Gets or sets skip token. - /// - [JsonProperty(PropertyName = "skipToken")] - public string SkipToken { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceGranularMarkingModel.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceGranularMarkingModel.cs deleted file mode 100644 index 2d3c96bf489ed..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceGranularMarkingModel.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// 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 threat granular marking model entity - /// - public partial class ThreatIntelligenceGranularMarkingModel - { - /// - /// Initializes a new instance of the - /// ThreatIntelligenceGranularMarkingModel class. - /// - public ThreatIntelligenceGranularMarkingModel() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ThreatIntelligenceGranularMarkingModel class. - /// - /// Language granular marking model - /// marking reference granular marking - /// model - /// granular marking model selectors - public ThreatIntelligenceGranularMarkingModel(string language = default(string), int? markingRef = default(int?), IList selectors = default(IList)) - { - Language = language; - MarkingRef = markingRef; - Selectors = selectors; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets language granular marking model - /// - [JsonProperty(PropertyName = "language")] - public string Language { get; set; } - - /// - /// Gets or sets marking reference granular marking model - /// - [JsonProperty(PropertyName = "markingRef")] - public int? MarkingRef { get; set; } - - /// - /// Gets or sets granular marking model selectors - /// - [JsonProperty(PropertyName = "selectors")] - public IList Selectors { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceIndicatorModel.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceIndicatorModel.cs deleted file mode 100644 index 7e1bd7ed71817..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceIndicatorModel.cs +++ /dev/null @@ -1,312 +0,0 @@ -// -// 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; - - /// - /// Threat intelligence indicator entity. - /// - [Newtonsoft.Json.JsonObject("indicator")] - [Rest.Serialization.JsonTransformation] - public partial class ThreatIntelligenceIndicatorModel : ThreatIntelligenceInformation - { - /// - /// Initializes a new instance of the ThreatIntelligenceIndicatorModel - /// class. - /// - public ThreatIntelligenceIndicatorModel() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ThreatIntelligenceIndicatorModel - /// class. - /// - /// Etag of the azure resource - /// 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. - /// List of tags - /// Last updated time in UTC - /// Source of a threat intelligence entity - /// Display name of a threat intelligence - /// entity - /// Description of a threat intelligence - /// entity - /// Indicator types of threat intelligence - /// entities - /// Pattern of a threat intelligence - /// entity - /// Pattern type of a threat intelligence - /// entity - /// Pattern version of a threat - /// intelligence entity - /// Kill chain phases - /// Parsed patterns - /// External ID of threat intelligence - /// entity - /// Created by reference of threat - /// intelligence entity - /// Is threat intelligence entity - /// defanged - /// External last updated time - /// in UTC - /// External References - /// Granular Markings - /// Labels of threat intelligence entity - /// Is threat intelligence entity revoked - /// Confidence of threat intelligence - /// entity - /// Threat intelligence entity object - /// marking references - /// Language of threat intelligence - /// entity - /// Threat types - /// Valid from - /// Valid until - /// Created by - /// Modified by - /// Extensions map - public ThreatIntelligenceIndicatorModel(string etag = default(string), IDictionary additionalData = default(IDictionary), string friendlyName = default(string), IList threatIntelligenceTags = default(IList), string lastUpdatedTimeUtc = default(string), string source = default(string), string displayName = default(string), string description = default(string), IList indicatorTypes = default(IList), string pattern = default(string), string patternType = default(string), string patternVersion = default(string), IList killChainPhases = default(IList), IList parsedPattern = default(IList), string externalId = default(string), string createdByRef = default(string), bool? defanged = default(bool?), string externalLastUpdatedTimeUtc = default(string), IList externalReferences = default(IList), IList granularMarkings = default(IList), IList labels = default(IList), bool? revoked = default(bool?), int? confidence = default(int?), IList objectMarkingRefs = default(IList), string language = default(string), IList threatTypes = default(IList), string validFrom = default(string), string validUntil = default(string), string created = default(string), string modified = default(string), IDictionary extensions = default(IDictionary)) - : base(etag) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - ThreatIntelligenceTags = threatIntelligenceTags; - LastUpdatedTimeUtc = lastUpdatedTimeUtc; - Source = source; - DisplayName = displayName; - Description = description; - IndicatorTypes = indicatorTypes; - Pattern = pattern; - PatternType = patternType; - PatternVersion = patternVersion; - KillChainPhases = killChainPhases; - ParsedPattern = parsedPattern; - ExternalId = externalId; - CreatedByRef = createdByRef; - Defanged = defanged; - ExternalLastUpdatedTimeUtc = externalLastUpdatedTimeUtc; - ExternalReferences = externalReferences; - GranularMarkings = granularMarkings; - Labels = labels; - Revoked = revoked; - Confidence = confidence; - ObjectMarkingRefs = objectMarkingRefs; - Language = language; - ThreatTypes = threatTypes; - ValidFrom = validFrom; - ValidUntil = validUntil; - Created = created; - Modified = modified; - Extensions = extensions; - 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 or sets list of tags - /// - [JsonProperty(PropertyName = "properties.threatIntelligenceTags")] - public IList ThreatIntelligenceTags { get; set; } - - /// - /// Gets or sets last updated time in UTC - /// - [JsonProperty(PropertyName = "properties.lastUpdatedTimeUtc")] - public string LastUpdatedTimeUtc { get; set; } - - /// - /// Gets or sets source of a threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.source")] - public string Source { get; set; } - - /// - /// Gets or sets display name of a threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets description of a threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets indicator types of threat intelligence entities - /// - [JsonProperty(PropertyName = "properties.indicatorTypes")] - public IList IndicatorTypes { get; set; } - - /// - /// Gets or sets pattern of a threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.pattern")] - public string Pattern { get; set; } - - /// - /// Gets or sets pattern type of a threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.patternType")] - public string PatternType { get; set; } - - /// - /// Gets or sets pattern version of a threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.patternVersion")] - public string PatternVersion { get; set; } - - /// - /// Gets or sets kill chain phases - /// - [JsonProperty(PropertyName = "properties.killChainPhases")] - public IList KillChainPhases { get; set; } - - /// - /// Gets or sets parsed patterns - /// - [JsonProperty(PropertyName = "properties.parsedPattern")] - public IList ParsedPattern { get; set; } - - /// - /// Gets or sets external ID of threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.externalId")] - public string ExternalId { get; set; } - - /// - /// Gets or sets created by reference of threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.createdByRef")] - public string CreatedByRef { get; set; } - - /// - /// Gets or sets is threat intelligence entity defanged - /// - [JsonProperty(PropertyName = "properties.defanged")] - public bool? Defanged { get; set; } - - /// - /// Gets or sets external last updated time in UTC - /// - [JsonProperty(PropertyName = "properties.externalLastUpdatedTimeUtc")] - public string ExternalLastUpdatedTimeUtc { get; set; } - - /// - /// Gets or sets external References - /// - [JsonProperty(PropertyName = "properties.externalReferences")] - public IList ExternalReferences { get; set; } - - /// - /// Gets or sets granular Markings - /// - [JsonProperty(PropertyName = "properties.granularMarkings")] - public IList GranularMarkings { get; set; } - - /// - /// Gets or sets labels of threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.labels")] - public IList Labels { get; set; } - - /// - /// Gets or sets is threat intelligence entity revoked - /// - [JsonProperty(PropertyName = "properties.revoked")] - public bool? Revoked { get; set; } - - /// - /// Gets or sets confidence of threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.confidence")] - public int? Confidence { get; set; } - - /// - /// Gets or sets threat intelligence entity object marking references - /// - [JsonProperty(PropertyName = "properties.objectMarkingRefs")] - public IList ObjectMarkingRefs { get; set; } - - /// - /// Gets or sets language of threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.language")] - public string Language { get; set; } - - /// - /// Gets or sets threat types - /// - [JsonProperty(PropertyName = "properties.threatTypes")] - public IList ThreatTypes { get; set; } - - /// - /// Gets or sets valid from - /// - [JsonProperty(PropertyName = "properties.validFrom")] - public string ValidFrom { get; set; } - - /// - /// Gets or sets valid until - /// - [JsonProperty(PropertyName = "properties.validUntil")] - public string ValidUntil { get; set; } - - /// - /// Gets or sets created by - /// - [JsonProperty(PropertyName = "properties.created")] - public string Created { get; set; } - - /// - /// Gets or sets modified by - /// - [JsonProperty(PropertyName = "properties.modified")] - public string Modified { get; set; } - - /// - /// Gets or sets extensions map - /// - [JsonProperty(PropertyName = "properties.extensions")] - public IDictionary Extensions { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceIndicatorModelForRequestBody.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceIndicatorModelForRequestBody.cs deleted file mode 100644 index 6fd52f049272c..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceIndicatorModelForRequestBody.cs +++ /dev/null @@ -1,317 +0,0 @@ -// -// 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; - - /// - /// Threat intelligence indicator entity used in request body. - /// - [Rest.Serialization.JsonTransformation] - public partial class ThreatIntelligenceIndicatorModelForRequestBody : ThreatIntelligenceResourceKind - { - /// - /// Initializes a new instance of the - /// ThreatIntelligenceIndicatorModelForRequestBody class. - /// - public ThreatIntelligenceIndicatorModelForRequestBody() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ThreatIntelligenceIndicatorModelForRequestBody class. - /// - /// Etag of the azure resource - /// 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. - /// List of tags - /// Last updated time in UTC - /// Source of a threat intelligence entity - /// Display name of a threat intelligence - /// entity - /// Description of a threat intelligence - /// entity - /// Indicator types of threat intelligence - /// entities - /// Pattern of a threat intelligence - /// entity - /// Pattern type of a threat intelligence - /// entity - /// Pattern version of a threat - /// intelligence entity - /// Kill chain phases - /// Parsed patterns - /// External ID of threat intelligence - /// entity - /// Created by reference of threat - /// intelligence entity - /// Is threat intelligence entity - /// defanged - /// External last updated time - /// in UTC - /// External References - /// Granular Markings - /// Labels of threat intelligence entity - /// Is threat intelligence entity revoked - /// Confidence of threat intelligence - /// entity - /// Threat intelligence entity object - /// marking references - /// Language of threat intelligence - /// entity - /// Threat types - /// Valid from - /// Valid until - /// Created by - /// Modified by - /// Extensions map - public ThreatIntelligenceIndicatorModelForRequestBody(string etag = default(string), IDictionary additionalData = default(IDictionary), string friendlyName = default(string), IList threatIntelligenceTags = default(IList), string lastUpdatedTimeUtc = default(string), string source = default(string), string displayName = default(string), string description = default(string), IList indicatorTypes = default(IList), string pattern = default(string), string patternType = default(string), string patternVersion = default(string), IList killChainPhases = default(IList), IList parsedPattern = default(IList), string externalId = default(string), string createdByRef = default(string), bool? defanged = default(bool?), string externalLastUpdatedTimeUtc = default(string), IList externalReferences = default(IList), IList granularMarkings = default(IList), IList labels = default(IList), bool? revoked = default(bool?), int? confidence = default(int?), IList objectMarkingRefs = default(IList), string language = default(string), IList threatTypes = default(IList), string validFrom = default(string), string validUntil = default(string), string created = default(string), string modified = default(string), IDictionary extensions = default(IDictionary)) - { - Etag = etag; - AdditionalData = additionalData; - FriendlyName = friendlyName; - ThreatIntelligenceTags = threatIntelligenceTags; - LastUpdatedTimeUtc = lastUpdatedTimeUtc; - Source = source; - DisplayName = displayName; - Description = description; - IndicatorTypes = indicatorTypes; - Pattern = pattern; - PatternType = patternType; - PatternVersion = patternVersion; - KillChainPhases = killChainPhases; - ParsedPattern = parsedPattern; - ExternalId = externalId; - CreatedByRef = createdByRef; - Defanged = defanged; - ExternalLastUpdatedTimeUtc = externalLastUpdatedTimeUtc; - ExternalReferences = externalReferences; - GranularMarkings = granularMarkings; - Labels = labels; - Revoked = revoked; - Confidence = confidence; - ObjectMarkingRefs = objectMarkingRefs; - Language = language; - ThreatTypes = threatTypes; - ValidFrom = validFrom; - ValidUntil = validUntil; - Created = created; - Modified = modified; - Extensions = extensions; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets etag of the azure resource - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } - - /// - /// 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 or sets list of tags - /// - [JsonProperty(PropertyName = "properties.threatIntelligenceTags")] - public IList ThreatIntelligenceTags { get; set; } - - /// - /// Gets or sets last updated time in UTC - /// - [JsonProperty(PropertyName = "properties.lastUpdatedTimeUtc")] - public string LastUpdatedTimeUtc { get; set; } - - /// - /// Gets or sets source of a threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.source")] - public string Source { get; set; } - - /// - /// Gets or sets display name of a threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets description of a threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets indicator types of threat intelligence entities - /// - [JsonProperty(PropertyName = "properties.indicatorTypes")] - public IList IndicatorTypes { get; set; } - - /// - /// Gets or sets pattern of a threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.pattern")] - public string Pattern { get; set; } - - /// - /// Gets or sets pattern type of a threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.patternType")] - public string PatternType { get; set; } - - /// - /// Gets or sets pattern version of a threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.patternVersion")] - public string PatternVersion { get; set; } - - /// - /// Gets or sets kill chain phases - /// - [JsonProperty(PropertyName = "properties.killChainPhases")] - public IList KillChainPhases { get; set; } - - /// - /// Gets or sets parsed patterns - /// - [JsonProperty(PropertyName = "properties.parsedPattern")] - public IList ParsedPattern { get; set; } - - /// - /// Gets or sets external ID of threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.externalId")] - public string ExternalId { get; set; } - - /// - /// Gets or sets created by reference of threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.createdByRef")] - public string CreatedByRef { get; set; } - - /// - /// Gets or sets is threat intelligence entity defanged - /// - [JsonProperty(PropertyName = "properties.defanged")] - public bool? Defanged { get; set; } - - /// - /// Gets or sets external last updated time in UTC - /// - [JsonProperty(PropertyName = "properties.externalLastUpdatedTimeUtc")] - public string ExternalLastUpdatedTimeUtc { get; set; } - - /// - /// Gets or sets external References - /// - [JsonProperty(PropertyName = "properties.externalReferences")] - public IList ExternalReferences { get; set; } - - /// - /// Gets or sets granular Markings - /// - [JsonProperty(PropertyName = "properties.granularMarkings")] - public IList GranularMarkings { get; set; } - - /// - /// Gets or sets labels of threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.labels")] - public IList Labels { get; set; } - - /// - /// Gets or sets is threat intelligence entity revoked - /// - [JsonProperty(PropertyName = "properties.revoked")] - public bool? Revoked { get; set; } - - /// - /// Gets or sets confidence of threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.confidence")] - public int? Confidence { get; set; } - - /// - /// Gets or sets threat intelligence entity object marking references - /// - [JsonProperty(PropertyName = "properties.objectMarkingRefs")] - public IList ObjectMarkingRefs { get; set; } - - /// - /// Gets or sets language of threat intelligence entity - /// - [JsonProperty(PropertyName = "properties.language")] - public string Language { get; set; } - - /// - /// Gets or sets threat types - /// - [JsonProperty(PropertyName = "properties.threatTypes")] - public IList ThreatTypes { get; set; } - - /// - /// Gets or sets valid from - /// - [JsonProperty(PropertyName = "properties.validFrom")] - public string ValidFrom { get; set; } - - /// - /// Gets or sets valid until - /// - [JsonProperty(PropertyName = "properties.validUntil")] - public string ValidUntil { get; set; } - - /// - /// Gets or sets created by - /// - [JsonProperty(PropertyName = "properties.created")] - public string Created { get; set; } - - /// - /// Gets or sets modified by - /// - [JsonProperty(PropertyName = "properties.modified")] - public string Modified { get; set; } - - /// - /// Gets or sets extensions map - /// - [JsonProperty(PropertyName = "properties.extensions")] - public IDictionary Extensions { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceInformation.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceInformation.cs deleted file mode 100644 index 6fbf37b57f41d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceInformation.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// 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; - - /// - /// Threat intelligence information object. - /// - public partial class ThreatIntelligenceInformation : ResourceWithEtag - { - /// - /// Initializes a new instance of the ThreatIntelligenceInformation - /// class. - /// - public ThreatIntelligenceInformation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ThreatIntelligenceInformation - /// class. - /// - /// Etag of the azure resource - public ThreatIntelligenceInformation(string etag = default(string)) - { - Etag = etag; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets etag of the azure resource - /// - [JsonProperty(PropertyName = "etag")] - public string Etag { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceKillChainPhase.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceKillChainPhase.cs deleted file mode 100644 index d2d5131576deb..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceKillChainPhase.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// 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 threat kill chain phase entity - /// - public partial class ThreatIntelligenceKillChainPhase - { - /// - /// Initializes a new instance of the ThreatIntelligenceKillChainPhase - /// class. - /// - public ThreatIntelligenceKillChainPhase() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ThreatIntelligenceKillChainPhase - /// class. - /// - /// Kill chainName name - /// Phase name - public ThreatIntelligenceKillChainPhase(string killChainName = default(string), string phaseName = default(string)) - { - KillChainName = killChainName; - PhaseName = phaseName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets kill chainName name - /// - [JsonProperty(PropertyName = "killChainName")] - public string KillChainName { get; set; } - - /// - /// Gets or sets phase name - /// - [JsonProperty(PropertyName = "phaseName")] - public string PhaseName { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceMetric.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceMetric.cs deleted file mode 100644 index 761fe5260d4a7..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceMetric.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// 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 threat intelligence metric - /// - public partial class ThreatIntelligenceMetric - { - /// - /// Initializes a new instance of the ThreatIntelligenceMetric class. - /// - public ThreatIntelligenceMetric() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ThreatIntelligenceMetric class. - /// - /// Last updated indicator - /// metric - /// Threat type metrics - /// Pattern type metrics - /// Source metrics - public ThreatIntelligenceMetric(string lastUpdatedTimeUtc = default(string), IList threatTypeMetrics = default(IList), IList patternTypeMetrics = default(IList), IList sourceMetrics = default(IList)) - { - LastUpdatedTimeUtc = lastUpdatedTimeUtc; - ThreatTypeMetrics = threatTypeMetrics; - PatternTypeMetrics = patternTypeMetrics; - SourceMetrics = sourceMetrics; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets last updated indicator metric - /// - [JsonProperty(PropertyName = "lastUpdatedTimeUtc")] - public string LastUpdatedTimeUtc { get; set; } - - /// - /// Gets or sets threat type metrics - /// - [JsonProperty(PropertyName = "threatTypeMetrics")] - public IList ThreatTypeMetrics { get; set; } - - /// - /// Gets or sets pattern type metrics - /// - [JsonProperty(PropertyName = "patternTypeMetrics")] - public IList PatternTypeMetrics { get; set; } - - /// - /// Gets or sets source metrics - /// - [JsonProperty(PropertyName = "sourceMetrics")] - public IList SourceMetrics { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceMetricEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceMetricEntity.cs deleted file mode 100644 index d5a5fe883fca1..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceMetricEntity.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// 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 threat intelligence metric entity - /// - public partial class ThreatIntelligenceMetricEntity - { - /// - /// Initializes a new instance of the ThreatIntelligenceMetricEntity - /// class. - /// - public ThreatIntelligenceMetricEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ThreatIntelligenceMetricEntity - /// class. - /// - /// Metric name - /// Metric value - public ThreatIntelligenceMetricEntity(string metricName = default(string), int? metricValue = default(int?)) - { - MetricName = metricName; - MetricValue = metricValue; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets metric name - /// - [JsonProperty(PropertyName = "metricName")] - public string MetricName { get; set; } - - /// - /// Gets or sets metric value - /// - [JsonProperty(PropertyName = "metricValue")] - public int? MetricValue { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceMetrics.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceMetrics.cs deleted file mode 100644 index dc805c507c02c..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceMetrics.cs +++ /dev/null @@ -1,51 +0,0 @@ -// -// 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; - - /// - /// Threat intelligence metrics. - /// - public partial class ThreatIntelligenceMetrics - { - /// - /// Initializes a new instance of the ThreatIntelligenceMetrics class. - /// - public ThreatIntelligenceMetrics() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ThreatIntelligenceMetrics class. - /// - /// Threat intelligence metrics. - public ThreatIntelligenceMetrics(ThreatIntelligenceMetric properties = default(ThreatIntelligenceMetric)) - { - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets threat intelligence metrics. - /// - [JsonProperty(PropertyName = "properties")] - public ThreatIntelligenceMetric Properties { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceMetricsList.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceMetricsList.cs deleted file mode 100644 index b192e78e34a71..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceMetricsList.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// 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; - - /// - /// List of all the threat intelligence metric fields (type/threat - /// type/source). - /// - public partial class ThreatIntelligenceMetricsList - { - /// - /// Initializes a new instance of the ThreatIntelligenceMetricsList - /// class. - /// - public ThreatIntelligenceMetricsList() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ThreatIntelligenceMetricsList - /// class. - /// - /// Array of threat intelligence metric fields - /// (type/threat type/source). - public ThreatIntelligenceMetricsList(IList value) - { - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets array of threat intelligence metric fields - /// (type/threat type/source). - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Value == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Value"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceParsedPattern.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceParsedPattern.cs deleted file mode 100644 index 29c4b859325f8..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceParsedPattern.cs +++ /dev/null @@ -1,63 +0,0 @@ -// -// 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 parsed pattern entity - /// - public partial class ThreatIntelligenceParsedPattern - { - /// - /// Initializes a new instance of the ThreatIntelligenceParsedPattern - /// class. - /// - public ThreatIntelligenceParsedPattern() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ThreatIntelligenceParsedPattern - /// class. - /// - /// Pattern type key - /// Pattern type keys - public ThreatIntelligenceParsedPattern(string patternTypeKey = default(string), IList patternTypeValues = default(IList)) - { - PatternTypeKey = patternTypeKey; - PatternTypeValues = patternTypeValues; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets pattern type key - /// - [JsonProperty(PropertyName = "patternTypeKey")] - public string PatternTypeKey { get; set; } - - /// - /// Gets or sets pattern type keys - /// - [JsonProperty(PropertyName = "patternTypeValues")] - public IList PatternTypeValues { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceParsedPatternTypeValue.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceParsedPatternTypeValue.cs deleted file mode 100644 index c0e546cef959d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceParsedPatternTypeValue.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// 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 threat kill chain phase entity - /// - public partial class ThreatIntelligenceParsedPatternTypeValue - { - /// - /// Initializes a new instance of the - /// ThreatIntelligenceParsedPatternTypeValue class. - /// - public ThreatIntelligenceParsedPatternTypeValue() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// ThreatIntelligenceParsedPatternTypeValue class. - /// - /// Type of the value - /// Value of parsed pattern - public ThreatIntelligenceParsedPatternTypeValue(string valueType = default(string), string value = default(string)) - { - ValueType = valueType; - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets type of the value - /// - [JsonProperty(PropertyName = "valueType")] - public string ValueType { get; set; } - - /// - /// Gets or sets value of parsed pattern - /// - [JsonProperty(PropertyName = "value")] - public string Value { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceResourceKind.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceResourceKind.cs deleted file mode 100644 index 8481324af1b1d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceResourceKind.cs +++ /dev/null @@ -1,50 +0,0 @@ -// -// 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 entity with kind. - /// - public partial class ThreatIntelligenceResourceKind - { - /// - /// Initializes a new instance of the ThreatIntelligenceResourceKind - /// class. - /// - public ThreatIntelligenceResourceKind() - { - CustomInit(); - } - - /// - /// Static constructor for ThreatIntelligenceResourceKind class. - /// - static ThreatIntelligenceResourceKind() - { - Kind = "indicator"; - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// The kind of the entity. - /// - [JsonProperty(PropertyName = "kind")] - public static string Kind { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceResourceKindEnum.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceResourceKindEnum.cs deleted file mode 100644 index 5e33e6324aa8a..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceResourceKindEnum.cs +++ /dev/null @@ -1,24 +0,0 @@ -// -// 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 ThreatIntelligenceResourceKindEnum. - /// - public static class ThreatIntelligenceResourceKindEnum - { - /// - /// Entity represents threat intelligence indicator in the system. - /// - public const string Indicator = "indicator"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceSortingCriteria.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceSortingCriteria.cs deleted file mode 100644 index cd40277bfd503..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceSortingCriteria.cs +++ /dev/null @@ -1,64 +0,0 @@ -// -// 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; - - /// - /// List of available columns for sorting - /// - public partial class ThreatIntelligenceSortingCriteria - { - /// - /// Initializes a new instance of the ThreatIntelligenceSortingCriteria - /// class. - /// - public ThreatIntelligenceSortingCriteria() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ThreatIntelligenceSortingCriteria - /// class. - /// - /// Column name - /// Sorting order - /// (ascending/descending/unsorted). Possible values include: - /// 'unsorted', 'ascending', 'descending' - public ThreatIntelligenceSortingCriteria(string itemKey = default(string), string sortOrder = default(string)) - { - ItemKey = itemKey; - SortOrder = sortOrder; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets column name - /// - [JsonProperty(PropertyName = "itemKey")] - public string ItemKey { get; set; } - - /// - /// Gets or sets sorting order (ascending/descending/unsorted). - /// Possible values include: 'unsorted', 'ascending', 'descending' - /// - [JsonProperty(PropertyName = "sortOrder")] - public string SortOrder { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceSortingCriteriaEnum.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceSortingCriteriaEnum.cs deleted file mode 100644 index 4214c90980630..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ThreatIntelligenceSortingCriteriaEnum.cs +++ /dev/null @@ -1,23 +0,0 @@ -// -// 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 ThreatIntelligenceSortingCriteriaEnum. - /// - public static class ThreatIntelligenceSortingCriteriaEnum - { - public const string Unsorted = "unsorted"; - public const string Ascending = "ascending"; - public const string Descending = "descending"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TiTaxiiCheckRequirements.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TiTaxiiCheckRequirements.cs deleted file mode 100644 index cc53c42a46f09..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TiTaxiiCheckRequirements.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// 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.Linq; - - /// - /// Threat Intelligence TAXII data connector check requirements - /// - [Newtonsoft.Json.JsonObject("ThreatIntelligenceTaxii")] - [Rest.Serialization.JsonTransformation] - public partial class TiTaxiiCheckRequirements : DataConnectorsCheckRequirements - { - /// - /// Initializes a new instance of the TiTaxiiCheckRequirements class. - /// - public TiTaxiiCheckRequirements() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TiTaxiiCheckRequirements class. - /// - /// The tenant id to connect to, and get the - /// data from. - public TiTaxiiCheckRequirements(string tenantId) - { - TenantId = tenantId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TiTaxiiDataConnector.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TiTaxiiDataConnector.cs deleted file mode 100644 index a36b22bb3c71f..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TiTaxiiDataConnector.cs +++ /dev/null @@ -1,173 +0,0 @@ -// -// 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.Linq; - - /// - /// Data connector to pull Threat intelligence data from TAXII 2.0/2.1 - /// server - /// - [Newtonsoft.Json.JsonObject("ThreatIntelligenceTaxii")] - [Rest.Serialization.JsonTransformation] - public partial class TiTaxiiDataConnector : DataConnector - { - /// - /// Initializes a new instance of the TiTaxiiDataConnector class. - /// - public TiTaxiiDataConnector() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TiTaxiiDataConnector class. - /// - /// The tenant id to connect to, and get the - /// data from. - /// The polling frequency for the TAXII - /// server. Possible values include: 'OnceAMinute', 'OnceAnHour', - /// 'OnceADay' - /// The available data types for Threat - /// Intelligence TAXII data connector. - /// 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 workspace id. - /// The friendly name for the TAXII - /// server. - /// The API root for the TAXII - /// server. - /// The collection id of the TAXII - /// server. - /// The userName for the TAXII server. - /// The password for the TAXII server. - /// The lookback period for the TAXII - /// server. - public TiTaxiiDataConnector(string tenantId, string pollingFrequency, TiTaxiiDataConnectorDataTypes dataTypes, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string workspaceId = default(string), string friendlyName = default(string), string taxiiServer = default(string), string collectionId = default(string), string userName = default(string), string password = default(string), System.DateTime? taxiiLookbackPeriod = default(System.DateTime?)) - : base(id, name, type, systemData, etag) - { - TenantId = tenantId; - WorkspaceId = workspaceId; - FriendlyName = friendlyName; - TaxiiServer = taxiiServer; - CollectionId = collectionId; - UserName = userName; - Password = password; - TaxiiLookbackPeriod = taxiiLookbackPeriod; - PollingFrequency = pollingFrequency; - DataTypes = dataTypes; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the tenant id to connect to, and get the data from. - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Gets or sets the workspace id. - /// - [JsonProperty(PropertyName = "properties.workspaceId")] - public string WorkspaceId { get; set; } - - /// - /// Gets or sets the friendly name for the TAXII server. - /// - [JsonProperty(PropertyName = "properties.friendlyName")] - public string FriendlyName { get; set; } - - /// - /// Gets or sets the API root for the TAXII server. - /// - [JsonProperty(PropertyName = "properties.taxiiServer")] - public string TaxiiServer { get; set; } - - /// - /// Gets or sets the collection id of the TAXII server. - /// - [JsonProperty(PropertyName = "properties.collectionId")] - public string CollectionId { get; set; } - - /// - /// Gets or sets the userName for the TAXII server. - /// - [JsonProperty(PropertyName = "properties.userName")] - public string UserName { get; set; } - - /// - /// Gets or sets the password for the TAXII server. - /// - [JsonProperty(PropertyName = "properties.password")] - public string Password { get; set; } - - /// - /// Gets or sets the lookback period for the TAXII server. - /// - [JsonProperty(PropertyName = "properties.taxiiLookbackPeriod")] - public System.DateTime? TaxiiLookbackPeriod { get; set; } - - /// - /// Gets or sets the polling frequency for the TAXII server. Possible - /// values include: 'OnceAMinute', 'OnceAnHour', 'OnceADay' - /// - [JsonProperty(PropertyName = "properties.pollingFrequency")] - public string PollingFrequency { get; set; } - - /// - /// Gets or sets the available data types for Threat Intelligence TAXII - /// data connector. - /// - [JsonProperty(PropertyName = "properties.dataTypes")] - public TiTaxiiDataConnectorDataTypes DataTypes { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TenantId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TenantId"); - } - if (PollingFrequency == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "PollingFrequency"); - } - if (DataTypes == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DataTypes"); - } - if (DataTypes != null) - { - DataTypes.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TiTaxiiDataConnectorDataTypes.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TiTaxiiDataConnectorDataTypes.cs deleted file mode 100644 index 6de51c2d0ca22..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TiTaxiiDataConnectorDataTypes.cs +++ /dev/null @@ -1,71 +0,0 @@ -// -// 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; - - /// - /// The available data types for Threat Intelligence TAXII data connector. - /// - public partial class TiTaxiiDataConnectorDataTypes - { - /// - /// Initializes a new instance of the TiTaxiiDataConnectorDataTypes - /// class. - /// - public TiTaxiiDataConnectorDataTypes() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TiTaxiiDataConnectorDataTypes - /// class. - /// - /// Data type for TAXII connector. - public TiTaxiiDataConnectorDataTypes(TiTaxiiDataConnectorDataTypesTaxiiClient taxiiClient) - { - TaxiiClient = taxiiClient; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets data type for TAXII connector. - /// - [JsonProperty(PropertyName = "taxiiClient")] - public TiTaxiiDataConnectorDataTypesTaxiiClient TaxiiClient { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (TaxiiClient == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "TaxiiClient"); - } - if (TaxiiClient != null) - { - TaxiiClient.Validate(); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TiTaxiiDataConnectorDataTypesTaxiiClient.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TiTaxiiDataConnectorDataTypesTaxiiClient.cs deleted file mode 100644 index 196767877045d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TiTaxiiDataConnectorDataTypesTaxiiClient.cs +++ /dev/null @@ -1,58 +0,0 @@ -// -// 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; - - /// - /// Data type for TAXII connector. - /// - public partial class TiTaxiiDataConnectorDataTypesTaxiiClient : DataConnectorDataTypeCommon - { - /// - /// Initializes a new instance of the - /// TiTaxiiDataConnectorDataTypesTaxiiClient class. - /// - public TiTaxiiDataConnectorDataTypesTaxiiClient() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// TiTaxiiDataConnectorDataTypesTaxiiClient class. - /// - /// Describe whether this data type connection is - /// enabled or not. Possible values include: 'Enabled', - /// 'Disabled' - public TiTaxiiDataConnectorDataTypesTaxiiClient(string state) - : base(state) - { - 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/TimelineAggregation.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TimelineAggregation.cs deleted file mode 100644 index 79b0193c3ad00..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TimelineAggregation.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// 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; - - /// - /// timeline aggregation information per kind - /// - public partial class TimelineAggregation - { - /// - /// Initializes a new instance of the TimelineAggregation class. - /// - public TimelineAggregation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TimelineAggregation class. - /// - /// the total items found for a kind - /// the query kind. Possible values include: - /// 'Activity', 'Bookmark', 'SecurityAlert' - public TimelineAggregation(int count, string kind) - { - Count = count; - Kind = kind; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the total items found for a kind - /// - [JsonProperty(PropertyName = "count")] - public int Count { get; set; } - - /// - /// Gets or sets the query kind. Possible values include: 'Activity', - /// 'Bookmark', 'SecurityAlert' - /// - [JsonProperty(PropertyName = "kind")] - public string Kind { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Kind == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Kind"); - } - } - } -} 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 deleted file mode 100644 index 90d64f7d80d90..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TimelineError.cs +++ /dev/null @@ -1,87 +0,0 @@ -// -// 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; - - /// - /// Timeline Query Errors. - /// - public partial class TimelineError - { - /// - /// Initializes a new instance of the TimelineError class. - /// - public TimelineError() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TimelineError class. - /// - /// the query kind. Possible values include: - /// 'Activity', 'Bookmark', 'SecurityAlert' - /// the error message - /// the query id - public TimelineError(string kind, string errorMessage, string queryId = default(string)) - { - Kind = kind; - QueryId = queryId; - ErrorMessage = errorMessage; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the query kind. Possible values include: 'Activity', - /// 'Bookmark', 'SecurityAlert' - /// - [JsonProperty(PropertyName = "kind")] - public string Kind { get; set; } - - /// - /// Gets or sets the query id - /// - [JsonProperty(PropertyName = "queryId")] - public string QueryId { get; set; } - - /// - /// Gets or sets the error message - /// - [JsonProperty(PropertyName = "errorMessage")] - public string ErrorMessage { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Kind == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Kind"); - } - if (ErrorMessage == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ErrorMessage"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TimelineResultsMetadata.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TimelineResultsMetadata.cs deleted file mode 100644 index 2f5583f8a9dd6..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TimelineResultsMetadata.cs +++ /dev/null @@ -1,104 +0,0 @@ -// -// 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; - - /// - /// Expansion result metadata. - /// - public partial class TimelineResultsMetadata - { - /// - /// Initializes a new instance of the TimelineResultsMetadata class. - /// - public TimelineResultsMetadata() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TimelineResultsMetadata class. - /// - /// the total items found for the timeline - /// request - /// timeline aggregation per kind - /// information about the failure queries - public TimelineResultsMetadata(int totalCount, IList aggregations, IList errors = default(IList)) - { - TotalCount = totalCount; - Aggregations = aggregations; - Errors = errors; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the total items found for the timeline request - /// - [JsonProperty(PropertyName = "totalCount")] - public int TotalCount { get; set; } - - /// - /// Gets or sets timeline aggregation per kind - /// - [JsonProperty(PropertyName = "aggregations")] - public IList Aggregations { get; set; } - - /// - /// Gets or sets information about the failure queries - /// - [JsonProperty(PropertyName = "errors")] - public IList Errors { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Aggregations == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Aggregations"); - } - if (Aggregations != null) - { - foreach (var element in Aggregations) - { - if (element != null) - { - element.Validate(); - } - } - } - if (Errors != null) - { - foreach (var element1 in Errors) - { - if (element1 != null) - { - element1.Validate(); - } - } - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EyesOn.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ToggleSettings.cs similarity index 52% rename from sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EyesOn.cs rename to sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ToggleSettings.cs index 4a0c5b1d9af9b..076630967b68c 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/EyesOn.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/ToggleSettings.cs @@ -19,32 +19,27 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models /// Settings with single toggle. /// [Rest.Serialization.JsonTransformation] - public partial class EyesOn : Settings + public partial class ToggleSettings : Settings { /// - /// Initializes a new instance of the EyesOn class. + /// Initializes a new instance of the ToggleSettings class. /// - public EyesOn() + public ToggleSettings() { CustomInit(); } /// - /// Initializes a new instance of the EyesOn class. + /// Initializes a new instance of the ToggleSettings 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. + /// Azure resource Id + /// Azure resource name + /// Azure resource type /// Etag of the azure resource /// Determines whether the setting is enable or /// disabled. - public EyesOn(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), bool? isEnabled = default(bool?)) - : base(id, name, type, systemData, etag) + public ToggleSettings(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), bool? isEnabled = default(bool?)) + : base(id, name, type, etag) { IsEnabled = isEnabled; CustomInit(); @@ -56,10 +51,10 @@ public EyesOn() partial void CustomInit(); /// - /// Gets determines whether the setting is enable or disabled. + /// Gets or sets determines whether the setting is enable or disabled. /// [JsonProperty(PropertyName = "properties.isEnabled")] - public bool? IsEnabled { get; private set; } + public bool? IsEnabled { get; set; } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TrackedResource.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TrackedResource.cs deleted file mode 100644 index 491fc1d89b550..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/TrackedResource.cs +++ /dev/null @@ -1,89 +0,0 @@ -// -// 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; - - /// - /// Tracked Resource - /// - /// - /// The resource model definition for an Azure Resource Manager tracked top - /// level resource which has 'tags' and a 'location' - /// - public partial class TrackedResource : Resource - { - /// - /// Initializes a new instance of the TrackedResource class. - /// - public TrackedResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the TrackedResource class. - /// - /// The geo-location where the resource - /// lives - /// 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 tags. - public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary)) - : base(id, name, type, systemData) - { - Tags = tags; - Location = location; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets resource tags. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - /// - /// Gets or sets the geo-location where the resource lives - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Ueba.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Ueba.cs deleted file mode 100644 index 5c51113236c06..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Ueba.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// 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; - - /// - /// Settings with single toggle. - /// - [Rest.Serialization.JsonTransformation] - public partial class Ueba : Settings - { - /// - /// Initializes a new instance of the Ueba class. - /// - public Ueba() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Ueba 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 - /// The relevant data sources that enriched - /// by ueba - public Ueba(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), IList dataSources = default(IList)) - : base(id, name, type, systemData, etag) - { - DataSources = dataSources; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the relevant data sources that enriched by ueba - /// - [JsonProperty(PropertyName = "properties.dataSources")] - public IList DataSources { get; set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/UebaDataSources.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/UebaDataSources.cs deleted file mode 100644 index ebcd91eeb63ca..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/UebaDataSources.cs +++ /dev/null @@ -1,24 +0,0 @@ -// -// 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 UebaDataSources. - /// - public static class UebaDataSources - { - public const string AuditLogs = "AuditLogs"; - public const string AzureActivity = "AzureActivity"; - public const string SecurityEvent = "SecurityEvent"; - public const string SigninLogs = "SigninLogs"; - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/UebaSettings.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/UebaSettings.cs new file mode 100644 index 0000000000000..840992edae715 --- /dev/null +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/UebaSettings.cs @@ -0,0 +1,84 @@ +// +// 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.Linq; + + /// + /// Represents settings for User and Entity Behavior Analytics enablement. + /// + [Rest.Serialization.JsonTransformation] + public partial class UebaSettings : Settings + { + /// + /// Initializes a new instance of the UebaSettings class. + /// + public UebaSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UebaSettings class. + /// + /// Azure resource Id + /// Azure resource name + /// Azure resource type + /// Etag of the azure resource + /// Determines whether the tenant has + /// ATP (Advanced Threat Protection) license. Possible values include: + /// 'Enabled', 'Disabled' + /// Determines whether User and Entity Behavior + /// Analytics is enabled for this workspace. + /// Determines whether User and Entity + /// Behavior Analytics is enabled from MCAS (Microsoft Cloud App + /// Security). Possible values include: 'Enabled', 'Disabled' + public UebaSettings(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string atpLicenseStatus = default(string), bool? isEnabled = default(bool?), string statusInMcas = default(string)) + : base(id, name, type, etag) + { + AtpLicenseStatus = atpLicenseStatus; + IsEnabled = isEnabled; + StatusInMcas = statusInMcas; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets determines whether the tenant has ATP (Advanced Threat + /// Protection) license. Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.atpLicenseStatus")] + public string AtpLicenseStatus { get; private set; } + + /// + /// Gets or sets determines whether User and Entity Behavior Analytics + /// is enabled for this workspace. + /// + [JsonProperty(PropertyName = "properties.isEnabled")] + public bool? IsEnabled { get; set; } + + /// + /// Gets determines whether User and Entity Behavior Analytics is + /// enabled from MCAS (Microsoft Cloud App Security). Possible values + /// include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.statusInMcas")] + public string StatusInMcas { get; private set; } + + } +} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/UrlEntity.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/UrlEntity.cs deleted file mode 100644 index a31d999bd2e1e..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/UrlEntity.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// 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 url entity. - /// - [Newtonsoft.Json.JsonObject("Url")] - [Rest.Serialization.JsonTransformation] - public partial class UrlEntity : Entity - { - /// - /// Initializes a new instance of the UrlEntity class. - /// - public UrlEntity() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the UrlEntity 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. - /// A full URL the entity points to - public UrlEntity(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 url = default(string)) - : base(id, name, type, systemData) - { - AdditionalData = additionalData; - FriendlyName = friendlyName; - Url = url; - 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 a full URL the entity points to - /// - [JsonProperty(PropertyName = "properties.url")] - public string Url { get; private set; } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/UserInfo.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/UserInfo.cs index 22ee58fb1b3d1..3573080ba7374 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/UserInfo.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/UserInfo.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.SecurityInsights.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; @@ -29,10 +30,10 @@ public UserInfo() /// /// Initializes a new instance of the UserInfo class. /// + /// The object id of the user. /// The email of the user. /// The name of the user. - /// The object id of the user. - public UserInfo(string email = default(string), string name = default(string), System.Guid? objectId = default(System.Guid?)) + public UserInfo(System.Guid? objectId, string email = default(string), string name = default(string)) { Email = email; Name = name; @@ -63,5 +64,18 @@ public UserInfo() [JsonProperty(PropertyName = "objectId")] public System.Guid? ObjectId { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ObjectId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ObjectId"); + } + } } } diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Watchlist.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Watchlist.cs deleted file mode 100644 index ed5627ee61a49..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/Watchlist.cs +++ /dev/null @@ -1,284 +0,0 @@ -// -// 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 Watchlist in Azure Security Insights. - /// - [Rest.Serialization.JsonTransformation] - public partial class Watchlist : ResourceWithEtag - { - /// - /// Initializes a new instance of the Watchlist class. - /// - public Watchlist() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Watchlist class. - /// - /// The display name of the watchlist - /// The provider of the watchlist - /// The source of the watchlist. Possible values - /// include: 'Local file', 'Remote storage' - /// The search key is used to optimize - /// query performance when using watchlists for joins with other data. - /// For example, enable a column with IP addresses to be the designated - /// SearchKey field, then use this field as the key field when joining - /// to other event data by IP address. - /// 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 id (a Guid) of the watchlist - /// The time the watchlist was created - /// The last time the watchlist was - /// updated - /// Describes a user that created the - /// watchlist - /// Describes a user that updated the - /// watchlist - /// A description of the watchlist - /// The type of the watchlist - /// The alias of the watchlist - /// A flag that indicates if the watchlist is - /// deleted or not - /// List of labels relevant to this - /// watchlist - /// The default duration of a watchlist - /// (in ISO 8601 duration format) - /// The tenantId where the watchlist belongs - /// to - /// The number of lines in a csv/tsv - /// content to skip before the header - /// The raw content that represents to - /// watchlist items to create. In case of csv/tsv content type, it's - /// the content of the file that will parsed by the endpoint - /// The content type of the raw content. - /// Example : text/csv or text/tsv - /// The status of the Watchlist upload : - /// New, InProgress or Complete. Pls note : When a Watchlist upload - /// status is equal to InProgress, the Watchlist cannot be - /// deleted - /// The number of Watchlist Items in - /// the Watchlist - public Watchlist(string displayName, string provider, string source, string itemsSearchKey, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string), string watchlistId = default(string), System.DateTime? created = default(System.DateTime?), System.DateTime? updated = default(System.DateTime?), UserInfo createdBy = default(UserInfo), UserInfo updatedBy = default(UserInfo), string description = default(string), string watchlistType = default(string), string watchlistAlias = default(string), bool? isDeleted = default(bool?), IList labels = default(IList), System.TimeSpan? defaultDuration = default(System.TimeSpan?), string tenantId = default(string), int? numberOfLinesToSkip = default(int?), string rawContent = default(string), string contentType = default(string), string uploadStatus = default(string), int? watchlistItemsCount = default(int?)) - : base(id, name, type, systemData, etag) - { - WatchlistId = watchlistId; - DisplayName = displayName; - Provider = provider; - Source = source; - Created = created; - Updated = updated; - CreatedBy = createdBy; - UpdatedBy = updatedBy; - Description = description; - WatchlistType = watchlistType; - WatchlistAlias = watchlistAlias; - IsDeleted = isDeleted; - Labels = labels; - DefaultDuration = defaultDuration; - TenantId = tenantId; - NumberOfLinesToSkip = numberOfLinesToSkip; - RawContent = rawContent; - ItemsSearchKey = itemsSearchKey; - ContentType = contentType; - UploadStatus = uploadStatus; - WatchlistItemsCount = watchlistItemsCount; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the id (a Guid) of the watchlist - /// - [JsonProperty(PropertyName = "properties.watchlistId")] - public string WatchlistId { get; set; } - - /// - /// Gets or sets the display name of the watchlist - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets the provider of the watchlist - /// - [JsonProperty(PropertyName = "properties.provider")] - public string Provider { get; set; } - - /// - /// Gets or sets the source of the watchlist. Possible values include: - /// 'Local file', 'Remote storage' - /// - [JsonProperty(PropertyName = "properties.source")] - public string Source { get; set; } - - /// - /// Gets or sets the time the watchlist was created - /// - [JsonProperty(PropertyName = "properties.created")] - public System.DateTime? Created { get; set; } - - /// - /// Gets or sets the last time the watchlist was updated - /// - [JsonProperty(PropertyName = "properties.updated")] - public System.DateTime? Updated { get; set; } - - /// - /// Gets or sets describes a user that created the watchlist - /// - [JsonProperty(PropertyName = "properties.createdBy")] - public UserInfo CreatedBy { get; set; } - - /// - /// Gets or sets describes a user that updated the watchlist - /// - [JsonProperty(PropertyName = "properties.updatedBy")] - public UserInfo UpdatedBy { get; set; } - - /// - /// Gets or sets a description of the watchlist - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; set; } - - /// - /// Gets or sets the type of the watchlist - /// - [JsonProperty(PropertyName = "properties.watchlistType")] - public string WatchlistType { get; set; } - - /// - /// Gets or sets the alias of the watchlist - /// - [JsonProperty(PropertyName = "properties.watchlistAlias")] - public string WatchlistAlias { get; set; } - - /// - /// Gets or sets a flag that indicates if the watchlist is deleted or - /// not - /// - [JsonProperty(PropertyName = "properties.isDeleted")] - public bool? IsDeleted { get; set; } - - /// - /// Gets or sets list of labels relevant to this watchlist - /// - [JsonProperty(PropertyName = "properties.labels")] - public IList Labels { get; set; } - - /// - /// Gets or sets the default duration of a watchlist (in ISO 8601 - /// duration format) - /// - [JsonProperty(PropertyName = "properties.defaultDuration")] - public System.TimeSpan? DefaultDuration { get; set; } - - /// - /// Gets or sets the tenantId where the watchlist belongs to - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Gets or sets the number of lines in a csv/tsv content to skip - /// before the header - /// - [JsonProperty(PropertyName = "properties.numberOfLinesToSkip")] - public int? NumberOfLinesToSkip { get; set; } - - /// - /// Gets or sets the raw content that represents to watchlist items to - /// create. In case of csv/tsv content type, it's the content of the - /// file that will parsed by the endpoint - /// - [JsonProperty(PropertyName = "properties.rawContent")] - public string RawContent { get; set; } - - /// - /// Gets or sets the search key is used to optimize query performance - /// when using watchlists for joins with other data. For example, - /// enable a column with IP addresses to be the designated SearchKey - /// field, then use this field as the key field when joining to other - /// event data by IP address. - /// - [JsonProperty(PropertyName = "properties.itemsSearchKey")] - public string ItemsSearchKey { get; set; } - - /// - /// Gets or sets the content type of the raw content. Example : - /// text/csv or text/tsv - /// - [JsonProperty(PropertyName = "properties.contentType")] - public string ContentType { get; set; } - - /// - /// Gets or sets the status of the Watchlist upload : New, InProgress - /// or Complete. Pls note : When a Watchlist upload status is equal to - /// InProgress, the Watchlist cannot be deleted - /// - [JsonProperty(PropertyName = "properties.uploadStatus")] - public string UploadStatus { get; set; } - - /// - /// Gets or sets the number of Watchlist Items in the Watchlist - /// - [JsonProperty(PropertyName = "properties.watchlistItemsCount")] - public int? WatchlistItemsCount { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (DisplayName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "DisplayName"); - } - if (Provider == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Provider"); - } - if (Source == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Source"); - } - if (ItemsSearchKey == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ItemsSearchKey"); - } - } - } -} 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 deleted file mode 100644 index 161d2e5d31bcb..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Models/WatchlistItem.cs +++ /dev/null @@ -1,160 +0,0 @@ -// -// 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.Linq; - - /// - /// Represents a Watchlist item in Azure Security Insights. - /// - [Rest.Serialization.JsonTransformation] - public partial class WatchlistItem : ResourceWithEtag - { - /// - /// Initializes a new instance of the WatchlistItem class. - /// - public WatchlistItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WatchlistItem class. - /// - /// key-value pairs for a watchlist - /// item - /// 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 type of the watchlist - /// item - /// The id (a Guid) of the watchlist - /// item - /// The tenantId to which the watchlist item - /// belongs to - /// A flag that indicates if the watchlist item - /// is deleted or not - /// The time the watchlist item was - /// created - /// The last time the watchlist item was - /// updated - /// Describes a user that created the watchlist - /// item - /// Describes a user that updated the watchlist - /// 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)) - : base(id, name, type, systemData, etag) - { - WatchlistItemType = watchlistItemType; - WatchlistItemId = watchlistItemId; - TenantId = tenantId; - IsDeleted = isDeleted; - Created = created; - Updated = updated; - CreatedBy = createdBy; - UpdatedBy = updatedBy; - ItemsKeyValue = itemsKeyValue; - EntityMapping = entityMapping; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the type of the watchlist item - /// - [JsonProperty(PropertyName = "properties.watchlistItemType")] - public string WatchlistItemType { get; set; } - - /// - /// Gets or sets the id (a Guid) of the watchlist item - /// - [JsonProperty(PropertyName = "properties.watchlistItemId")] - public string WatchlistItemId { get; set; } - - /// - /// Gets or sets the tenantId to which the watchlist item belongs to - /// - [JsonProperty(PropertyName = "properties.tenantId")] - public string TenantId { get; set; } - - /// - /// Gets or sets a flag that indicates if the watchlist item is deleted - /// or not - /// - [JsonProperty(PropertyName = "properties.isDeleted")] - public bool? IsDeleted { get; set; } - - /// - /// Gets or sets the time the watchlist item was created - /// - [JsonProperty(PropertyName = "properties.created")] - public System.DateTime? Created { get; set; } - - /// - /// Gets or sets the last time the watchlist item was updated - /// - [JsonProperty(PropertyName = "properties.updated")] - public System.DateTime? Updated { get; set; } - - /// - /// Gets or sets describes a user that created the watchlist item - /// - [JsonProperty(PropertyName = "properties.createdBy")] - public UserInfo CreatedBy { get; set; } - - /// - /// Gets or sets describes a user that updated the watchlist item - /// - [JsonProperty(PropertyName = "properties.updatedBy")] - public UserInfo UpdatedBy { get; set; } - - /// - /// Gets or sets key-value pairs for a watchlist item - /// - [JsonProperty(PropertyName = "properties.itemsKeyValue")] - public object ItemsKeyValue { get; set; } - - /// - /// Gets or sets key-value pairs for a watchlist item entity mapping - /// - [JsonProperty(PropertyName = "properties.entityMapping")] - public object EntityMapping { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (ItemsKeyValue == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ItemsKeyValue"); - } - } - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/OfficeConsentsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/OfficeConsentsOperations.cs deleted file mode 100644 index 0c82ac338ab28..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/OfficeConsentsOperations.cs +++ /dev/null @@ -1,920 +0,0 @@ -// -// 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; - - /// - /// OfficeConsentsOperations operations. - /// - internal partial class OfficeConsentsOperations : IServiceOperations, IOfficeConsentsOperations - { - /// - /// Initializes a new instance of the OfficeConsentsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal OfficeConsentsOperations(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 office365 consents. - /// - /// - /// 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/officeConsents").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 an office365 consent. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// consent 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 consentId, 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 (consentId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "consentId"); - } - // 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("consentId", consentId); - 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/officeConsents/{consentId}").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("{consentId}", System.Uri.EscapeDataString(consentId)); - 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; - } - - /// - /// Delete the office365 consent. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// consent ID - /// - /// - /// 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 consentId, 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 (consentId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "consentId"); - } - // 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("consentId", consentId); - 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/officeConsents/{consentId}").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("{consentId}", System.Uri.EscapeDataString(consentId)); - 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 office365 consents. - /// - /// - /// 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/OfficeConsentsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/OfficeConsentsOperationsExtensions.cs deleted file mode 100644 index 226117d9e12db..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/OfficeConsentsOperationsExtensions.cs +++ /dev/null @@ -1,188 +0,0 @@ -// -// 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 OfficeConsentsOperations. - /// - public static partial class OfficeConsentsOperationsExtensions - { - /// - /// Gets all office365 consents. - /// - /// - /// 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 IOfficeConsentsOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } - - /// - /// Gets all office365 consents. - /// - /// - /// 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 IOfficeConsentsOperations 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 an office365 consent. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// consent ID - /// - public static OfficeConsent Get(this IOfficeConsentsOperations operations, string resourceGroupName, string workspaceName, string consentId) - { - return operations.GetAsync(resourceGroupName, workspaceName, consentId).GetAwaiter().GetResult(); - } - - /// - /// Gets an office365 consent. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// consent ID - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IOfficeConsentsOperations operations, string resourceGroupName, string workspaceName, string consentId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, consentId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete the office365 consent. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// consent ID - /// - public static void Delete(this IOfficeConsentsOperations operations, string resourceGroupName, string workspaceName, string consentId) - { - operations.DeleteAsync(resourceGroupName, workspaceName, consentId).GetAwaiter().GetResult(); - } - - /// - /// Delete the office365 consent. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// consent ID - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IOfficeConsentsOperations operations, string resourceGroupName, string workspaceName, string consentId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, consentId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets all office365 consents. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IOfficeConsentsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all office365 consents. - /// - /// - /// 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 IOfficeConsentsOperations 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/Operations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Operations.cs index 817cb31f1651c..38e2e487d6dea 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Operations.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/Operations.cs @@ -65,28 +65,11 @@ internal Operations(SecurityInsightsClient client) /// /// 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(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); - } - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ProductSettingsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ProductSettingsOperations.cs deleted file mode 100644 index 17cab90b475e1..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ProductSettingsOperations.cs +++ /dev/null @@ -1,1002 +0,0 @@ -// -// 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; - - /// - /// ProductSettingsOperations operations. - /// - internal partial class ProductSettingsOperations : IServiceOperations, IProductSettingsOperations - { - /// - /// Initializes a new instance of the ProductSettingsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal ProductSettingsOperations(SecurityInsightsClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityInsightsClient - /// - public SecurityInsightsClient Client { get; private set; } - - /// - /// List of all the 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/settings").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 a setting. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba - /// - /// - /// 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 settingsName, 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 (settingsName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "settingsName"); - } - // 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("settingsName", settingsName); - 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/settings/{settingsName}").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("{settingsName}", System.Uri.EscapeDataString(settingsName)); - 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; - } - - /// - /// Delete setting of the product. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba - /// - /// - /// 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 settingsName, 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 (settingsName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "settingsName"); - } - // 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("settingsName", settingsName); - 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/settings/{settingsName}").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("{settingsName}", System.Uri.EscapeDataString(settingsName)); - 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; - } - - /// - /// Updates setting. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba - /// - /// - /// The 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string settingsName, Settings settings, 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 (settingsName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "settingsName"); - } - if (settings == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "settings"); - } - // 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("settingsName", settingsName); - tracingParameters.Add("settings", settings); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", 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/settings/{settingsName}").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("{settingsName}", System.Uri.EscapeDataString(settingsName)); - 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(settings != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(settings, 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) - { - 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/ProductSettingsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ProductSettingsOperationsExtensions.cs deleted file mode 100644 index e6a80552d519a..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ProductSettingsOperationsExtensions.cs +++ /dev/null @@ -1,206 +0,0 @@ -// -// 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 ProductSettingsOperations. - /// - public static partial class ProductSettingsOperationsExtensions - { - /// - /// List of all the 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 SettingList List(this IProductSettingsOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } - - /// - /// List of all the 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 IProductSettingsOperations 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 a setting. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba - /// - public static Settings Get(this IProductSettingsOperations operations, string resourceGroupName, string workspaceName, string settingsName) - { - return operations.GetAsync(resourceGroupName, workspaceName, settingsName).GetAwaiter().GetResult(); - } - - /// - /// Gets a setting. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IProductSettingsOperations operations, string resourceGroupName, string workspaceName, string settingsName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, settingsName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete setting of the product. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba - /// - public static void Delete(this IProductSettingsOperations operations, string resourceGroupName, string workspaceName, string settingsName) - { - operations.DeleteAsync(resourceGroupName, workspaceName, settingsName).GetAwaiter().GetResult(); - } - - /// - /// Delete setting of the product. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IProductSettingsOperations operations, string resourceGroupName, string workspaceName, string settingsName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, settingsName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Updates setting. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba - /// - /// - /// The setting - /// - public static Settings Update(this IProductSettingsOperations operations, string resourceGroupName, string workspaceName, string settingsName, Settings settings) - { - return operations.UpdateAsync(resourceGroupName, workspaceName, settingsName, settings).GetAwaiter().GetResult(); - } - - /// - /// Updates setting. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba - /// - /// - /// The setting - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IProductSettingsOperations operations, string resourceGroupName, string workspaceName, string settingsName, Settings settings, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, settingsName, settings, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} 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 761fa1fa8e3af..64ffa0f18fb74 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,52 +19,16 @@ public static IEnumerable> ApiInfo_SecurityInsight { return new Tuple[] { - new Tuple("OperationalInsights", "Actions", "2021-09-01-preview"), - new Tuple("OperationalInsights", "AlertRuleTemplates", "2021-09-01-preview"), - new Tuple("OperationalInsights", "AlertRules", "2021-09-01-preview"), - new Tuple("OperationalInsights", "AutomationRules", "2021-09-01-preview"), - new Tuple("OperationalInsights", "Bookmark", "2021-09-01-preview"), - new Tuple("OperationalInsights", "BookmarkRelations", "2021-09-01-preview"), - new Tuple("OperationalInsights", "Bookmarks", "2021-09-01-preview"), - new Tuple("OperationalInsights", "DataConnectors", "2021-09-01-preview"), - new Tuple("OperationalInsights", "DataConnectorsCheckRequirements", "2021-09-01-preview"), - new Tuple("OperationalInsights", "Entities", "2021-09-01-preview"), - new Tuple("OperationalInsights", "EntitiesGetTimeline", "2021-09-01-preview"), - new Tuple("OperationalInsights", "EntitiesRelations", "2021-09-01-preview"), - new Tuple("OperationalInsights", "EntityQueries", "2021-09-01-preview"), - new Tuple("OperationalInsights", "EntityQueryTemplates", "2021-09-01-preview"), - new Tuple("OperationalInsights", "EntityRelations", "2021-09-01-preview"), - new Tuple("OperationalInsights", "IncidentComments", "2021-09-01-preview"), - new Tuple("OperationalInsights", "IncidentRelations", "2021-09-01-preview"), - new Tuple("OperationalInsights", "Incidents", "2021-09-01-preview"), - new Tuple("OperationalInsights", "Metadata", "2021-09-01-preview"), - new Tuple("OperationalInsights", "OfficeConsents", "2021-09-01-preview"), - new Tuple("OperationalInsights", "ProductSettings", "2021-09-01-preview"), - new Tuple("OperationalInsights", "SentinelOnboardingStates", "2021-09-01-preview"), - new Tuple("OperationalInsights", "SourceControl", "2021-09-01-preview"), - new Tuple("OperationalInsights", "SourceControls", "2021-09-01-preview"), - new Tuple("OperationalInsights", "ThreatIntelligenceIndicator", "2021-09-01-preview"), - new Tuple("OperationalInsights", "ThreatIntelligenceIndicatorMetrics", "2021-09-01-preview"), - new Tuple("OperationalInsights", "ThreatIntelligenceIndicators", "2021-09-01-preview"), - new Tuple("OperationalInsights", "WatchlistItems", "2021-09-01-preview"), - new Tuple("OperationalInsights", "Watchlists", "2021-09-01-preview"), - new Tuple("SecurityInsights", "DomainWhois", "2021-09-01-preview"), - new Tuple("SecurityInsights", "IPGeodata", "2021-09-01-preview"), - new Tuple("SecurityInsights", "Operations", "2021-09-01-preview"), + new Tuple("OperationalInsights", "Actions", "2020-01-01"), + new Tuple("OperationalInsights", "AlertRuleTemplates", "2020-01-01"), + new Tuple("OperationalInsights", "AlertRules", "2020-01-01"), + new Tuple("OperationalInsights", "Bookmarks", "2020-01-01"), + new Tuple("OperationalInsights", "DataConnectors", "2020-01-01"), + new Tuple("OperationalInsights", "IncidentComments", "2020-01-01"), + new Tuple("OperationalInsights", "Incidents", "2020-01-01"), + new Tuple("SecurityInsights", "Operations", "2020-01-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/securityinsights/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=E:\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "main"; - public static readonly String GithubCommidId = "f727c69fa6aa618d706adae3fe8c1222d08d7a4d"; - 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/SecurityInsightsClient.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityInsightsClient.cs index 381f9f8f6e63c..19d94f635b468 100644 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityInsightsClient.cs +++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SecurityInsightsClient.cs @@ -48,12 +48,12 @@ public partial class SecurityInsightsClient : ServiceClient - /// The ID of the target subscription. + /// Azure subscription ID /// public string SubscriptionId { get; set; } /// - /// The API version to use for this operation. + /// API version for the operation /// public string ApiVersion { get; private set; } @@ -90,150 +90,30 @@ public partial class SecurityInsightsClient : ServiceClient public virtual IAlertRuleTemplatesOperations AlertRuleTemplates { get; private set; } - /// - /// Gets the IAutomationRulesOperations. - /// - public virtual IAutomationRulesOperations AutomationRules { get; private set; } - /// /// Gets the IBookmarksOperations. /// public virtual IBookmarksOperations Bookmarks { get; private set; } - /// - /// Gets the IBookmarkRelationsOperations. - /// - public virtual IBookmarkRelationsOperations BookmarkRelations { get; private set; } - - /// - /// Gets the IBookmarkOperations. - /// - public virtual IBookmarkOperations Bookmark { get; private set; } - - /// - /// Gets the IIPGeodataOperations. - /// - public virtual IIPGeodataOperations IPGeodata { get; private set; } - - /// - /// Gets the IDomainWhoisOperations. - /// - public virtual IDomainWhoisOperations DomainWhois { get; private set; } - - /// - /// Gets the IEntityQueriesOperations. - /// - public virtual IEntityQueriesOperations EntityQueries { get; private set; } - - /// - /// Gets the IEntitiesOperations. - /// - public virtual IEntitiesOperations Entities { get; private set; } - - /// - /// Gets the IEntitiesGetTimelineOperations. - /// - public virtual IEntitiesGetTimelineOperations EntitiesGetTimeline { get; private set; } - - /// - /// Gets the IEntitiesRelationsOperations. - /// - public virtual IEntitiesRelationsOperations EntitiesRelations { get; private set; } - - /// - /// Gets the IEntityRelationsOperations. - /// - public virtual IEntityRelationsOperations EntityRelations { get; private set; } - - /// - /// Gets the IIncidentsOperations. - /// - public virtual IIncidentsOperations Incidents { get; private set; } - - /// - /// Gets the IIncidentCommentsOperations. - /// - public virtual IIncidentCommentsOperations IncidentComments { get; private set; } - - /// - /// Gets the IIncidentRelationsOperations. - /// - public virtual IIncidentRelationsOperations IncidentRelations { get; private set; } - - /// - /// Gets the IMetadataOperations. - /// - public virtual IMetadataOperations Metadata { get; private set; } - - /// - /// Gets the ISentinelOnboardingStatesOperations. - /// - public virtual ISentinelOnboardingStatesOperations SentinelOnboardingStates { get; private set; } - - /// - /// Gets the IProductSettingsOperations. - /// - public virtual IProductSettingsOperations ProductSettings { get; private set; } - - /// - /// Gets the ISourceControlOperations. - /// - public virtual ISourceControlOperations SourceControl { get; private set; } - - /// - /// Gets the ISourceControlsOperations. - /// - public virtual ISourceControlsOperations SourceControls { get; private set; } - - /// - /// Gets the IWatchlistsOperations. - /// - public virtual IWatchlistsOperations Watchlists { get; private set; } - - /// - /// Gets the IWatchlistItemsOperations. - /// - public virtual IWatchlistItemsOperations WatchlistItems { get; private set; } - /// /// Gets the IDataConnectorsOperations. /// public virtual IDataConnectorsOperations DataConnectors { get; private set; } - /// - /// Gets the IDataConnectorsCheckRequirementsOperations. - /// - public virtual IDataConnectorsCheckRequirementsOperations DataConnectorsCheckRequirements { get; private set; } - - /// - /// Gets the IThreatIntelligenceIndicatorOperations. - /// - public virtual IThreatIntelligenceIndicatorOperations ThreatIntelligenceIndicator { get; private set; } - - /// - /// Gets the IThreatIntelligenceIndicatorsOperations. - /// - public virtual IThreatIntelligenceIndicatorsOperations ThreatIntelligenceIndicators { get; private set; } - - /// - /// Gets the IThreatIntelligenceIndicatorMetricsOperations. - /// - public virtual IThreatIntelligenceIndicatorMetricsOperations ThreatIntelligenceIndicatorMetrics { get; private set; } - /// /// Gets the IOperations. /// public virtual IOperations Operations { get; private set; } /// - /// Gets the IOfficeConsentsOperations. + /// Gets the IIncidentsOperations. /// - public virtual IOfficeConsentsOperations OfficeConsents { get; private set; } + public virtual IIncidentsOperations Incidents { get; private set; } /// - /// Gets the IEntityQueryTemplatesOperations. + /// Gets the IIncidentCommentsOperations. /// - public virtual IEntityQueryTemplatesOperations EntityQueryTemplates { get; private set; } + public virtual IIncidentCommentsOperations IncidentComments { get; private set; } /// /// Initializes a new instance of the SecurityInsightsClient class. @@ -479,37 +359,13 @@ private void Initialize() AlertRules = new AlertRulesOperations(this); Actions = new ActionsOperations(this); AlertRuleTemplates = new AlertRuleTemplatesOperations(this); - AutomationRules = new AutomationRulesOperations(this); Bookmarks = new BookmarksOperations(this); - BookmarkRelations = new BookmarkRelationsOperations(this); - Bookmark = new BookmarkOperations(this); - IPGeodata = new IPGeodataOperations(this); - DomainWhois = new DomainWhoisOperations(this); - EntityQueries = new EntityQueriesOperations(this); - Entities = new EntitiesOperations(this); - EntitiesGetTimeline = new EntitiesGetTimelineOperations(this); - EntitiesRelations = new EntitiesRelationsOperations(this); - EntityRelations = new EntityRelationsOperations(this); - Incidents = new IncidentsOperations(this); - IncidentComments = new IncidentCommentsOperations(this); - IncidentRelations = new IncidentRelationsOperations(this); - Metadata = new MetadataOperations(this); - SentinelOnboardingStates = new SentinelOnboardingStatesOperations(this); - ProductSettings = new ProductSettingsOperations(this); - SourceControl = new SourceControlOperations(this); - SourceControls = new SourceControlsOperations(this); - Watchlists = new WatchlistsOperations(this); - WatchlistItems = new WatchlistItemsOperations(this); DataConnectors = new DataConnectorsOperations(this); - DataConnectorsCheckRequirements = new DataConnectorsCheckRequirementsOperations(this); - ThreatIntelligenceIndicator = new ThreatIntelligenceIndicatorOperations(this); - ThreatIntelligenceIndicators = new ThreatIntelligenceIndicatorsOperations(this); - ThreatIntelligenceIndicatorMetrics = new ThreatIntelligenceIndicatorMetricsOperations(this); Operations = new Operations(this); - OfficeConsents = new OfficeConsentsOperations(this); - EntityQueryTemplates = new EntityQueryTemplatesOperations(this); + Incidents = new IncidentsOperations(this); + IncidentComments = new IncidentCommentsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-09-01-preview"; + ApiVersion = "2020-01-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -543,30 +399,10 @@ 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("conditionType")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("conditionType")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("actionType")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("actionType")); - 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")); - 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")); 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")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SentinelOnboardingStatesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SentinelOnboardingStatesOperations.cs deleted file mode 100644 index 18e1fb271655c..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SentinelOnboardingStatesOperations.cs +++ /dev/null @@ -1,1026 +0,0 @@ -// -// 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; - - /// - /// SentinelOnboardingStatesOperations operations. - /// - internal partial class SentinelOnboardingStatesOperations : IServiceOperations, ISentinelOnboardingStatesOperations - { - /// - /// Initializes a new instance of the SentinelOnboardingStatesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal SentinelOnboardingStatesOperations(SecurityInsightsClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityInsightsClient - /// - public SecurityInsightsClient Client { get; private set; } - - /// - /// Get Sentinel onboarding state - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Sentinel onboarding state name. Supports - default - /// - /// - /// 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 sentinelOnboardingStateName, 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 (sentinelOnboardingStateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "sentinelOnboardingStateName"); - } - // 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("sentinelOnboardingStateName", sentinelOnboardingStateName); - 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/onboardingStates/{sentinelOnboardingStateName}").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("{sentinelOnboardingStateName}", System.Uri.EscapeDataString(sentinelOnboardingStateName)); - 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; - } - - /// - /// Create Sentinel onboarding state - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Sentinel onboarding state name. Supports - default - /// - /// - /// Etag of the azure resource - /// - /// - /// Flag that indicates the status of the CMK 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> CreateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string sentinelOnboardingStateName, string etag = default(string), bool? customerManagedKey = default(bool?), 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 (sentinelOnboardingStateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "sentinelOnboardingStateName"); - } - SentinelOnboardingState sentinelOnboardingStateParameter = default(SentinelOnboardingState); - if (etag != null || customerManagedKey != null) - { - sentinelOnboardingStateParameter = new SentinelOnboardingState(); - sentinelOnboardingStateParameter.Etag = etag; - sentinelOnboardingStateParameter.CustomerManagedKey = customerManagedKey; - } - // 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("sentinelOnboardingStateName", sentinelOnboardingStateName); - tracingParameters.Add("sentinelOnboardingStateParameter", sentinelOnboardingStateParameter); - 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/onboardingStates/{sentinelOnboardingStateName}").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("{sentinelOnboardingStateName}", System.Uri.EscapeDataString(sentinelOnboardingStateName)); - 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(sentinelOnboardingStateParameter != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(sentinelOnboardingStateParameter, 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 Sentinel onboarding state - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Sentinel onboarding state name. Supports - default - /// - /// - /// 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 sentinelOnboardingStateName, 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 (sentinelOnboardingStateName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "sentinelOnboardingStateName"); - } - // 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("sentinelOnboardingStateName", sentinelOnboardingStateName); - 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/onboardingStates/{sentinelOnboardingStateName}").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("{sentinelOnboardingStateName}", System.Uri.EscapeDataString(sentinelOnboardingStateName)); - 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 Sentinel onboarding states - /// - /// - /// 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/onboardingStates").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; - } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SentinelOnboardingStatesOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SentinelOnboardingStatesOperationsExtensions.cs deleted file mode 100644 index 63202eb8d6835..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SentinelOnboardingStatesOperationsExtensions.cs +++ /dev/null @@ -1,212 +0,0 @@ -// -// 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 SentinelOnboardingStatesOperations. - /// - public static partial class SentinelOnboardingStatesOperationsExtensions - { - /// - /// Get Sentinel onboarding state - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Sentinel onboarding state name. Supports - default - /// - public static SentinelOnboardingState Get(this ISentinelOnboardingStatesOperations operations, string resourceGroupName, string workspaceName, string sentinelOnboardingStateName) - { - return operations.GetAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName).GetAwaiter().GetResult(); - } - - /// - /// Get Sentinel onboarding state - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Sentinel onboarding state name. Supports - default - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISentinelOnboardingStatesOperations operations, string resourceGroupName, string workspaceName, string sentinelOnboardingStateName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create Sentinel onboarding state - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Sentinel onboarding state name. Supports - default - /// - /// - /// Etag of the azure resource - /// - /// - /// Flag that indicates the status of the CMK setting - /// - public static SentinelOnboardingState Create(this ISentinelOnboardingStatesOperations operations, string resourceGroupName, string workspaceName, string sentinelOnboardingStateName, string etag = default(string), bool? customerManagedKey = default(bool?)) - { - return operations.CreateAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, etag, customerManagedKey).GetAwaiter().GetResult(); - } - - /// - /// Create Sentinel onboarding state - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Sentinel onboarding state name. Supports - default - /// - /// - /// Etag of the azure resource - /// - /// - /// Flag that indicates the status of the CMK setting - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this ISentinelOnboardingStatesOperations operations, string resourceGroupName, string workspaceName, string sentinelOnboardingStateName, string etag = default(string), bool? customerManagedKey = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, etag, customerManagedKey, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete Sentinel onboarding state - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Sentinel onboarding state name. Supports - default - /// - public static void Delete(this ISentinelOnboardingStatesOperations operations, string resourceGroupName, string workspaceName, string sentinelOnboardingStateName) - { - operations.DeleteAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName).GetAwaiter().GetResult(); - } - - /// - /// Delete Sentinel onboarding state - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The Sentinel onboarding state name. Supports - default - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISentinelOnboardingStatesOperations operations, string resourceGroupName, string workspaceName, string sentinelOnboardingStateName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, sentinelOnboardingStateName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets all Sentinel onboarding states - /// - /// - /// 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 SentinelOnboardingStatesList List(this ISentinelOnboardingStatesOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } - - /// - /// Gets all Sentinel onboarding states - /// - /// - /// 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 ISentinelOnboardingStatesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlOperations.cs deleted file mode 100644 index 52efe50962bca..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlOperations.cs +++ /dev/null @@ -1,473 +0,0 @@ -// -// 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; - - /// - /// SourceControlOperations operations. - /// - internal partial class SourceControlOperations : IServiceOperations, ISourceControlOperations - { - /// - /// Initializes a new instance of the SourceControlOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal SourceControlOperations(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 a list of repositories metadata. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The repo type. Possible values include: 'Github', 'DevOps' - /// - /// - /// 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>> ListRepositoriesWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string repoType, 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 (repoType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "repoType"); - } - // 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("repoType", repoType); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListRepositories", 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/listRepositories").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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(repoType != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(repoType, 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) - { - 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 list of repositories metadata. - /// - /// - /// 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>> ListRepositoriesNextWithHttpMessagesAsync(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, "ListRepositoriesNext", 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // 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/SourceControlOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlOperationsExtensions.cs deleted file mode 100644 index 2c084adb4d8d8..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlOperationsExtensions.cs +++ /dev/null @@ -1,105 +0,0 @@ -// -// 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 SourceControlOperations. - /// - public static partial class SourceControlOperationsExtensions - { - /// - /// Gets a list of repositories metadata. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The repo type. Possible values include: 'Github', 'DevOps' - /// - public static IPage ListRepositories(this ISourceControlOperations operations, string resourceGroupName, string workspaceName, string repoType) - { - return operations.ListRepositoriesAsync(resourceGroupName, workspaceName, repoType).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of repositories metadata. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The repo type. Possible values include: 'Github', 'DevOps' - /// - /// - /// The cancellation token. - /// - public static async Task> ListRepositoriesAsync(this ISourceControlOperations operations, string resourceGroupName, string workspaceName, string repoType, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListRepositoriesWithHttpMessagesAsync(resourceGroupName, workspaceName, repoType, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a list of repositories metadata. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListRepositoriesNext(this ISourceControlOperations operations, string nextPageLink) - { - return operations.ListRepositoriesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets a list of repositories metadata. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListRepositoriesNextAsync(this ISourceControlOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListRepositoriesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlsOperations.cs deleted file mode 100644 index 8cec74d24f476..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlsOperations.cs +++ /dev/null @@ -1,1197 +0,0 @@ -// -// 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; - - /// - /// SourceControlsOperations operations. - /// - internal partial class SourceControlsOperations : IServiceOperations, ISourceControlsOperations - { - /// - /// Initializes a new instance of the SourceControlsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal SourceControlsOperations(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 source controls, without source control items. - /// - /// - /// 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/sourcecontrols").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 a source control byt its identifier. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Source control 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 sourceControlId, 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 (sourceControlId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "sourceControlId"); - } - // 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("sourceControlId", sourceControlId); - 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/sourcecontrols/{sourceControlId}").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("{sourceControlId}", System.Uri.EscapeDataString(sourceControlId)); - 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; - } - - /// - /// Delete a source control. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Source control Id - /// - /// - /// 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 sourceControlId, 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 (sourceControlId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "sourceControlId"); - } - // 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("sourceControlId", sourceControlId); - 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/sourcecontrols/{sourceControlId}").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("{sourceControlId}", System.Uri.EscapeDataString(sourceControlId)); - 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; - } - - /// - /// Creates a source control. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Source control Id - /// - /// - /// The SourceControl - /// - /// - /// 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 sourceControlId, SourceControl sourceControl, 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 (sourceControlId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "sourceControlId"); - } - if (sourceControl == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "sourceControl"); - } - if (sourceControl != null) - { - sourceControl.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("sourceControlId", sourceControlId); - tracingParameters.Add("sourceControl", sourceControl); - 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/sourcecontrols/{sourceControlId}").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("{sourceControlId}", System.Uri.EscapeDataString(sourceControlId)); - 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(sourceControl != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(sourceControl, 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; - } - - /// - /// Gets all source controls, without source control items. - /// - /// - /// 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/SourceControlsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlsOperationsExtensions.cs deleted file mode 100644 index 4311175621254..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/SourceControlsOperationsExtensions.cs +++ /dev/null @@ -1,240 +0,0 @@ -// -// 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 SourceControlsOperations. - /// - public static partial class SourceControlsOperationsExtensions - { - /// - /// Gets all source controls, without source control items. - /// - /// - /// 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 ISourceControlsOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } - - /// - /// Gets all source controls, without source control items. - /// - /// - /// 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 ISourceControlsOperations 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 a source control byt its identifier. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Source control Id - /// - public static SourceControl Get(this ISourceControlsOperations operations, string resourceGroupName, string workspaceName, string sourceControlId) - { - return operations.GetAsync(resourceGroupName, workspaceName, sourceControlId).GetAwaiter().GetResult(); - } - - /// - /// Gets a source control byt its identifier. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Source control Id - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ISourceControlsOperations operations, string resourceGroupName, string workspaceName, string sourceControlId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, sourceControlId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete a source control. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Source control Id - /// - public static void Delete(this ISourceControlsOperations operations, string resourceGroupName, string workspaceName, string sourceControlId) - { - operations.DeleteAsync(resourceGroupName, workspaceName, sourceControlId).GetAwaiter().GetResult(); - } - - /// - /// Delete a source control. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Source control Id - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this ISourceControlsOperations operations, string resourceGroupName, string workspaceName, string sourceControlId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, sourceControlId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates a source control. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Source control Id - /// - /// - /// The SourceControl - /// - public static SourceControl Create(this ISourceControlsOperations operations, string resourceGroupName, string workspaceName, string sourceControlId, SourceControl sourceControl) - { - return operations.CreateAsync(resourceGroupName, workspaceName, sourceControlId, sourceControl).GetAwaiter().GetResult(); - } - - /// - /// Creates a source control. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Source control Id - /// - /// - /// The SourceControl - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this ISourceControlsOperations operations, string resourceGroupName, string workspaceName, string sourceControlId, SourceControl sourceControl, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, workspaceName, sourceControlId, sourceControl, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all source controls, without source control items. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this ISourceControlsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all source controls, without source control items. - /// - /// - /// 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 ISourceControlsOperations 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/ThreatIntelligenceIndicatorMetricsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorMetricsOperations.cs deleted file mode 100644 index 4eb4dd4f4c81d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorMetricsOperations.cs +++ /dev/null @@ -1,287 +0,0 @@ -// -// 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; - - /// - /// ThreatIntelligenceIndicatorMetricsOperations operations. - /// - internal partial class ThreatIntelligenceIndicatorMetricsOperations : IServiceOperations, IThreatIntelligenceIndicatorMetricsOperations - { - /// - /// Initializes a new instance of the ThreatIntelligenceIndicatorMetricsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal ThreatIntelligenceIndicatorMetricsOperations(SecurityInsightsClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityInsightsClient - /// - public SecurityInsightsClient Client { get; private set; } - - /// - /// Get threat intelligence indicators metrics (Indicators counts by Type, - /// Threat Type, Source). - /// - /// - /// 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/threatIntelligence/main/metrics").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; - } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorMetricsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorMetricsOperationsExtensions.cs deleted file mode 100644 index 6728074360c4e..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorMetricsOperationsExtensions.cs +++ /dev/null @@ -1,67 +0,0 @@ -// -// 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 ThreatIntelligenceIndicatorMetricsOperations. - /// - public static partial class ThreatIntelligenceIndicatorMetricsOperationsExtensions - { - /// - /// Get threat intelligence indicators metrics (Indicators counts by Type, - /// Threat Type, Source). - /// - /// - /// 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 ThreatIntelligenceMetricsList List(this IThreatIntelligenceIndicatorMetricsOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } - - /// - /// Get threat intelligence indicators metrics (Indicators counts by Type, - /// Threat Type, Source). - /// - /// - /// 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 IThreatIntelligenceIndicatorMetricsOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorOperations.cs deleted file mode 100644 index f3e3b0c3cf249..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorOperations.cs +++ /dev/null @@ -1,1961 +0,0 @@ -// -// 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; - - /// - /// ThreatIntelligenceIndicatorOperations operations. - /// - internal partial class ThreatIntelligenceIndicatorOperations : IServiceOperations, IThreatIntelligenceIndicatorOperations - { - /// - /// Initializes a new instance of the ThreatIntelligenceIndicatorOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal ThreatIntelligenceIndicatorOperations(SecurityInsightsClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityInsightsClient - /// - public SecurityInsightsClient Client { get; private set; } - - /// - /// Create a new threat intelligence indicator. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Properties of threat intelligence indicators to create and update. - /// - /// - /// 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> CreateIndicatorWithHttpMessagesAsync(string resourceGroupName, string workspaceName, ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, 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 (threatIntelligenceProperties == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "threatIntelligenceProperties"); - } - // 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("threatIntelligenceProperties", threatIntelligenceProperties); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateIndicator", 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/threatIntelligence/main/createIndicator").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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(threatIntelligenceProperties != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(threatIntelligenceProperties, 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; - } - - /// - /// View a threat intelligence indicator by name. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// 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 name, 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 (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - // 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("name", name); - 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/threatIntelligence/main/indicators/{name}").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("{name}", System.Uri.EscapeDataString(name)); - 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; - } - - /// - /// Update a threat Intelligence indicator. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// Properties of threat intelligence indicators to create and update. - /// - /// - /// 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 name, ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, 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 (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (threatIntelligenceProperties == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "threatIntelligenceProperties"); - } - // 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("name", name); - tracingParameters.Add("threatIntelligenceProperties", threatIntelligenceProperties); - 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/threatIntelligence/main/indicators/{name}").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("{name}", System.Uri.EscapeDataString(name)); - 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(threatIntelligenceProperties != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(threatIntelligenceProperties, 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 a threat intelligence indicator. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// 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 name, 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 (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - // 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("name", name); - 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/threatIntelligence/main/indicators/{name}").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("{name}", System.Uri.EscapeDataString(name)); - 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; - } - - /// - /// Query threat intelligence indicators as per filtering criteria. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Filtering criteria for querying threat intelligence indicators. - /// - /// - /// 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>> QueryIndicatorsWithHttpMessagesAsync(string resourceGroupName, string workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, 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 (threatIntelligenceFilteringCriteria == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "threatIntelligenceFilteringCriteria"); - } - // 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("threatIntelligenceFilteringCriteria", threatIntelligenceFilteringCriteria); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "QueryIndicators", 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/threatIntelligence/main/queryIndicators").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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(threatIntelligenceFilteringCriteria != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(threatIntelligenceFilteringCriteria, 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) - { - 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; - } - - /// - /// Append tags to a threat intelligence indicator. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// List of tags to be appended. - /// - /// - /// 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 AppendTagsWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string name, IList threatIntelligenceTags = default(IList), 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 (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - ThreatIntelligenceAppendTags threatIntelligenceAppendTags = new ThreatIntelligenceAppendTags(); - if (threatIntelligenceTags != null) - { - threatIntelligenceAppendTags.ThreatIntelligenceTags = threatIntelligenceTags; - } - // 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("name", name); - tracingParameters.Add("threatIntelligenceAppendTags", threatIntelligenceAppendTags); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "AppendTags", 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/threatIntelligence/main/indicators/{name}/appendTags").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("{name}", System.Uri.EscapeDataString(name)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(threatIntelligenceAppendTags != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(threatIntelligenceAppendTags, 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) - { - 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; - } - - /// - /// Replace tags added to a threat intelligence indicator. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// Tags in the threat intelligence indicator to be replaced. - /// - /// - /// 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> ReplaceTagsWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string name, ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags, 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 (name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "name"); - } - if (threatIntelligenceReplaceTags == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "threatIntelligenceReplaceTags"); - } - // 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("name", name); - tracingParameters.Add("threatIntelligenceReplaceTags", threatIntelligenceReplaceTags); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ReplaceTags", 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/threatIntelligence/main/indicators/{name}/replaceTags").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("{name}", System.Uri.EscapeDataString(name)); - 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(threatIntelligenceReplaceTags != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(threatIntelligenceReplaceTags, 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) - { - 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; - } - - /// - /// Query threat intelligence indicators as per filtering criteria. - /// - /// - /// 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>> QueryIndicatorsNextWithHttpMessagesAsync(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, "QueryIndicatorsNext", 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("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // 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/ThreatIntelligenceIndicatorOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorOperationsExtensions.cs deleted file mode 100644 index f2e73ce36158e..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorOperationsExtensions.cs +++ /dev/null @@ -1,395 +0,0 @@ -// -// 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; - - /// - /// Extension methods for ThreatIntelligenceIndicatorOperations. - /// - public static partial class ThreatIntelligenceIndicatorOperationsExtensions - { - /// - /// Create a new threat intelligence indicator. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Properties of threat intelligence indicators to create and update. - /// - public static ThreatIntelligenceInformation CreateIndicator(this IThreatIntelligenceIndicatorOperations operations, string resourceGroupName, string workspaceName, ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties) - { - return operations.CreateIndicatorAsync(resourceGroupName, workspaceName, threatIntelligenceProperties).GetAwaiter().GetResult(); - } - - /// - /// Create a new threat intelligence indicator. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Properties of threat intelligence indicators to create and update. - /// - /// - /// The cancellation token. - /// - public static async Task CreateIndicatorAsync(this IThreatIntelligenceIndicatorOperations operations, string resourceGroupName, string workspaceName, ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateIndicatorWithHttpMessagesAsync(resourceGroupName, workspaceName, threatIntelligenceProperties, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// View a threat intelligence indicator by name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - public static ThreatIntelligenceInformation Get(this IThreatIntelligenceIndicatorOperations operations, string resourceGroupName, string workspaceName, string name) - { - return operations.GetAsync(resourceGroupName, workspaceName, name).GetAwaiter().GetResult(); - } - - /// - /// View a threat intelligence indicator by name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IThreatIntelligenceIndicatorOperations operations, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, name, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Update a threat Intelligence indicator. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// Properties of threat intelligence indicators to create and update. - /// - public static ThreatIntelligenceInformation Create(this IThreatIntelligenceIndicatorOperations operations, string resourceGroupName, string workspaceName, string name, ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties) - { - return operations.CreateAsync(resourceGroupName, workspaceName, name, threatIntelligenceProperties).GetAwaiter().GetResult(); - } - - /// - /// Update a threat Intelligence indicator. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// Properties of threat intelligence indicators to create and update. - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IThreatIntelligenceIndicatorOperations operations, string resourceGroupName, string workspaceName, string name, ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceProperties, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, workspaceName, name, threatIntelligenceProperties, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete a threat intelligence indicator. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - public static void Delete(this IThreatIntelligenceIndicatorOperations operations, string resourceGroupName, string workspaceName, string name) - { - operations.DeleteAsync(resourceGroupName, workspaceName, name).GetAwaiter().GetResult(); - } - - /// - /// Delete a threat intelligence indicator. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IThreatIntelligenceIndicatorOperations operations, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Query threat intelligence indicators as per filtering criteria. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Filtering criteria for querying threat intelligence indicators. - /// - public static IPage QueryIndicators(this IThreatIntelligenceIndicatorOperations operations, string resourceGroupName, string workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria) - { - return operations.QueryIndicatorsAsync(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria).GetAwaiter().GetResult(); - } - - /// - /// Query threat intelligence indicators as per filtering criteria. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Filtering criteria for querying threat intelligence indicators. - /// - /// - /// The cancellation token. - /// - public static async Task> QueryIndicatorsAsync(this IThreatIntelligenceIndicatorOperations operations, string resourceGroupName, string workspaceName, ThreatIntelligenceFilteringCriteria threatIntelligenceFilteringCriteria, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.QueryIndicatorsWithHttpMessagesAsync(resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Append tags to a threat intelligence indicator. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// List of tags to be appended. - /// - public static void AppendTags(this IThreatIntelligenceIndicatorOperations operations, string resourceGroupName, string workspaceName, string name, IList threatIntelligenceTags = default(IList)) - { - operations.AppendTagsAsync(resourceGroupName, workspaceName, name, threatIntelligenceTags).GetAwaiter().GetResult(); - } - - /// - /// Append tags to a threat intelligence indicator. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// List of tags to be appended. - /// - /// - /// The cancellation token. - /// - public static async Task AppendTagsAsync(this IThreatIntelligenceIndicatorOperations operations, string resourceGroupName, string workspaceName, string name, IList threatIntelligenceTags = default(IList), CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.AppendTagsWithHttpMessagesAsync(resourceGroupName, workspaceName, name, threatIntelligenceTags, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Replace tags added to a threat intelligence indicator. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// Tags in the threat intelligence indicator to be replaced. - /// - public static ThreatIntelligenceInformation ReplaceTags(this IThreatIntelligenceIndicatorOperations operations, string resourceGroupName, string workspaceName, string name, ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags) - { - return operations.ReplaceTagsAsync(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags).GetAwaiter().GetResult(); - } - - /// - /// Replace tags added to a threat intelligence indicator. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Threat intelligence indicator name field. - /// - /// - /// Tags in the threat intelligence indicator to be replaced. - /// - /// - /// The cancellation token. - /// - public static async Task ReplaceTagsAsync(this IThreatIntelligenceIndicatorOperations operations, string resourceGroupName, string workspaceName, string name, ThreatIntelligenceIndicatorModelForRequestBody threatIntelligenceReplaceTags, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ReplaceTagsWithHttpMessagesAsync(resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Query threat intelligence indicators as per filtering criteria. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage QueryIndicatorsNext(this IThreatIntelligenceIndicatorOperations operations, string nextPageLink) - { - return operations.QueryIndicatorsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Query threat intelligence indicators as per filtering criteria. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> QueryIndicatorsNextAsync(this IThreatIntelligenceIndicatorOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.QueryIndicatorsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorsOperations.cs deleted file mode 100644 index 19ef9d524c634..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorsOperations.cs +++ /dev/null @@ -1,494 +0,0 @@ -// -// 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; - - /// - /// ThreatIntelligenceIndicatorsOperations operations. - /// - internal partial class ThreatIntelligenceIndicatorsOperations : IServiceOperations, IThreatIntelligenceIndicatorsOperations - { - /// - /// Initializes a new instance of the ThreatIntelligenceIndicatorsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal ThreatIntelligenceIndicatorsOperations(SecurityInsightsClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityInsightsClient - /// - public SecurityInsightsClient Client { get; private set; } - - /// - /// Get all threat intelligence indicators. - /// - /// - /// 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/threatIntelligence/main/indicators").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; - } - - /// - /// Get all threat intelligence indicators. - /// - /// - /// 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/ThreatIntelligenceIndicatorsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorsOperationsExtensions.cs deleted file mode 100644 index 4cc14ece77461..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ThreatIntelligenceIndicatorsOperationsExtensions.cs +++ /dev/null @@ -1,129 +0,0 @@ -// -// 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 ThreatIntelligenceIndicatorsOperations. - /// - public static partial class ThreatIntelligenceIndicatorsOperationsExtensions - { - /// - /// Get all threat intelligence indicators. - /// - /// - /// 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 IThreatIntelligenceIndicatorsOperations 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(); - } - - /// - /// Get all threat intelligence indicators. - /// - /// - /// 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 IThreatIntelligenceIndicatorsOperations 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; - } - } - - /// - /// Get all threat intelligence indicators. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IThreatIntelligenceIndicatorsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Get all threat intelligence indicators. - /// - /// - /// 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 IThreatIntelligenceIndicatorsOperations 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/WatchlistItemsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistItemsOperations.cs deleted file mode 100644 index ac6a5c2e2718d..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistItemsOperations.cs +++ /dev/null @@ -1,1233 +0,0 @@ -// -// 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; - - /// - /// WatchlistItemsOperations operations. - /// - internal partial class WatchlistItemsOperations : IServiceOperations, IWatchlistItemsOperations - { - /// - /// Initializes a new instance of the WatchlistItemsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal WatchlistItemsOperations(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 watchlist Items. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// 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 watchlistAlias, 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 (watchlistAlias == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "watchlistAlias"); - } - // 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("watchlistAlias", watchlistAlias); - 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/watchlists/{watchlistAlias}/watchlistItems").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("{watchlistAlias}", System.Uri.EscapeDataString(watchlistAlias)); - 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 a watchlist, without its watchlist items. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// Watchlist Item Id (GUID) - /// - /// - /// 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 watchlistAlias, string watchlistItemId, 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 (watchlistAlias == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "watchlistAlias"); - } - if (watchlistItemId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "watchlistItemId"); - } - // 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("watchlistAlias", watchlistAlias); - tracingParameters.Add("watchlistItemId", watchlistItemId); - 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/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}").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("{watchlistAlias}", System.Uri.EscapeDataString(watchlistAlias)); - _url = _url.Replace("{watchlistItemId}", System.Uri.EscapeDataString(watchlistItemId)); - 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; - } - - /// - /// Delete a watchlist item. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// Watchlist Item Id (GUID) - /// - /// - /// 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 watchlistAlias, string watchlistItemId, 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 (watchlistAlias == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "watchlistAlias"); - } - if (watchlistItemId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "watchlistItemId"); - } - // 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("watchlistAlias", watchlistAlias); - tracingParameters.Add("watchlistItemId", watchlistItemId); - 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/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}").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("{watchlistAlias}", System.Uri.EscapeDataString(watchlistAlias)); - _url = _url.Replace("{watchlistItemId}", System.Uri.EscapeDataString(watchlistItemId)); - 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; - } - - /// - /// Creates or updates a watchlist item. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// Watchlist Item Id (GUID) - /// - /// - /// The watchlist item - /// - /// - /// 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 watchlistAlias, string watchlistItemId, WatchlistItem watchlistItem, 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 (watchlistAlias == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "watchlistAlias"); - } - if (watchlistItemId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "watchlistItemId"); - } - if (watchlistItem == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "watchlistItem"); - } - if (watchlistItem != null) - { - watchlistItem.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("watchlistAlias", watchlistAlias); - tracingParameters.Add("watchlistItemId", watchlistItemId); - tracingParameters.Add("watchlistItem", watchlistItem); - 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/watchlists/{watchlistAlias}/watchlistItems/{watchlistItemId}").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("{watchlistAlias}", System.Uri.EscapeDataString(watchlistAlias)); - _url = _url.Replace("{watchlistItemId}", System.Uri.EscapeDataString(watchlistItemId)); - 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(watchlistItem != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(watchlistItem, 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; - } - - /// - /// Gets all watchlist Items. - /// - /// - /// 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/WatchlistItemsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistItemsOperationsExtensions.cs deleted file mode 100644 index 6bee5dac343f4..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistItemsOperationsExtensions.cs +++ /dev/null @@ -1,264 +0,0 @@ -// -// 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 WatchlistItemsOperations. - /// - public static partial class WatchlistItemsOperationsExtensions - { - /// - /// Gets all watchlist Items. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - public static IPage List(this IWatchlistItemsOperations operations, string resourceGroupName, string workspaceName, string watchlistAlias) - { - return operations.ListAsync(resourceGroupName, workspaceName, watchlistAlias).GetAwaiter().GetResult(); - } - - /// - /// Gets all watchlist Items. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IWatchlistItemsOperations operations, string resourceGroupName, string workspaceName, string watchlistAlias, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, workspaceName, watchlistAlias, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets a watchlist, without its watchlist items. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// Watchlist Item Id (GUID) - /// - public static WatchlistItem Get(this IWatchlistItemsOperations operations, string resourceGroupName, string workspaceName, string watchlistAlias, string watchlistItemId) - { - return operations.GetAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId).GetAwaiter().GetResult(); - } - - /// - /// Gets a watchlist, without its watchlist items. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// Watchlist Item Id (GUID) - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IWatchlistItemsOperations operations, string resourceGroupName, string workspaceName, string watchlistAlias, string watchlistItemId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete a watchlist item. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// Watchlist Item Id (GUID) - /// - public static void Delete(this IWatchlistItemsOperations operations, string resourceGroupName, string workspaceName, string watchlistAlias, string watchlistItemId) - { - operations.DeleteAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId).GetAwaiter().GetResult(); - } - - /// - /// Delete a watchlist item. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// Watchlist Item Id (GUID) - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IWatchlistItemsOperations operations, string resourceGroupName, string workspaceName, string watchlistAlias, string watchlistItemId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a watchlist item. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// Watchlist Item Id (GUID) - /// - /// - /// The watchlist item - /// - public static WatchlistItem CreateOrUpdate(this IWatchlistItemsOperations operations, string resourceGroupName, string workspaceName, string watchlistAlias, string watchlistItemId, WatchlistItem watchlistItem) - { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, watchlistItem).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a watchlist item. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// Watchlist Item Id (GUID) - /// - /// - /// The watchlist item - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IWatchlistItemsOperations operations, string resourceGroupName, string workspaceName, string watchlistAlias, string watchlistItemId, WatchlistItem watchlistItem, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, watchlistAlias, watchlistItemId, watchlistItem, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all watchlist Items. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IWatchlistItemsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all watchlist Items. - /// - /// - /// 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 IWatchlistItemsOperations 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/WatchlistsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistsOperations.cs deleted file mode 100644 index c550b0269f33f..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistsOperations.cs +++ /dev/null @@ -1,1199 +0,0 @@ -// -// 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; - - /// - /// WatchlistsOperations operations. - /// - internal partial class WatchlistsOperations : IServiceOperations, IWatchlistsOperations - { - /// - /// Initializes a new instance of the WatchlistsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal WatchlistsOperations(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 watchlists, without watchlist items. - /// - /// - /// 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/watchlists").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 a watchlist, without its watchlist items. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// 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 watchlistAlias, 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 (watchlistAlias == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "watchlistAlias"); - } - // 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("watchlistAlias", watchlistAlias); - 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/watchlists/{watchlistAlias}").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("{watchlistAlias}", System.Uri.EscapeDataString(watchlistAlias)); - 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; - } - - /// - /// Delete a watchlist. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// 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 watchlistAlias, 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 (watchlistAlias == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "watchlistAlias"); - } - // 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("watchlistAlias", watchlistAlias); - 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/watchlists/{watchlistAlias}").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("{watchlistAlias}", System.Uri.EscapeDataString(watchlistAlias)); - 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; - } - - /// - /// Creates or updates a watchlist and its watchlist items (bulk creation, e.g. - /// through text/csv content type). To create a Watchlist and its items, we - /// should call this endpoint with rawContent and contentType properties. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// The watchlist - /// - /// - /// 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 watchlistAlias, Watchlist watchlist, 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 (watchlistAlias == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "watchlistAlias"); - } - if (watchlist == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "watchlist"); - } - if (watchlist != null) - { - watchlist.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("watchlistAlias", watchlistAlias); - tracingParameters.Add("watchlist", watchlist); - 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/watchlists/{watchlistAlias}").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("{watchlistAlias}", System.Uri.EscapeDataString(watchlistAlias)); - 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(watchlist != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(watchlist, 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; - } - - /// - /// Gets all watchlists, without watchlist items. - /// - /// - /// 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/WatchlistsOperationsExtensions.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistsOperationsExtensions.cs deleted file mode 100644 index 4ccfc5966948a..0000000000000 --- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/WatchlistsOperationsExtensions.cs +++ /dev/null @@ -1,244 +0,0 @@ -// -// 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 WatchlistsOperations. - /// - public static partial class WatchlistsOperationsExtensions - { - /// - /// Gets all watchlists, without watchlist items. - /// - /// - /// 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 IWatchlistsOperations operations, string resourceGroupName, string workspaceName) - { - return operations.ListAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); - } - - /// - /// Gets all watchlists, without watchlist items. - /// - /// - /// 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 IWatchlistsOperations 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 a watchlist, without its watchlist items. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - public static Watchlist Get(this IWatchlistsOperations operations, string resourceGroupName, string workspaceName, string watchlistAlias) - { - return operations.GetAsync(resourceGroupName, workspaceName, watchlistAlias).GetAwaiter().GetResult(); - } - - /// - /// Gets a watchlist, without its watchlist items. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IWatchlistsOperations operations, string resourceGroupName, string workspaceName, string watchlistAlias, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, watchlistAlias, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete a watchlist. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - public static void Delete(this IWatchlistsOperations operations, string resourceGroupName, string workspaceName, string watchlistAlias) - { - operations.DeleteAsync(resourceGroupName, workspaceName, watchlistAlias).GetAwaiter().GetResult(); - } - - /// - /// Delete a watchlist. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IWatchlistsOperations operations, string resourceGroupName, string workspaceName, string watchlistAlias, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, watchlistAlias, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates or updates a watchlist and its watchlist items (bulk creation, e.g. - /// through text/csv content type). To create a Watchlist and its items, we - /// should call this endpoint with rawContent and contentType properties. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// The watchlist - /// - public static Watchlist CreateOrUpdate(this IWatchlistsOperations operations, string resourceGroupName, string workspaceName, string watchlistAlias, Watchlist watchlist) - { - return operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, watchlistAlias, watchlist).GetAwaiter().GetResult(); - } - - /// - /// Creates or updates a watchlist and its watchlist items (bulk creation, e.g. - /// through text/csv content type). To create a Watchlist and its items, we - /// should call this endpoint with rawContent and contentType properties. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// Watchlist Alias - /// - /// - /// The watchlist - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IWatchlistsOperations operations, string resourceGroupName, string workspaceName, string watchlistAlias, Watchlist watchlist, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, watchlistAlias, watchlist, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets all watchlists, without watchlist items. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IWatchlistsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets all watchlists, without watchlist items. - /// - /// - /// 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 IWatchlistsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -}