From d26dbc2867670d7bce447d8ff52c4ab50590ee6e Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 7 May 2021 03:59:34 +0000 Subject: [PATCH] CodeGen from PR 14227 in Azure/azure-rest-api-specs Merge 23638a2a188ea8e003eda47420ac8dcaee587682 into 5be09d07fc980922a8a5a3fdec8af809348867a2 --- .../src/Generated/ClustersOperations.cs | 2 +- .../IOperationalInsightsManagementClient.cs | 10 ++--- .../src/Generated/ITablesOperations.cs | 7 ++-- .../src/Generated/LinkedServicesOperations.cs | 4 +- .../src/Generated/Models/Table.cs | 41 +++---------------- .../src/Generated/Models/WorkspaceSku.cs | 13 +----- .../OperationalInsightsManagementClient.cs | 12 +++--- ...nfo_OperationalInsightsManagementClient.cs | 13 +----- .../src/Generated/TablesOperations.cs | 26 ++++++++---- .../Generated/TablesOperationsExtensions.cs | 18 ++++---- 10 files changed, 54 insertions(+), 92 deletions(-) diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperations.cs index 927177097c59..10e2f1a1899c 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperations.cs @@ -1321,7 +1321,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperationalInsightsManagementClient.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperationalInsightsManagementClient.cs index 86c103586017..cb2480311f55 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperationalInsightsManagementClient.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperationalInsightsManagementClient.cs @@ -139,6 +139,11 @@ public partial interface IOperationalInsightsManagementClient : System.IDisposab /// IWorkspacePurgeOperations WorkspacePurge { get; } + /// + /// Gets the ITablesOperations. + /// + ITablesOperations Tables { get; } + /// /// Gets the IClustersOperations. /// @@ -149,11 +154,6 @@ public partial interface IOperationalInsightsManagementClient : System.IDisposab /// IOperations Operations { get; } - /// - /// Gets the ITablesOperations. - /// - ITablesOperations Tables { get; } - /// /// Gets the IWorkspacesOperations. /// diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs index c8f8aa790a4e..025b88ee9237 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs @@ -60,8 +60,9 @@ public partial interface ITablesOperations /// /// The name of the table. /// - /// - /// The parameters required to update table properties. + /// + /// The data table data retention in days, between 30 and 730. Setting + /// this property to null will default to the workspace retention. /// /// /// The headers that will be added to request. @@ -78,7 +79,7 @@ public partial interface ITablesOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, int? retentionInDays = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a Log Analytics workspace table. /// diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedServicesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedServicesOperations.cs index 9ae36bd3f30d..ae5cfc38b7c2 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedServicesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedServicesOperations.cs @@ -761,7 +761,7 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1019,7 +1019,7 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Table.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Table.cs index afd2355aae7d..cb912d5f41a5 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Table.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Table.cs @@ -39,22 +39,12 @@ public Table() /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" /// The data table data retention in - /// days, between 7 and 730. Setting this property to null will default - /// to the workspace retention. - /// Specifies if - /// IsTroubleshootingEnabled property can be set for this - /// table. - /// Enable or disable troubleshoot - /// for this table. - /// Last time when troubleshooting - /// was set for this table. - public Table(string id = default(string), string name = default(string), string type = default(string), int? retentionInDays = default(int?), bool? isTroubleshootingAllowed = default(bool?), bool? isTroubleshootEnabled = default(bool?), string lastTroubleshootDate = default(string)) + /// days, between 30 and 730. Setting this property to null will + /// default to the workspace retention. + public Table(string id = default(string), string name = default(string), string type = default(string), int? retentionInDays = default(int?)) : base(id, name, type) { RetentionInDays = retentionInDays; - IsTroubleshootingAllowed = isTroubleshootingAllowed; - IsTroubleshootEnabled = isTroubleshootEnabled; - LastTroubleshootDate = lastTroubleshootDate; CustomInit(); } @@ -64,32 +54,13 @@ public Table() partial void CustomInit(); /// - /// Gets or sets the data table data retention in days, between 7 and + /// Gets or sets the data table data retention in days, between 30 and /// 730. Setting this property to null will default to the workspace /// retention. /// [JsonProperty(PropertyName = "properties.retentionInDays")] public int? RetentionInDays { get; set; } - /// - /// Gets specifies if IsTroubleshootingEnabled property can be set for - /// this table. - /// - [JsonProperty(PropertyName = "properties.isTroubleshootingAllowed")] - public bool? IsTroubleshootingAllowed { get; private set; } - - /// - /// Gets or sets enable or disable troubleshoot for this table. - /// - [JsonProperty(PropertyName = "properties.isTroubleshootEnabled")] - public bool? IsTroubleshootEnabled { get; set; } - - /// - /// Gets last time when troubleshooting was set for this table. - /// - [JsonProperty(PropertyName = "properties.lastTroubleshootDate")] - public string LastTroubleshootDate { get; private set; } - /// /// Validate the object. /// @@ -102,9 +73,9 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMaximum, "RetentionInDays", 730); } - if (RetentionInDays < 7) + if (RetentionInDays < 30) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", 7); + throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", 30); } } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceSku.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceSku.cs index 4544409f382e..9870c99eb53d 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceSku.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceSku.cs @@ -36,16 +36,12 @@ public WorkspaceSku() /// The capacity reservation /// level for this workspace, when CapacityReservation sku is /// selected. - /// The maximum capacity - /// reservation level available for this workspace, when - /// CapacityReservation sku is selected. /// The last time when the sku was /// updated. - public WorkspaceSku(string name, int? capacityReservationLevel = default(int?), int? maxCapacityReservationLevel = default(int?), string lastSkuUpdate = default(string)) + public WorkspaceSku(string name, int? capacityReservationLevel = default(int?), string lastSkuUpdate = default(string)) { Name = name; CapacityReservationLevel = capacityReservationLevel; - MaxCapacityReservationLevel = maxCapacityReservationLevel; LastSkuUpdate = lastSkuUpdate; CustomInit(); } @@ -70,13 +66,6 @@ public WorkspaceSku() [JsonProperty(PropertyName = "capacityReservationLevel")] public int? CapacityReservationLevel { get; set; } - /// - /// Gets the maximum capacity reservation level available for this - /// workspace, when CapacityReservation sku is selected. - /// - [JsonProperty(PropertyName = "maxCapacityReservationLevel")] - public int? MaxCapacityReservationLevel { get; private set; } - /// /// Gets the last time when the sku was updated. /// diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationalInsightsManagementClient.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationalInsightsManagementClient.cs index 96bbd379fa5d..be3cc94869c9 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationalInsightsManagementClient.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationalInsightsManagementClient.cs @@ -144,6 +144,11 @@ public partial class OperationalInsightsManagementClient : ServiceClient public virtual IWorkspacePurgeOperations WorkspacePurge { get; private set; } + /// + /// Gets the ITablesOperations. + /// + public virtual ITablesOperations Tables { get; private set; } + /// /// Gets the IClustersOperations. /// @@ -154,11 +159,6 @@ public partial class OperationalInsightsManagementClient : ServiceClient public virtual IOperations Operations { get; private set; } - /// - /// Gets the ITablesOperations. - /// - public virtual ITablesOperations Tables { get; private set; } - /// /// Gets the IWorkspacesOperations. /// @@ -425,9 +425,9 @@ private void Initialize() Gateways = new GatewaysOperations(this); Schema = new SchemaOperations(this); WorkspacePurge = new WorkspacePurgeOperations(this); + Tables = new TablesOperations(this); Clusters = new ClustersOperations(this); Operations = new Operations(this); - Tables = new TablesOperations(this); Workspaces = new WorkspacesOperations(this); DeletedWorkspaces = new DeletedWorkspacesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SdkInfo_OperationalInsightsManagementClient.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SdkInfo_OperationalInsightsManagementClient.cs index 4ef8c223541c..b38c654c98a8 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SdkInfo_OperationalInsightsManagementClient.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SdkInfo_OperationalInsightsManagementClient.cs @@ -35,23 +35,12 @@ public static IEnumerable> ApiInfo_OperationalInsi new Tuple("OperationalInsights", "Schema", "2020-08-01"), new Tuple("OperationalInsights", "SharedKeys", "2020-08-01"), new Tuple("OperationalInsights", "StorageInsightConfigs", "2020-08-01"), - new Tuple("OperationalInsights", "Tables", "2020-10-01"), + new Tuple("OperationalInsights", "Tables", "2020-08-01"), new Tuple("OperationalInsights", "Usages", "2020-08-01"), new Tuple("OperationalInsights", "WorkspacePurge", "2020-08-01"), new Tuple("OperationalInsights", "Workspaces", "2020-10-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/master/specification/operationalinsights/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\One\\SDK_repos\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "e5839301dfd424559851119c99ef0a2699fbd228"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs index 194ae186e9cc..df656c603066 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs @@ -131,7 +131,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - string apiVersion = "2020-10-01"; + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -288,8 +288,9 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// The name of the table. /// - /// - /// The parameters required to update table properties. + /// + /// The data table data retention in days, between 30 and 730. Setting this + /// property to null will default to the workspace retention. /// /// /// Headers that will be added to request. @@ -312,7 +313,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, int? retentionInDays = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -367,11 +368,20 @@ internal TablesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } - if (parameters == null) + if (retentionInDays > 730) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.InclusiveMaximum, "retentionInDays", 730); + } + if (retentionInDays < 30) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "retentionInDays", 30); + } + string apiVersion = "2020-08-01"; + Table parameters = new Table(); + if (retentionInDays != null) + { + parameters.RetentionInDays = retentionInDays; } - string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -613,7 +623,7 @@ internal TablesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); } - string apiVersion = "2020-10-01"; + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs index 9578086d4a28..f73975ec44bf 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs @@ -78,12 +78,13 @@ public static IEnumerable ListByWorkspace(this ITablesOperations operatio /// /// The name of the table. /// - /// - /// The parameters required to update table properties. + /// + /// The data table data retention in days, between 30 and 730. Setting this + /// property to null will default to the workspace retention. /// - public static Table Update(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + public static Table Update(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, int? retentionInDays = default(int?)) { - return operations.UpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, workspaceName, tableName, retentionInDays).GetAwaiter().GetResult(); } /// @@ -101,15 +102,16 @@ public static Table Update(this ITablesOperations operations, string resourceGro /// /// The name of the table. /// - /// - /// The parameters required to update table properties. + /// + /// The data table data retention in days, between 30 and 730. Setting this + /// property to null will default to the workspace retention. /// /// /// The cancellation token. /// - public static async Task
UpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task
UpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, int? retentionInDays = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, retentionInDays, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; }