From 8f7ba3871bfb7b2b124396e22022b25b665514e1 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 7 Apr 2021 09:38:58 +0000 Subject: [PATCH] CodeGen from PR 13812 in Azure/azure-rest-api-specs Merge caf31c940feee16099924fd0fa6ee27b330e74dd into 9fbd9c69e95c30c0805b34d8b6e23a385dc0d6cc --- .../AvailableServiceTiersOperations.cs | 17 +- .../src/Generated/ClustersOperations.cs | 150 ++-- .../src/Generated/DataExportsOperations.cs | 282 +++---- .../DataExportsOperationsExtensions.cs | 52 -- .../src/Generated/DataSourcesOperations.cs | 68 +- .../Generated/DeletedWorkspacesOperations.cs | 56 +- .../src/Generated/GatewaysOperations.cs | 17 +- .../src/Generated/IClustersOperations.cs | 20 +- .../src/Generated/IDataExportsOperations.cs | 39 +- .../Generated/IDeletedWorkspacesOperations.cs | 4 +- .../ILinkedStorageAccountsOperations.cs | 6 +- .../IOperationalInsightsManagementClient.cs | 50 +- .../src/Generated/IOperations.cs | 4 +- .../src/Generated/ITablesOperations.cs | 111 +++ .../src/Generated/IWorkspacesOperations.cs | 16 +- .../Generated/IntelligencePacksOperations.cs | 51 +- .../src/Generated/LinkedServicesOperations.cs | 68 +- .../LinkedStorageAccountsOperations.cs | 74 +- ...nkedStorageAccountsOperationsExtensions.cs | 12 +- .../Generated/ManagementGroupsOperations.cs | 17 +- .../Generated/Models/AssociatedWorkspace.cs | 78 ++ .../Generated/Models/AvailableServiceTier.cs | 4 +- .../Generated/Models/AzureEntityResource.cs | 15 +- .../src/Generated/Models/BillingType.cs | 22 + .../Models/CapacityReservationProperties.cs | 71 ++ .../src/Generated/Models/Cluster.cs | 99 ++- .../Generated/Models/ClusterErrorResponse.cs | 52 -- .../src/Generated/Models/ClusterPatch.cs | 23 +- .../src/Generated/Models/DataExport.cs | 19 +- .../Models/DataExportErrorResponse.cs | 52 -- .../DataExportErrorResponseException.cs | 62 -- .../Generated/Models/DataIngestionStatus.cs | 45 ++ .../src/Generated/Models/DataSource.cs | 18 +- .../src/Generated/Models/DataSourceType.cs | 14 +- .../src/Generated/Models/ErrorDetail.cs | 85 ++ .../src/Generated/Models/ErrorResponse.cs | 53 +- ...Exception.cs => ErrorResponseException.cs} | 18 +- .../src/Generated/Models/Identity.cs | 26 +- .../src/Generated/Models/IdentityType.cs | 6 + .../Generated/Models/KeyVaultProperties.cs | 11 +- .../src/Generated/Models/LinkedService.cs | 8 +- .../Models/LinkedStorageAccountsResource.cs | 13 +- .../src/Generated/Models/ProxyResource.cs | 15 +- .../src/Generated/Models/Resource.cs | 23 +- .../src/Generated/Models/SavedSearch.cs | 28 +- .../src/Generated/Models/StorageInsight.cs | 8 +- .../src/Generated/Models/Table.cs | 111 +++ .../src/Generated/Models/TrackedResource.cs | 14 +- .../Models/UserIdentityProperties.cs | 61 ++ .../src/Generated/Models/Workspace.cs | 70 +- .../src/Generated/Models/WorkspaceCapping.cs | 74 ++ .../src/Generated/Models/WorkspacePatch.cs | 70 +- .../src/Generated/Models/WorkspaceSku.cs | 26 +- .../Generated/Models/WorkspaceSkuNameEnum.cs | 1 + .../Generated/OperationStatusesOperations.cs | 17 +- .../OperationalInsightsManagementClient.cs | 60 +- .../src/Generated/Operations.cs | 45 +- .../src/Generated/SavedSearchesOperations.cs | 68 +- .../src/Generated/SchemaOperations.cs | 17 +- ...nfo_OperationalInsightsManagementClient.cs | 50 +- .../src/Generated/SharedKeysOperations.cs | 34 +- .../StorageInsightConfigsOperations.cs | 68 +- .../src/Generated/TablesOperations.cs | 764 ++++++++++++++++++ .../Generated/TablesOperationsExtensions.cs | 165 ++++ .../src/Generated/UsagesOperations.cs | 17 +- .../src/Generated/WorkspacePurgeOperations.cs | 34 +- .../src/Generated/WorkspacesOperations.cs | 168 +--- 67 files changed, 2448 insertions(+), 1468 deletions(-) create mode 100644 sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs create mode 100644 sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AssociatedWorkspace.cs create mode 100644 sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/BillingType.cs create mode 100644 sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/CapacityReservationProperties.cs delete mode 100644 sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ClusterErrorResponse.cs delete mode 100644 sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExportErrorResponse.cs delete mode 100644 sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExportErrorResponseException.cs create mode 100644 sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataIngestionStatus.cs create mode 100644 sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorDetail.cs rename sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/{ClusterErrorResponseException.cs => ErrorResponseException.cs} (68%) create mode 100644 sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Table.cs create mode 100644 sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/UserIdentityProperties.cs create mode 100644 sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceCapping.cs create mode 100644 sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs create mode 100644 sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/AvailableServiceTiersOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/AvailableServiceTiersOperations.cs index 44dbf7076277..b861ee097d62 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/AvailableServiceTiersOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/AvailableServiceTiersOperations.cs @@ -131,17 +131,7 @@ internal AvailableServiceTiersOperations(OperationalInsightsManagementClient cli throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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); - } - } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -151,6 +141,7 @@ internal AvailableServiceTiersOperations(OperationalInsightsManagementClient cli Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); } @@ -161,9 +152,9 @@ internal AvailableServiceTiersOperations(OperationalInsightsManagementClient cli _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { 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 a1f1d050019c..927177097c59 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperations.cs @@ -62,7 +62,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -98,17 +98,6 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - 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"); @@ -120,6 +109,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -128,6 +118,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } @@ -137,9 +128,9 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -201,11 +192,11 @@ internal ClustersOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ClusterErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ClusterErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -270,7 +261,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -287,17 +278,6 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// 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); - } - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -309,6 +289,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -316,6 +297,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -324,9 +306,9 @@ internal ClustersOperations(OperationalInsightsManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/clusters").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -388,11 +370,11 @@ internal ClustersOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ClusterErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ClusterErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -510,7 +492,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -557,21 +539,11 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - 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 (clusterName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -580,6 +552,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); @@ -591,9 +564,9 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -655,11 +628,11 @@ internal ClustersOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ClusterErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ClusterErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -733,7 +706,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -777,17 +750,6 @@ internal ClustersOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - 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"); @@ -799,6 +761,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -809,6 +772,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } @@ -819,9 +783,9 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -889,11 +853,11 @@ internal ClustersOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ClusterErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ClusterErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -967,7 +931,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1003,17 +967,6 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - 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"); @@ -1052,6 +1005,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) { parameters.Validate(); } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1060,6 +1014,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); @@ -1072,9 +1027,9 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1142,11 +1097,11 @@ internal ClustersOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new ClusterErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ClusterErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1235,7 +1190,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1272,17 +1227,6 @@ internal ClustersOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - 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"); @@ -1294,6 +1238,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1303,6 +1248,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -1313,9 +1259,9 @@ internal ClustersOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1377,11 +1323,11 @@ internal ClustersOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new ClusterErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ClusterErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1431,7 +1377,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1527,11 +1473,11 @@ internal ClustersOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ClusterErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ClusterErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1599,7 +1545,7 @@ internal ClustersOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1695,11 +1641,11 @@ internal ClustersOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new ClusterErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ClusterErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperations.cs index eaea993e4501..2a83aa892465 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperations.cs @@ -65,7 +65,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -131,17 +131,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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); - } - } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -151,6 +141,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); } @@ -161,9 +152,9 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -225,11 +216,11 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new DataExportErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DataExportErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -301,37 +292,12 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// The parameters required to create or update a data export. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a data export instance. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The data export rule name. - /// - /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -346,7 +312,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -401,17 +367,30 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "dataExportName"); } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (Client.ApiVersion != null) + if (dataExportName != null) { - if (Client.ApiVersion.Length < 1) + if (dataExportName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "dataExportName", 63); + } + if (dataExportName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "dataExportName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(dataExportName, "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$")) { - throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + throw new ValidationException(ValidationRules.Pattern, "dataExportName", "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$"); } } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -422,8 +401,10 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataExportName", dataExportName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -433,9 +414,9 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{dataExportName}", System.Uri.EscapeDataString(dataExportName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -444,7 +425,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -475,6 +456,12 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) // 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) { @@ -495,13 +482,13 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new DataExportErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DataExportErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -550,6 +537,24 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) 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); @@ -558,7 +563,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) } /// - /// Deletes the specified data export in a given workspace.. + /// Gets a data export instance. /// /// /// The name of the resource group. The name is case insensitive. @@ -575,9 +580,12 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// 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 /// @@ -587,7 +595,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -642,17 +650,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "dataExportName"); } - 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); - } - } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -663,8 +661,9 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataExportName", dataExportName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -674,9 +673,9 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{dataExportName}", System.Uri.EscapeDataString(dataExportName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -685,7 +684,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -736,13 +735,13 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 404) + if ((int)_statusCode != 200) { - var ex = new DataExportErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DataExportErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -766,13 +765,31 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -781,7 +798,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) } /// - /// Create or update a data export. + /// Deletes the specified data export in a given workspace.. /// /// /// The name of the resource group. The name is case insensitive. @@ -792,21 +809,15 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// The data export rule name. /// - /// - /// The parameters required to create or update a data export. - /// /// /// 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 /// @@ -816,7 +827,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -871,40 +882,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "dataExportName"); } - if (dataExportName != null) - { - if (dataExportName.Length > 63) - { - throw new ValidationException(ValidationRules.MaxLength, "dataExportName", 63); - } - if (dataExportName.Length < 4) - { - throw new ValidationException(ValidationRules.MinLength, "dataExportName", 4); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(dataExportName, "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$")) - { - throw new ValidationException(ValidationRules.Pattern, "dataExportName", "^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$"); - } - } - 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -915,9 +893,9 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataExportName", dataExportName); - tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -927,9 +905,9 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{dataExportName}", System.Uri.EscapeDataString(dataExportName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -938,7 +916,7 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -969,12 +947,6 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) // 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) { @@ -995,13 +967,13 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200 && (int)_statusCode != 404) { - var ex = new DataExportErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - DataExportErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1025,49 +997,13 @@ internal DataExportsOperations(OperationalInsightsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperationsExtensions.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperationsExtensions.cs index 1c66796d291b..579f127cfcb6 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperationsExtensions.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataExportsOperationsExtensions.cs @@ -204,57 +204,5 @@ public static void Delete(this IDataExportsOperations operations, string resourc (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } - /// - /// Create or update a data export. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The data export rule name. - /// - /// - /// The parameters required to create or update a data export. - /// - public static DataExport BeginCreateOrUpdate(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters) - { - return operations.BeginCreateOrUpdateAsync(resourceGroupName, workspaceName, dataExportName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Create or update a data export. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The data export rule name. - /// - /// - /// The parameters required to create or update a data export. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCreateOrUpdateAsync(this IDataExportsOperations operations, string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, dataExportName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataSourcesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataSourcesOperations.cs index 1f588b001279..b022128adc4f 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataSourcesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DataSourcesOperations.cs @@ -139,17 +139,6 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) { parameters.Validate(); } - 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"); @@ -161,6 +150,7 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -172,6 +162,7 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataSourceName", dataSourceName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } @@ -183,9 +174,9 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{dataSourceName}", System.Uri.EscapeDataString(dataSourceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -410,17 +401,6 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "dataSourceName"); } - 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"); @@ -432,6 +412,7 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -442,6 +423,7 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataSourceName", dataSourceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -453,9 +435,9 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{dataSourceName}", System.Uri.EscapeDataString(dataSourceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -641,17 +623,6 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "dataSourceName"); } - 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"); @@ -663,6 +634,7 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -673,6 +645,7 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataSourceName", dataSourceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -684,9 +657,9 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{dataSourceName}", System.Uri.EscapeDataString(dataSourceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -894,17 +867,6 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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"); @@ -916,6 +878,7 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -927,6 +890,7 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("skiptoken", skiptoken); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); } @@ -949,9 +913,9 @@ internal DataSourcesOperations(OperationalInsightsManagementClient client) { _queryParameters.Add(string.Format("$skiptoken={0}", System.Uri.EscapeDataString(skiptoken))); } - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DeletedWorkspacesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DeletedWorkspacesOperations.cs index 9979fd74e170..35defea6a331 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DeletedWorkspacesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/DeletedWorkspacesOperations.cs @@ -59,7 +59,7 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -76,17 +76,6 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) /// 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); - } - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -98,6 +87,7 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -105,6 +95,7 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -113,9 +104,9 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/deletedWorkspaces").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -177,14 +168,13 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -194,10 +184,6 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) } 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); @@ -255,7 +241,7 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -291,17 +277,6 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - 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"); @@ -313,6 +288,7 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,6 +297,7 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } @@ -330,9 +307,9 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -394,14 +371,13 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -411,10 +387,6 @@ internal DeletedWorkspacesOperations(OperationalInsightsManagementClient client) } 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); diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/GatewaysOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/GatewaysOperations.cs index 983288a0ead3..52c8c8a45715 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/GatewaysOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/GatewaysOperations.cs @@ -135,17 +135,7 @@ internal GatewaysOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "gatewayId"); } - 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); - } - } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -156,6 +146,7 @@ internal GatewaysOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("gatewayId", gatewayId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -167,9 +158,9 @@ internal GatewaysOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{gatewayId}", System.Uri.EscapeDataString(gatewayId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IClustersOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IClustersOperations.cs index c3a484f030bd..21b4ab592431 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IClustersOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IClustersOperations.cs @@ -35,7 +35,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -54,7 +54,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -83,7 +83,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -108,7 +108,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -130,7 +130,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -158,7 +158,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -187,7 +187,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -212,7 +212,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -231,7 +231,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -253,7 +253,7 @@ public partial interface IClustersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IDataExportsOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IDataExportsOperations.cs index d639cc5d97ee..32d52702e7e8 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IDataExportsOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IDataExportsOperations.cs @@ -38,7 +38,7 @@ public partial interface IDataExportsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -69,7 +69,7 @@ public partial interface IDataExportsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -97,7 +97,7 @@ public partial interface IDataExportsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -125,43 +125,12 @@ public partial interface IDataExportsOperations /// /// 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 dataExportName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Create or update a data export. - /// - /// - /// The name of the resource group. The name is case insensitive. - /// - /// - /// The name of the workspace. - /// - /// - /// The data export rule name. - /// - /// - /// The parameters required to create or update a data export. - /// - /// - /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string dataExportName, DataExport parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IDeletedWorkspacesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IDeletedWorkspacesOperations.cs index 14fcc81ed76e..5db749e7c2c2 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IDeletedWorkspacesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IDeletedWorkspacesOperations.cs @@ -33,7 +33,7 @@ public partial interface IDeletedWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -56,7 +56,7 @@ public partial interface IDeletedWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ILinkedStorageAccountsOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ILinkedStorageAccountsOperations.cs index e4797a04c890..d87630e84e72 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ILinkedStorageAccountsOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ILinkedStorageAccountsOperations.cs @@ -35,7 +35,7 @@ public partial interface ILinkedStorageAccountsOperations /// /// /// Linked storage accounts type. Possible values include: - /// 'CustomLogs', 'AzureWatson' + /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' /// /// /// Linked storage accounts resources ids. @@ -68,7 +68,7 @@ public partial interface ILinkedStorageAccountsOperations /// /// /// Linked storage accounts type. Possible values include: - /// 'CustomLogs', 'AzureWatson' + /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' /// /// /// The headers that will be added to request. @@ -95,7 +95,7 @@ public partial interface ILinkedStorageAccountsOperations /// /// /// Linked storage accounts type. Possible values include: - /// 'CustomLogs', 'AzureWatson' + /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' /// /// /// The headers that will be added to request. 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 fdd744e341c9..86c103586017 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperationalInsightsManagementClient.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperationalInsightsManagementClient.cs @@ -40,11 +40,6 @@ public partial interface IOperationalInsightsManagementClient : System.IDisposab /// ServiceClientCredentials Credentials { get; } - /// - /// The API version to use for this operation. - /// - string ApiVersion { get; } - /// /// The ID of the target subscription. /// @@ -99,11 +94,6 @@ public partial interface IOperationalInsightsManagementClient : System.IDisposab /// IManagementGroupsOperations ManagementGroups { get; } - /// - /// Gets the IOperations. - /// - IOperations Operations { get; } - /// /// Gets the IOperationStatusesOperations. /// @@ -119,21 +109,6 @@ public partial interface IOperationalInsightsManagementClient : System.IDisposab /// IUsagesOperations Usages { get; } - /// - /// Gets the IWorkspacesOperations. - /// - IWorkspacesOperations Workspaces { get; } - - /// - /// Gets the IDeletedWorkspacesOperations. - /// - IDeletedWorkspacesOperations DeletedWorkspaces { get; } - - /// - /// Gets the IClustersOperations. - /// - IClustersOperations Clusters { get; } - /// /// Gets the IStorageInsightConfigsOperations. /// @@ -164,5 +139,30 @@ public partial interface IOperationalInsightsManagementClient : System.IDisposab /// IWorkspacePurgeOperations WorkspacePurge { get; } + /// + /// Gets the IClustersOperations. + /// + IClustersOperations Clusters { get; } + + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the ITablesOperations. + /// + ITablesOperations Tables { get; } + + /// + /// Gets the IWorkspacesOperations. + /// + IWorkspacesOperations Workspaces { get; } + + /// + /// Gets the IDeletedWorkspacesOperations. + /// + IDeletedWorkspacesOperations DeletedWorkspaces { get; } + } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperations.cs index 2c207f8464f1..104d5efc6eb2 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IOperations.cs @@ -32,7 +32,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -54,7 +54,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs new file mode 100644 index 000000000000..c8f8aa790a4e --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ITablesOperations.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// TablesOperations operations. + /// + public partial interface ITablesOperations + { + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// 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>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates a Log Analytics workspace table properties. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// 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 tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IWorkspacesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IWorkspacesOperations.cs index 0b2abede6bf7..b200f6dea07e 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IWorkspacesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IWorkspacesOperations.cs @@ -32,7 +32,7 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -54,7 +54,7 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -82,7 +82,7 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -115,7 +115,7 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -137,7 +137,7 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -165,7 +165,7 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -193,7 +193,7 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -226,7 +226,7 @@ public partial interface IWorkspacesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IntelligencePacksOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IntelligencePacksOperations.cs index 153d29ed82ea..bb01de8e04d2 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IntelligencePacksOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/IntelligencePacksOperations.cs @@ -124,17 +124,6 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "intelligencePackName"); } - 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"); @@ -146,6 +135,7 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -156,6 +146,7 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("intelligencePackName", intelligencePackName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Disable", tracingParameters); } @@ -167,9 +158,9 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{intelligencePackName}", System.Uri.EscapeDataString(intelligencePackName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -352,17 +343,6 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "intelligencePackName"); } - 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"); @@ -374,6 +354,7 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -384,6 +365,7 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("intelligencePackName", intelligencePackName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Enable", tracingParameters); } @@ -395,9 +377,9 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{intelligencePackName}", System.Uri.EscapeDataString(intelligencePackName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -577,17 +559,6 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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"); @@ -599,6 +570,7 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -608,6 +580,7 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -618,9 +591,9 @@ internal IntelligencePacksOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { 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 3c541257674b..9ae36bd3f30d 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedServicesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedServicesOperations.cs @@ -180,17 +180,6 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkedServiceName"); } - 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"); @@ -202,6 +191,7 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -212,6 +202,7 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("linkedServiceName", linkedServiceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -223,9 +214,9 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{linkedServiceName}", System.Uri.EscapeDataString(linkedServiceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -422,17 +413,6 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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"); @@ -444,6 +424,7 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -453,6 +434,7 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); } @@ -463,9 +445,9 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -687,17 +669,7 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - 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); - } - } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -709,6 +681,7 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("linkedServiceName", linkedServiceName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -720,9 +693,9 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{linkedServiceName}", System.Uri.EscapeDataString(linkedServiceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -950,17 +923,6 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "linkedServiceName"); } - 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"); @@ -972,6 +934,7 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -982,6 +945,7 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("linkedServiceName", linkedServiceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -993,9 +957,9 @@ internal LinkedServicesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{linkedServiceName}", System.Uri.EscapeDataString(linkedServiceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperations.cs index 2a235255d6a9..62241098aae7 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperations.cs @@ -62,7 +62,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// /// /// Linked storage accounts resources ids. @@ -139,17 +139,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } - 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); - } - } + string apiVersion = "2020-08-01"; LinkedStorageAccountsResource parameters = new LinkedStorageAccountsResource(); if (storageAccountIds != null) { @@ -165,6 +155,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataSourceType", dataSourceType); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); @@ -177,9 +168,9 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -324,7 +315,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// /// /// Headers that will be added to request. @@ -384,17 +375,6 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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"); @@ -406,6 +386,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -416,6 +397,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataSourceType", dataSourceType); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -427,9 +409,9 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -550,7 +532,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// /// /// Headers that will be added to request. @@ -613,17 +595,6 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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"); @@ -635,6 +606,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -645,6 +617,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("dataSourceType", dataSourceType); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -656,9 +629,9 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _url = _url.Replace("{dataSourceType}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(dataSourceType, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -848,17 +821,6 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - 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 (workspaceName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); @@ -878,6 +840,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -886,6 +849,7 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); @@ -897,9 +861,9 @@ internal LinkedStorageAccountsOperations(OperationalInsightsManagementClient cli _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperationsExtensions.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperationsExtensions.cs index 4f52d4a3056f..327017b8e9b2 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperationsExtensions.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/LinkedStorageAccountsOperationsExtensions.cs @@ -38,7 +38,7 @@ public static partial class LinkedStorageAccountsOperationsExtensions /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// /// /// Linked storage accounts resources ids. @@ -63,7 +63,7 @@ public static partial class LinkedStorageAccountsOperationsExtensions /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// /// /// Linked storage accounts resources ids. @@ -94,7 +94,7 @@ public static partial class LinkedStorageAccountsOperationsExtensions /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// public static void Delete(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType) { @@ -116,7 +116,7 @@ public static void Delete(this ILinkedStorageAccountsOperations operations, stri /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// /// /// The cancellation token. @@ -141,7 +141,7 @@ public static void Delete(this ILinkedStorageAccountsOperations operations, stri /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// public static LinkedStorageAccountsResource Get(this ILinkedStorageAccountsOperations operations, string resourceGroupName, string workspaceName, DataSourceType dataSourceType) { @@ -163,7 +163,7 @@ public static LinkedStorageAccountsResource Get(this ILinkedStorageAccountsOpera /// /// /// Linked storage accounts type. Possible values include: 'CustomLogs', - /// 'AzureWatson' + /// 'AzureWatson', 'Query', 'Alerts' /// /// /// The cancellation token. diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ManagementGroupsOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ManagementGroupsOperations.cs index 2488c3a14547..7a6ee7983735 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ManagementGroupsOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ManagementGroupsOperations.cs @@ -120,17 +120,6 @@ internal ManagementGroupsOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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"); @@ -142,6 +131,7 @@ internal ManagementGroupsOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -151,6 +141,7 @@ internal ManagementGroupsOperations(OperationalInsightsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -161,9 +152,9 @@ internal ManagementGroupsOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AssociatedWorkspace.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AssociatedWorkspace.cs new file mode 100644 index 000000000000..6f79ee6ac743 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AssociatedWorkspace.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The list of Log Analytics workspaces associated with the cluster. + /// + public partial class AssociatedWorkspace + { + /// + /// Initializes a new instance of the AssociatedWorkspace class. + /// + public AssociatedWorkspace() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AssociatedWorkspace class. + /// + /// The id of the assigned workspace. + /// The name id the assigned + /// workspace. + /// The ResourceId id the assigned + /// workspace. + /// The time of workspace + /// association. + public AssociatedWorkspace(string workspaceId = default(string), string workspaceName = default(string), string resourceId = default(string), string associateDate = default(string)) + { + WorkspaceId = workspaceId; + WorkspaceName = workspaceName; + ResourceId = resourceId; + AssociateDate = associateDate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the id of the assigned workspace. + /// + [JsonProperty(PropertyName = "workspaceId")] + public string WorkspaceId { get; private set; } + + /// + /// Gets the name id the assigned workspace. + /// + [JsonProperty(PropertyName = "workspaceName")] + public string WorkspaceName { get; private set; } + + /// + /// Gets the ResourceId id the assigned workspace. + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; private set; } + + /// + /// Gets the time of workspace association. + /// + [JsonProperty(PropertyName = "associateDate")] + public string AssociateDate { get; private set; } + + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AvailableServiceTier.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AvailableServiceTier.cs index 462039c50dc8..1c2618c5baeb 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AvailableServiceTier.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AvailableServiceTier.cs @@ -46,7 +46,7 @@ public AvailableServiceTier() /// Time when the sku was last updated for /// the workspace. Returned for the Capacity Reservation Service /// Tier. - public AvailableServiceTier(string serviceTier = default(string), bool? enabled = default(bool?), long? minimumRetention = default(long?), long? maximumRetention = default(long?), long? defaultRetention = default(long?), long? capacityReservationLevel = default(long?), System.DateTime? lastSkuUpdate = default(System.DateTime?)) + public AvailableServiceTier(string serviceTier = default(string), bool? enabled = default(bool?), long? minimumRetention = default(long?), long? maximumRetention = default(long?), long? defaultRetention = default(long?), long? capacityReservationLevel = default(long?), string lastSkuUpdate = default(string)) { ServiceTier = serviceTier; Enabled = enabled; @@ -107,7 +107,7 @@ public AvailableServiceTier() /// for the Capacity Reservation Service Tier. /// [JsonProperty(PropertyName = "lastSkuUpdate")] - public System.DateTime? LastSkuUpdate { get; private set; } + public string LastSkuUpdate { get; private set; } } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AzureEntityResource.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AzureEntityResource.cs index 2dd6da4550e9..4923d59a4ac3 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AzureEntityResource.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/AzureEntityResource.cs @@ -14,9 +14,12 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models using System.Linq; /// - /// The resource model definition for a Azure Resource Manager resource - /// with an etag. + /// Entity Resource /// + /// + /// The resource model definition for an Azure Resource Manager resource + /// with an etag. + /// public partial class AzureEntityResource : Resource { /// @@ -30,12 +33,12 @@ public AzureEntityResource() /// /// Initializes a new instance of the AzureEntityResource class. /// - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource Etag. public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) : base(id, name, type) diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/BillingType.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/BillingType.cs new file mode 100644 index 000000000000..4cece2a8e88f --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/BillingType.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for BillingType. + /// + public static class BillingType + { + public const string Cluster = "Cluster"; + public const string Workspaces = "Workspaces"; + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/CapacityReservationProperties.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/CapacityReservationProperties.cs new file mode 100644 index 000000000000..e893322523f2 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/CapacityReservationProperties.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The Capacity Reservation properties. + /// + public partial class CapacityReservationProperties + { + /// + /// Initializes a new instance of the CapacityReservationProperties + /// class. + /// + public CapacityReservationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CapacityReservationProperties + /// class. + /// + /// The last time Sku was updated. + /// Minimum CapacityReservation value in + /// GB. + /// Maximum CapacityReservation value in + /// GB. + public CapacityReservationProperties(string lastSkuUpdate = default(string), long? minCapacity = default(long?), long? maxCapacity = default(long?)) + { + LastSkuUpdate = lastSkuUpdate; + MinCapacity = minCapacity; + MaxCapacity = maxCapacity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the last time Sku was updated. + /// + [JsonProperty(PropertyName = "lastSkuUpdate")] + public string LastSkuUpdate { get; private set; } + + /// + /// Gets minimum CapacityReservation value in GB. + /// + [JsonProperty(PropertyName = "minCapacity")] + public long? MinCapacity { get; private set; } + + /// + /// Gets maximum CapacityReservation value in GB. + /// + [JsonProperty(PropertyName = "maxCapacity")] + public long? MaxCapacity { get; private set; } + + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Cluster.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Cluster.cs index 060c0f46674c..ed8b31ee653e 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Cluster.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Cluster.cs @@ -36,33 +36,57 @@ public Cluster() /// /// The geo-location where the resource /// lives - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource tags. /// The identity of the resource. /// The sku properties. - /// The link used to get the next page of - /// recommendations. /// The ID associated with the cluster. /// The provisioning state of the /// cluster. Possible values include: 'Creating', 'Succeeded', /// 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', /// 'Updating' + /// Configures whether cluster + /// will use double encryption. This Property can not be modified after + /// cluster creation. Default value is 'true' + /// Sets whether the cluster + /// will support availability zones. This can be set as true only in + /// regions where Azure Data Explorer support Availability Zones. This + /// Property can not be modified after cluster creation. Default value + /// is 'true' if region supports Availability Zones. + /// Configures whether billing will be only + /// on the cluster or each workspace will be billed by its proportional + /// use. This does not change the overall billing, only how it will be + /// distributed. Default value is 'Cluster'. Possible values include: + /// 'Cluster', 'Workspaces' /// The associated key /// properties. - public Cluster(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Identity identity = default(Identity), ClusterSku sku = default(ClusterSku), string nextLink = default(string), string clusterId = default(string), string provisioningState = default(string), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties)) + /// The last time the cluster was + /// updated. + /// The cluster creation time + /// The list of Log Analytics + /// workspaces associated with the cluster + /// Additional properties + /// for capacity reservation + public Cluster(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Identity identity = default(Identity), ClusterSku sku = default(ClusterSku), string clusterId = default(string), string provisioningState = default(string), bool? isDoubleEncryptionEnabled = default(bool?), bool? isAvailabilityZonesEnabled = default(bool?), string billingType = default(string), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), string lastModifiedDate = default(string), string createdDate = default(string), IList associatedWorkspaces = default(IList), CapacityReservationProperties capacityReservationProperties = default(CapacityReservationProperties)) : base(location, id, name, type, tags) { Identity = identity; Sku = sku; - NextLink = nextLink; ClusterId = clusterId; ProvisioningState = provisioningState; + IsDoubleEncryptionEnabled = isDoubleEncryptionEnabled; + IsAvailabilityZonesEnabled = isAvailabilityZonesEnabled; + BillingType = billingType; KeyVaultProperties = keyVaultProperties; + LastModifiedDate = lastModifiedDate; + CreatedDate = createdDate; + AssociatedWorkspaces = associatedWorkspaces; + CapacityReservationProperties = capacityReservationProperties; CustomInit(); } @@ -83,12 +107,6 @@ public Cluster() [JsonProperty(PropertyName = "sku")] public ClusterSku Sku { get; set; } - /// - /// Gets or sets the link used to get the next page of recommendations. - /// - [JsonProperty(PropertyName = "properties.nextLink")] - public string NextLink { get; set; } - /// /// Gets the ID associated with the cluster. /// @@ -103,12 +121,65 @@ public Cluster() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets or sets configures whether cluster will use double encryption. + /// This Property can not be modified after cluster creation. Default + /// value is 'true' + /// + [JsonProperty(PropertyName = "properties.isDoubleEncryptionEnabled")] + public bool? IsDoubleEncryptionEnabled { get; set; } + + /// + /// Gets or sets sets whether the cluster will support availability + /// zones. This can be set as true only in regions where Azure Data + /// Explorer support Availability Zones. This Property can not be + /// modified after cluster creation. Default value is 'true' if region + /// supports Availability Zones. + /// + [JsonProperty(PropertyName = "properties.isAvailabilityZonesEnabled")] + public bool? IsAvailabilityZonesEnabled { get; set; } + + /// + /// Gets or sets configures whether billing will be only on the cluster + /// or each workspace will be billed by its proportional use. This does + /// not change the overall billing, only how it will be distributed. + /// Default value is 'Cluster'. Possible values include: 'Cluster', + /// 'Workspaces' + /// + [JsonProperty(PropertyName = "properties.billingType")] + public string BillingType { get; set; } + /// /// Gets or sets the associated key properties. /// [JsonProperty(PropertyName = "properties.keyVaultProperties")] public KeyVaultProperties KeyVaultProperties { get; set; } + /// + /// Gets the last time the cluster was updated. + /// + [JsonProperty(PropertyName = "properties.lastModifiedDate")] + public string LastModifiedDate { get; private set; } + + /// + /// Gets the cluster creation time + /// + [JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate { get; private set; } + + /// + /// Gets or sets the list of Log Analytics workspaces associated with + /// the cluster + /// + [JsonProperty(PropertyName = "properties.associatedWorkspaces")] + public IList AssociatedWorkspaces { get; set; } + + /// + /// Gets or sets additional properties for capacity reservation + /// + [JsonProperty(PropertyName = "properties.capacityReservationProperties")] + public CapacityReservationProperties CapacityReservationProperties { get; set; } + /// /// Validate the object. /// diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ClusterErrorResponse.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ClusterErrorResponse.cs deleted file mode 100644 index ef8e3f4673ba..000000000000 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ClusterErrorResponse.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.OperationalInsights.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Error response indicates that the service is not able to process the - /// incoming request. The reason is provided in the error message. - /// - public partial class ClusterErrorResponse - { - /// - /// Initializes a new instance of the ClusterErrorResponse class. - /// - public ClusterErrorResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ClusterErrorResponse class. - /// - /// The details of the error. - public ClusterErrorResponse(ErrorResponse error = default(ErrorResponse)) - { - Error = error; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the details of the error. - /// - [JsonProperty(PropertyName = "error")] - public ErrorResponse Error { get; set; } - - } -} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ClusterPatch.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ClusterPatch.cs index 476e831788b9..21155c53ece7 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ClusterPatch.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ClusterPatch.cs @@ -37,11 +37,13 @@ public ClusterPatch() /// /// The associated key /// properties. + /// The identity of the resource. /// The sku properties. /// Resource tags. - public ClusterPatch(KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), ClusterSku sku = default(ClusterSku), IDictionary tags = default(IDictionary)) + public ClusterPatch(KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), Identity identity = default(Identity), ClusterSku sku = default(ClusterSku), IDictionary tags = default(IDictionary)) { KeyVaultProperties = keyVaultProperties; + Identity = identity; Sku = sku; Tags = tags; CustomInit(); @@ -58,6 +60,12 @@ public ClusterPatch() [JsonProperty(PropertyName = "properties.keyVaultProperties")] public KeyVaultProperties KeyVaultProperties { get; set; } + /// + /// Gets or sets the identity of the resource. + /// + [JsonProperty(PropertyName = "identity")] + public Identity Identity { get; set; } + /// /// Gets or sets the sku properties. /// @@ -70,5 +78,18 @@ public ClusterPatch() [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Identity != null) + { + Identity.Validate(); + } + } } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExport.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExport.cs index 878942a6cd8d..22c7831f8f9e 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExport.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExport.cs @@ -35,14 +35,12 @@ public DataExport() /// /// Initializes a new instance of the DataExport class. /// + /// An array of tables to export, for example: + /// [“Heartbeat, SecurityEvent”]. /// The destination resource ID. This can be /// copied from the Properties entry of the destination resource in /// Azure. /// The data export rule ID. - /// When ‘true’, all workspace's tables are - /// exported. - /// An array of tables to export, for example: - /// [“Heartbeat, SecurityEvent”]. /// The type of the destination resource. /// Possible values include: 'StorageAccount', 'EventHub' /// Optional. Allows to define an Event Hub @@ -52,10 +50,9 @@ public DataExport() /// time. /// Date and time when the export was /// last modified. - public DataExport(string resourceId, string dataExportId = default(string), bool? allTables = default(bool?), IList tableNames = default(IList), string dataExportType = default(string), string eventHubName = default(string), bool? enable = default(bool?), string createdDate = default(string), string lastModifiedDate = default(string)) + public DataExport(IList tableNames, string resourceId, string dataExportId = default(string), string dataExportType = default(string), string eventHubName = default(string), bool? enable = default(bool?), string createdDate = default(string), string lastModifiedDate = default(string)) { DataExportId = dataExportId; - AllTables = allTables; TableNames = tableNames; ResourceId = resourceId; DataExportType = dataExportType; @@ -77,12 +74,6 @@ public DataExport() [JsonProperty(PropertyName = "properties.dataExportId")] public string DataExportId { get; set; } - /// - /// Gets or sets when ‘true’, all workspace's tables are exported. - /// - [JsonProperty(PropertyName = "properties.allTables")] - public bool? AllTables { get; set; } - /// /// Gets or sets an array of tables to export, for example: /// [“Heartbeat, SecurityEvent”]. @@ -137,6 +128,10 @@ public DataExport() /// public virtual void Validate() { + if (TableNames == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TableNames"); + } if (ResourceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ResourceId"); diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExportErrorResponse.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExportErrorResponse.cs deleted file mode 100644 index 2d4bbe7790b4..000000000000 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExportErrorResponse.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.OperationalInsights.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Error response indicates that the service is not able to process the - /// incoming request. The reason is provided in the error message. - /// - public partial class DataExportErrorResponse - { - /// - /// Initializes a new instance of the DataExportErrorResponse class. - /// - public DataExportErrorResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DataExportErrorResponse class. - /// - /// The details of the error. - public DataExportErrorResponse(ErrorResponse error = default(ErrorResponse)) - { - Error = error; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the details of the error. - /// - [JsonProperty(PropertyName = "error")] - public ErrorResponse Error { get; set; } - - } -} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExportErrorResponseException.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExportErrorResponseException.cs deleted file mode 100644 index b0db3c2871f9..000000000000 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataExportErrorResponseException.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.OperationalInsights.Models -{ - using Microsoft.Rest; - - /// - /// Exception thrown for an invalid response with DataExportErrorResponse - /// information. - /// - public partial class DataExportErrorResponseException : 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 DataExportErrorResponse Body { get; set; } - - /// - /// Initializes a new instance of the DataExportErrorResponseException class. - /// - public DataExportErrorResponseException() - { - } - - /// - /// Initializes a new instance of the DataExportErrorResponseException class. - /// - /// The exception message. - public DataExportErrorResponseException(string message) - : this(message, null) - { - } - - /// - /// Initializes a new instance of the DataExportErrorResponseException class. - /// - /// The exception message. - /// Inner exception. - public DataExportErrorResponseException(string message, System.Exception innerException) - : base(message, innerException) - { - } - } -} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataIngestionStatus.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataIngestionStatus.cs new file mode 100644 index 000000000000..78ed4da9ec3c --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataIngestionStatus.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + + /// + /// Defines values for DataIngestionStatus. + /// + public static class DataIngestionStatus + { + /// + /// Ingestion enabled following daily cap quota reset, or subscription + /// enablement. + /// + public const string RespectQuota = "RespectQuota"; + /// + /// Ingestion started following service setting change. + /// + public const string ForceOn = "ForceOn"; + /// + /// Ingestion stopped following service setting change. + /// + public const string ForceOff = "ForceOff"; + /// + /// Reached daily cap quota, ingestion stopped. + /// + public const string OverQuota = "OverQuota"; + /// + /// Ingestion stopped following suspended subscription. + /// + public const string SubscriptionSuspended = "SubscriptionSuspended"; + /// + /// 80% of daily cap quota reached. + /// + public const string ApproachingQuota = "ApproachingQuota"; + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSource.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSource.cs index cc95f10c6a6e..62ec50342b71 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSource.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSource.cs @@ -50,19 +50,19 @@ public DataSource() /// 'SecurityInsightsSecurityEventCollectionConfiguration', /// 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DnsAnalytics', /// 'ApplicationInsights', 'SqlDataClassification' - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. - /// The ETag of the data source. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The ETag of the data source. /// Resource tags. - public DataSource(object properties, string kind, string id = default(string), string name = default(string), string type = default(string), string eTag = default(string), IDictionary tags = default(IDictionary)) + public DataSource(object properties, string kind, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), IDictionary tags = default(IDictionary)) : base(id, name, type) { Properties = properties; - ETag = eTag; + Etag = etag; Kind = kind; Tags = tags; CustomInit(); @@ -83,8 +83,8 @@ public DataSource() /// /// Gets or sets the ETag of the data source. /// - [JsonProperty(PropertyName = "eTag")] - public string ETag { get; set; } + [JsonProperty(PropertyName = "etag")] + public string Etag { get; set; } /// /// Gets or sets possible values include: 'WindowsEvent', diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSourceType.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSourceType.cs index 1a23f4bf9d0a..9a20d7347e55 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSourceType.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/DataSourceType.cs @@ -24,7 +24,11 @@ public enum DataSourceType [EnumMember(Value = "CustomLogs")] CustomLogs, [EnumMember(Value = "AzureWatson")] - AzureWatson + AzureWatson, + [EnumMember(Value = "Query")] + Query, + [EnumMember(Value = "Alerts")] + Alerts } internal static class DataSourceTypeEnumExtension { @@ -41,6 +45,10 @@ internal static string ToSerializedValue(this DataSourceType value) return "CustomLogs"; case DataSourceType.AzureWatson: return "AzureWatson"; + case DataSourceType.Query: + return "Query"; + case DataSourceType.Alerts: + return "Alerts"; } return null; } @@ -53,6 +61,10 @@ internal static string ToSerializedValue(this DataSourceType value) return DataSourceType.CustomLogs; case "AzureWatson": return DataSourceType.AzureWatson; + case "Query": + return DataSourceType.Query; + case "Alerts": + return DataSourceType.Alerts; } return null; } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorDetail.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 000000000000..308fd06f3b34 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,85 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.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/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorResponse.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorResponse.cs index 00b0ece7d8dd..8ea5c4fc5282 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorResponse.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorResponse.cs @@ -11,13 +11,16 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models { using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// The resource management 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.). + /// public partial class ErrorResponse { /// @@ -31,18 +34,10 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// - /// 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)) + /// The error object. + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) { - Code = code; - Message = message; - Target = target; - Details = details; - AdditionalInfo = additionalInfo; + Error = error; CustomInit(); } @@ -52,34 +47,10 @@ public ErrorResponse() partial void CustomInit(); /// - /// Gets the error code. + /// Gets or sets the error object. /// - [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; } + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ClusterErrorResponseException.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorResponseException.cs similarity index 68% rename from sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ClusterErrorResponseException.cs rename to sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorResponseException.cs index 8b2f513cac38..9addf8aa02d2 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ClusterErrorResponseException.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ErrorResponseException.cs @@ -13,10 +13,10 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models using Microsoft.Rest; /// - /// Exception thrown for an invalid response with ClusterErrorResponse + /// Exception thrown for an invalid response with ErrorResponse /// information. /// - public partial class ClusterErrorResponseException : RestException + public partial class ErrorResponseException : RestException { /// /// Gets information about the associated HTTP request. @@ -31,30 +31,30 @@ public partial class ClusterErrorResponseException : RestException /// /// Gets or sets the body object. /// - public ClusterErrorResponse Body { get; set; } + public ErrorResponse Body { get; set; } /// - /// Initializes a new instance of the ClusterErrorResponseException class. + /// Initializes a new instance of the ErrorResponseException class. /// - public ClusterErrorResponseException() + public ErrorResponseException() { } /// - /// Initializes a new instance of the ClusterErrorResponseException class. + /// Initializes a new instance of the ErrorResponseException class. /// /// The exception message. - public ClusterErrorResponseException(string message) + public ErrorResponseException(string message) : this(message, null) { } /// - /// Initializes a new instance of the ClusterErrorResponseException class. + /// Initializes a new instance of the ErrorResponseException class. /// /// The exception message. /// Inner exception. - public ClusterErrorResponseException(string message, System.Exception innerException) + public ErrorResponseException(string message, System.Exception innerException) : base(message, innerException) { } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Identity.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Identity.cs index 00630de19cba..d41b26537594 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Identity.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Identity.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -29,16 +31,21 @@ public Identity() /// /// Initializes a new instance of the Identity class. /// - /// The identity type. Possible values include: - /// 'SystemAssigned', 'None' + /// Type of managed service identity. Possible + /// values include: 'SystemAssigned', 'UserAssigned', 'None' /// The principal ID of resource /// identity. /// The tenant ID of resource. - public Identity(IdentityType type, string principalId = default(string), string tenantId = default(string)) + /// The list of user identities + /// associated with the resource. The user identity dictionary key + /// references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + public Identity(IdentityType type, string principalId = default(string), string tenantId = default(string), IDictionary userAssignedIdentities = default(IDictionary)) { PrincipalId = principalId; TenantId = tenantId; Type = type; + UserAssignedIdentities = userAssignedIdentities; CustomInit(); } @@ -60,12 +67,21 @@ public Identity() public string TenantId { get; private set; } /// - /// Gets or sets the identity type. Possible values include: - /// 'SystemAssigned', 'None' + /// Gets or sets type of managed service identity. Possible values + /// include: 'SystemAssigned', 'UserAssigned', 'None' /// [JsonProperty(PropertyName = "type")] public IdentityType Type { get; set; } + /// + /// Gets or sets the list of user identities associated with the + /// resource. The user identity dictionary key references will be ARM + /// resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } + /// /// Validate the object. /// diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/IdentityType.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/IdentityType.cs index 1b33d0eeaa99..b63a090303c0 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/IdentityType.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/IdentityType.cs @@ -23,6 +23,8 @@ public enum IdentityType { [EnumMember(Value = "SystemAssigned")] SystemAssigned, + [EnumMember(Value = "UserAssigned")] + UserAssigned, [EnumMember(Value = "None")] None } @@ -39,6 +41,8 @@ internal static string ToSerializedValue(this IdentityType value) { case IdentityType.SystemAssigned: return "SystemAssigned"; + case IdentityType.UserAssigned: + return "UserAssigned"; case IdentityType.None: return "None"; } @@ -51,6 +55,8 @@ internal static string ToSerializedValue(this IdentityType value) { case "SystemAssigned": return IdentityType.SystemAssigned; + case "UserAssigned": + return IdentityType.UserAssigned; case "None": return IdentityType.None; } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/KeyVaultProperties.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/KeyVaultProperties.cs index 2e1e34ee3b76..2fc2a0e6b29e 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/KeyVaultProperties.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/KeyVaultProperties.cs @@ -35,11 +35,14 @@ public KeyVaultProperties() /// Analytics cluster. /// The version of the key associated with the /// Log Analytics cluster. - public KeyVaultProperties(string keyVaultUri = default(string), string keyName = default(string), string keyVersion = default(string)) + /// Selected key minimum required + /// size. + public KeyVaultProperties(string keyVaultUri = default(string), string keyName = default(string), string keyVersion = default(string), int? keyRsaSize = default(int?)) { KeyVaultUri = keyVaultUri; KeyName = keyName; KeyVersion = keyVersion; + KeyRsaSize = keyRsaSize; CustomInit(); } @@ -69,5 +72,11 @@ public KeyVaultProperties() [JsonProperty(PropertyName = "keyVersion")] public string KeyVersion { get; set; } + /// + /// Gets or sets selected key minimum required size. + /// + [JsonProperty(PropertyName = "keyRsaSize")] + public int? KeyRsaSize { get; set; } + } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedService.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedService.cs index 2676c7fdf67d..56b3f4f15a12 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedService.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedService.cs @@ -34,12 +34,12 @@ public LinkedService() /// /// Initializes a new instance of the LinkedService class. /// - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// The resource id of the resource that will /// be linked to the workspace. This should be used for linking /// resources which require read access diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedStorageAccountsResource.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedStorageAccountsResource.cs index 262005085c3b..9ea1f0c6c731 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedStorageAccountsResource.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/LinkedStorageAccountsResource.cs @@ -36,14 +36,15 @@ public LinkedStorageAccountsResource() /// Initializes a new instance of the LinkedStorageAccountsResource /// class. /// - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Linked storage accounts type. Possible - /// values include: 'CustomLogs', 'AzureWatson' + /// values include: 'CustomLogs', 'AzureWatson', 'Query', + /// 'Alerts' /// Linked storage accounts resources /// ids. public LinkedStorageAccountsResource(string id = default(string), string name = default(string), string type = default(string), DataSourceType? dataSourceType = default(DataSourceType?), IList storageAccountIds = default(IList)) @@ -61,7 +62,7 @@ public LinkedStorageAccountsResource() /// /// Gets linked storage accounts type. Possible values include: - /// 'CustomLogs', 'AzureWatson' + /// 'CustomLogs', 'AzureWatson', 'Query', 'Alerts' /// [JsonProperty(PropertyName = "properties.dataSourceType")] public DataSourceType? DataSourceType { get; private set; } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ProxyResource.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ProxyResource.cs index 56d9b449ab59..431122ae6974 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ProxyResource.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/ProxyResource.cs @@ -13,9 +13,12 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models using System.Linq; /// - /// The resource model definition for a ARM proxy resource. It will have - /// everything other than required location and tags + /// 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 { /// @@ -29,12 +32,12 @@ public ProxyResource() /// /// Initializes a new instance of the ProxyResource class. /// - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) : base(id, name, type) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Resource.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Resource.cs index 5a7efcc5738c..da86706ff956 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Resource.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Resource.cs @@ -15,6 +15,13 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models using Newtonsoft.Json; using System.Linq; + /// + /// Resource + /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// public partial class Resource : IResource { /// @@ -28,12 +35,12 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" public Resource(string id = default(string), string name = default(string), string type = default(string)) { Id = id; @@ -48,7 +55,7 @@ public Resource() partial void CustomInit(); /// - /// Gets fully qualified resource Id for the resource. Ex - + /// Gets fully qualified resource ID for the resource. Ex - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [JsonProperty(PropertyName = "id")] @@ -61,9 +68,9 @@ public Resource() public string Name { get; private set; } /// - /// Gets the type of the resource. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// [JsonProperty(PropertyName = "type")] public string Type { get; private set; } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SavedSearch.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SavedSearch.cs index 18fae783328c..1a3466d18f79 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SavedSearch.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/SavedSearch.cs @@ -37,17 +37,15 @@ public SavedSearch() /// The category of the saved search. This helps /// the user to find a saved search faster. /// Saved search display name. - /// The query expression for the saved search. - /// Please see - /// https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference - /// for reference. - /// Fully qualified resource Id for the resource. Ex - + /// The query expression for the saved + /// search. + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. - /// The ETag of the saved search. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// The ETag of the saved search. /// The function alias if query serves as a /// function. /// The optional function parameters @@ -59,10 +57,10 @@ public SavedSearch() /// The version number of the query language. The /// current version is 2 and is the default. /// The tags attached to the saved search. - public SavedSearch(string category, string displayName, string query, string id = default(string), string name = default(string), string type = default(string), string eTag = default(string), string functionAlias = default(string), string functionParameters = default(string), long? version = default(long?), IList tags = default(IList)) + public SavedSearch(string category, string displayName, string query, string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string functionAlias = default(string), string functionParameters = default(string), long? version = default(long?), IList tags = default(IList)) : base(id, name, type) { - ETag = eTag; + Etag = etag; Category = category; DisplayName = displayName; Query = query; @@ -81,8 +79,8 @@ public SavedSearch() /// /// Gets or sets the ETag of the saved search. /// - [JsonProperty(PropertyName = "eTag")] - public string ETag { get; set; } + [JsonProperty(PropertyName = "etag")] + public string Etag { get; set; } /// /// Gets or sets the category of the saved search. This helps the user @@ -98,9 +96,7 @@ public SavedSearch() public string DisplayName { get; set; } /// - /// Gets or sets the query expression for the saved search. Please see - /// https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-search-reference - /// for reference. + /// Gets or sets the query expression for the saved search. /// [JsonProperty(PropertyName = "properties.query")] public string Query { get; set; } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/StorageInsight.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/StorageInsight.cs index 2e9977c5a013..0e95b99f9a8f 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/StorageInsight.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/StorageInsight.cs @@ -36,12 +36,12 @@ public StorageInsight() /// /// The storage account connection /// details - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// The names of the blob containers that the /// workspace should read /// The names of the Azure tables that the 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 new file mode 100644 index 000000000000..afd2355aae7d --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Table.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Workspace data table definition. + /// + [Rest.Serialization.JsonTransformation] + public partial class Table : ProxyResource + { + /// + /// Initializes a new instance of the Table class. + /// + public Table() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Table 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" + /// 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)) + : base(id, name, type) + { + RetentionInDays = retentionInDays; + IsTroubleshootingAllowed = isTroubleshootingAllowed; + IsTroubleshootEnabled = isTroubleshootEnabled; + LastTroubleshootDate = lastTroubleshootDate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the data table data retention in days, between 7 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. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (RetentionInDays > 730) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "RetentionInDays", 730); + } + if (RetentionInDays < 7) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", 7); + } + } + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TrackedResource.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TrackedResource.cs index 532847382815..3bf49fa1ae27 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TrackedResource.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/TrackedResource.cs @@ -17,8 +17,12 @@ namespace Microsoft.Azure.Management.OperationalInsights.Models using System.Linq; /// - /// The resource model definition for a ARM tracked top level resource + /// 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 { /// @@ -34,12 +38,12 @@ public TrackedResource() /// /// The geo-location where the resource /// lives - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource tags. public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) : base(id, name, type) diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/UserIdentityProperties.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/UserIdentityProperties.cs new file mode 100644 index 000000000000..ebe5da6faf3a --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/UserIdentityProperties.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// User assigned identity properties. + /// + public partial class UserIdentityProperties + { + /// + /// Initializes a new instance of the UserIdentityProperties class. + /// + public UserIdentityProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserIdentityProperties class. + /// + /// The principal id of user assigned + /// identity. + /// The client id of user assigned + /// identity. + public UserIdentityProperties(string principalId = default(string), string clientId = default(string)) + { + PrincipalId = principalId; + ClientId = clientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal id of user assigned identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the client id of user assigned identity. + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; private set; } + + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Workspace.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Workspace.cs index 6a80c04c246d..e4e089e55c7a 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Workspace.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/Workspace.cs @@ -36,12 +36,12 @@ public Workspace() /// /// The geo-location where the resource /// lives - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource tags. /// The provisioning state of the /// workspace. Possible values include: 'Creating', 'Succeeded', @@ -51,27 +51,39 @@ public Workspace() /// the ID associated with the workspace. /// The SKU of the workspace. /// The workspace data retention in days. - /// -1 means Unlimited retention for the Unlimited Sku. 730 days is the - /// maximum allowed for all other Skus. + /// Allowed values are per pricing plan. See pricing tiers + /// documentation for details. + /// The daily volume cap for + /// ingestion. + /// Workspace creation date. + /// Workspace modification date. /// The network access /// type for accessing Log Analytics ingestion. Possible values /// include: 'Enabled', 'Disabled' /// The network access type /// for accessing Log Analytics query. Possible values include: /// 'Enabled', 'Disabled' + /// Indicates whether customer managed + /// storage is mandatory for query management. /// List of linked private /// link scope resources. + /// Workspace features. /// The ETag of the workspace. - public Workspace(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), IList privateLinkScopedResources = default(IList), string eTag = default(string)) + public Workspace(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), IList privateLinkScopedResources = default(IList), IDictionary features = default(IDictionary), string eTag = default(string)) : base(location, id, name, type, tags) { ProvisioningState = provisioningState; CustomerId = customerId; Sku = sku; RetentionInDays = retentionInDays; + WorkspaceCapping = workspaceCapping; + CreatedDate = createdDate; + ModifiedDate = modifiedDate; PublicNetworkAccessForIngestion = publicNetworkAccessForIngestion; PublicNetworkAccessForQuery = publicNetworkAccessForQuery; + ForceCmkForQuery = forceCmkForQuery; PrivateLinkScopedResources = privateLinkScopedResources; + Features = features; ETag = eTag; CustomInit(); } @@ -103,13 +115,30 @@ public Workspace() public WorkspaceSku Sku { get; set; } /// - /// Gets or sets the workspace data retention in days. -1 means - /// Unlimited retention for the Unlimited Sku. 730 days is the maximum - /// allowed for all other Skus. + /// Gets or sets the workspace data retention in days. Allowed values + /// are per pricing plan. See pricing tiers documentation for details. /// [JsonProperty(PropertyName = "properties.retentionInDays")] public int? RetentionInDays { get; set; } + /// + /// Gets or sets the daily volume cap for ingestion. + /// + [JsonProperty(PropertyName = "properties.workspaceCapping")] + public WorkspaceCapping WorkspaceCapping { get; set; } + + /// + /// Gets workspace creation date. + /// + [JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate { get; private set; } + + /// + /// Gets workspace modification date. + /// + [JsonProperty(PropertyName = "properties.modifiedDate")] + public string ModifiedDate { get; private set; } + /// /// Gets or sets the network access type for accessing Log Analytics /// ingestion. Possible values include: 'Enabled', 'Disabled' @@ -124,12 +153,25 @@ public Workspace() [JsonProperty(PropertyName = "properties.publicNetworkAccessForQuery")] public string PublicNetworkAccessForQuery { get; set; } + /// + /// Gets or sets indicates whether customer managed storage is + /// mandatory for query management. + /// + [JsonProperty(PropertyName = "properties.forceCmkForQuery")] + public bool? ForceCmkForQuery { get; set; } + /// /// Gets list of linked private link scope resources. /// [JsonProperty(PropertyName = "properties.privateLinkScopedResources")] public IList PrivateLinkScopedResources { get; private set; } + /// + /// Gets or sets workspace features. + /// + [JsonProperty(PropertyName = "properties.properties.features")] + public IDictionary Features { get; set; } + /// /// Gets or sets the ETag of the workspace. /// @@ -149,14 +191,6 @@ public override void Validate() { Sku.Validate(); } - if (RetentionInDays > 730) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "RetentionInDays", 730); - } - if (RetentionInDays < -1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", -1); - } } } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceCapping.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceCapping.cs new file mode 100644 index 000000000000..21334397f8a0 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceCapping.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The daily volume cap for ingestion. + /// + public partial class WorkspaceCapping + { + /// + /// Initializes a new instance of the WorkspaceCapping class. + /// + public WorkspaceCapping() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the WorkspaceCapping class. + /// + /// The workspace daily quota for + /// ingestion. + /// The time when the quota will be + /// rest. + /// The status of data ingestion for + /// this workspace. Possible values include: 'RespectQuota', 'ForceOn', + /// 'ForceOff', 'OverQuota', 'SubscriptionSuspended', + /// 'ApproachingQuota' + public WorkspaceCapping(double? dailyQuotaGb = default(double?), string quotaNextResetTime = default(string), string dataIngestionStatus = default(string)) + { + DailyQuotaGb = dailyQuotaGb; + QuotaNextResetTime = quotaNextResetTime; + DataIngestionStatus = dataIngestionStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the workspace daily quota for ingestion. + /// + [JsonProperty(PropertyName = "dailyQuotaGb")] + public double? DailyQuotaGb { get; set; } + + /// + /// Gets the time when the quota will be rest. + /// + [JsonProperty(PropertyName = "quotaNextResetTime")] + public string QuotaNextResetTime { get; private set; } + + /// + /// Gets the status of data ingestion for this workspace. Possible + /// values include: 'RespectQuota', 'ForceOn', 'ForceOff', 'OverQuota', + /// 'SubscriptionSuspended', 'ApproachingQuota' + /// + [JsonProperty(PropertyName = "dataIngestionStatus")] + public string DataIngestionStatus { get; private set; } + + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspacePatch.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspacePatch.cs index c70424073d7f..b167893cd1ed 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspacePatch.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspacePatch.cs @@ -34,12 +34,12 @@ public WorkspacePatch() /// /// Initializes a new instance of the WorkspacePatch class. /// - /// Fully qualified resource Id for the resource. Ex - + /// 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. Ex- - /// Microsoft.Compute/virtualMachines or - /// Microsoft.Storage/storageAccounts. + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// Resource Etag. /// The provisioning state of the /// workspace. Possible values include: 'Creating', 'Succeeded', @@ -49,27 +49,39 @@ public WorkspacePatch() /// the ID associated with the workspace. /// The SKU of the workspace. /// The workspace data retention in days. - /// -1 means Unlimited retention for the Unlimited Sku. 730 days is the - /// maximum allowed for all other Skus. + /// Allowed values are per pricing plan. See pricing tiers + /// documentation for details. + /// The daily volume cap for + /// ingestion. + /// Workspace creation date. + /// Workspace modification date. /// The network access /// type for accessing Log Analytics ingestion. Possible values /// include: 'Enabled', 'Disabled' /// The network access type /// for accessing Log Analytics query. Possible values include: /// 'Enabled', 'Disabled' + /// Indicates whether customer managed + /// storage is mandatory for query management. /// List of linked private /// link scope resources. + /// Workspace features. /// Resource tags. Optional. - public WorkspacePatch(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), IList privateLinkScopedResources = default(IList), IDictionary tags = default(IDictionary)) + public WorkspacePatch(string id = default(string), string name = default(string), string type = default(string), string etag = default(string), string provisioningState = default(string), string customerId = default(string), WorkspaceSku sku = default(WorkspaceSku), int? retentionInDays = default(int?), WorkspaceCapping workspaceCapping = default(WorkspaceCapping), string createdDate = default(string), string modifiedDate = default(string), string publicNetworkAccessForIngestion = default(string), string publicNetworkAccessForQuery = default(string), bool? forceCmkForQuery = default(bool?), IList privateLinkScopedResources = default(IList), IDictionary features = default(IDictionary), IDictionary tags = default(IDictionary)) : base(id, name, type, etag) { ProvisioningState = provisioningState; CustomerId = customerId; Sku = sku; RetentionInDays = retentionInDays; + WorkspaceCapping = workspaceCapping; + CreatedDate = createdDate; + ModifiedDate = modifiedDate; PublicNetworkAccessForIngestion = publicNetworkAccessForIngestion; PublicNetworkAccessForQuery = publicNetworkAccessForQuery; + ForceCmkForQuery = forceCmkForQuery; PrivateLinkScopedResources = privateLinkScopedResources; + Features = features; Tags = tags; CustomInit(); } @@ -101,13 +113,30 @@ public WorkspacePatch() public WorkspaceSku Sku { get; set; } /// - /// Gets or sets the workspace data retention in days. -1 means - /// Unlimited retention for the Unlimited Sku. 730 days is the maximum - /// allowed for all other Skus. + /// Gets or sets the workspace data retention in days. Allowed values + /// are per pricing plan. See pricing tiers documentation for details. /// [JsonProperty(PropertyName = "properties.retentionInDays")] public int? RetentionInDays { get; set; } + /// + /// Gets or sets the daily volume cap for ingestion. + /// + [JsonProperty(PropertyName = "properties.workspaceCapping")] + public WorkspaceCapping WorkspaceCapping { get; set; } + + /// + /// Gets workspace creation date. + /// + [JsonProperty(PropertyName = "properties.createdDate")] + public string CreatedDate { get; private set; } + + /// + /// Gets workspace modification date. + /// + [JsonProperty(PropertyName = "properties.modifiedDate")] + public string ModifiedDate { get; private set; } + /// /// Gets or sets the network access type for accessing Log Analytics /// ingestion. Possible values include: 'Enabled', 'Disabled' @@ -122,12 +151,25 @@ public WorkspacePatch() [JsonProperty(PropertyName = "properties.publicNetworkAccessForQuery")] public string PublicNetworkAccessForQuery { get; set; } + /// + /// Gets or sets indicates whether customer managed storage is + /// mandatory for query management. + /// + [JsonProperty(PropertyName = "properties.forceCmkForQuery")] + public bool? ForceCmkForQuery { get; set; } + /// /// Gets list of linked private link scope resources. /// [JsonProperty(PropertyName = "properties.privateLinkScopedResources")] public IList PrivateLinkScopedResources { get; private set; } + /// + /// Gets or sets workspace features. + /// + [JsonProperty(PropertyName = "properties.properties.features")] + public IDictionary Features { get; set; } + /// /// Gets or sets resource tags. Optional. /// @@ -146,14 +188,6 @@ public virtual void Validate() { Sku.Validate(); } - if (RetentionInDays > 730) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "RetentionInDays", 730); - } - if (RetentionInDays < -1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RetentionInDays", -1); - } } } } 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 089b4582fe4b..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 @@ -32,10 +32,17 @@ public WorkspaceSku() /// /// The name of the SKU. Possible values include: /// 'Free', 'Standard', 'Premium', 'PerNode', 'PerGB2018', - /// 'Standalone', 'CapacityReservation' - public WorkspaceSku(string name) + /// 'Standalone', 'CapacityReservation', 'LACluster' + /// The capacity reservation + /// level for this workspace, when CapacityReservation sku is + /// selected. + /// The last time when the sku was + /// updated. + public WorkspaceSku(string name, int? capacityReservationLevel = default(int?), string lastSkuUpdate = default(string)) { Name = name; + CapacityReservationLevel = capacityReservationLevel; + LastSkuUpdate = lastSkuUpdate; CustomInit(); } @@ -47,11 +54,24 @@ public WorkspaceSku(string name) /// /// Gets or sets the name of the SKU. Possible values include: 'Free', /// 'Standard', 'Premium', 'PerNode', 'PerGB2018', 'Standalone', - /// 'CapacityReservation' + /// 'CapacityReservation', 'LACluster' /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } + /// + /// Gets or sets the capacity reservation level for this workspace, + /// when CapacityReservation sku is selected. + /// + [JsonProperty(PropertyName = "capacityReservationLevel")] + public int? CapacityReservationLevel { get; set; } + + /// + /// Gets the last time when the sku was updated. + /// + [JsonProperty(PropertyName = "lastSkuUpdate")] + public string LastSkuUpdate { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceSkuNameEnum.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceSkuNameEnum.cs index 2fa428731703..8706725bae8d 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceSkuNameEnum.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Models/WorkspaceSkuNameEnum.cs @@ -23,5 +23,6 @@ public static class WorkspaceSkuNameEnum public const string PerGB2018 = "PerGB2018"; public const string Standalone = "Standalone"; public const string CapacityReservation = "CapacityReservation"; + public const string LACluster = "LACluster"; } } diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationStatusesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationStatusesOperations.cs index 04d462bb0241..c2d691db9046 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationStatusesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationStatusesOperations.cs @@ -90,17 +90,6 @@ internal OperationStatusesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "asyncOperationId"); } - 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"); @@ -112,6 +101,7 @@ internal OperationStatusesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -121,6 +111,7 @@ internal OperationStatusesOperations(OperationalInsightsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("asyncOperationId", asyncOperationId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -131,9 +122,9 @@ internal OperationStatusesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{asyncOperationId}", System.Uri.EscapeDataString(asyncOperationId)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { 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 5847d07adee8..96bbd379fa5d 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationalInsightsManagementClient.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/OperationalInsightsManagementClient.cs @@ -46,11 +46,6 @@ public partial class OperationalInsightsManagementClient : ServiceClient public ServiceClientCredentials Credentials { get; private set; } - /// - /// The API version to use for this operation. - /// - public string ApiVersion { get; private set; } - /// /// The ID of the target subscription. /// @@ -104,11 +99,6 @@ public partial class OperationalInsightsManagementClient : ServiceClient public virtual IManagementGroupsOperations ManagementGroups { get; private set; } - /// - /// Gets the IOperations. - /// - public virtual IOperations Operations { get; private set; } - /// /// Gets the IOperationStatusesOperations. /// @@ -124,21 +114,6 @@ public partial class OperationalInsightsManagementClient : ServiceClient public virtual IUsagesOperations Usages { get; private set; } - /// - /// Gets the IWorkspacesOperations. - /// - public virtual IWorkspacesOperations Workspaces { get; private set; } - - /// - /// Gets the IDeletedWorkspacesOperations. - /// - public virtual IDeletedWorkspacesOperations DeletedWorkspaces { get; private set; } - - /// - /// Gets the IClustersOperations. - /// - public virtual IClustersOperations Clusters { get; private set; } - /// /// Gets the IStorageInsightConfigsOperations. /// @@ -169,6 +144,31 @@ public partial class OperationalInsightsManagementClient : ServiceClient public virtual IWorkspacePurgeOperations WorkspacePurge { get; private set; } + /// + /// Gets the IClustersOperations. + /// + public virtual IClustersOperations Clusters { get; private set; } + + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the ITablesOperations. + /// + public virtual ITablesOperations Tables { get; private set; } + + /// + /// Gets the IWorkspacesOperations. + /// + public virtual IWorkspacesOperations Workspaces { get; private set; } + + /// + /// Gets the IDeletedWorkspacesOperations. + /// + public virtual IDeletedWorkspacesOperations DeletedWorkspaces { get; private set; } + /// /// Initializes a new instance of the OperationalInsightsManagementClient class. /// @@ -416,21 +416,21 @@ private void Initialize() LinkedServices = new LinkedServicesOperations(this); LinkedStorageAccounts = new LinkedStorageAccountsOperations(this); ManagementGroups = new ManagementGroupsOperations(this); - Operations = new Operations(this); OperationStatuses = new OperationStatusesOperations(this); SharedKeys = new SharedKeysOperations(this); Usages = new UsagesOperations(this); - Workspaces = new WorkspacesOperations(this); - DeletedWorkspaces = new DeletedWorkspacesOperations(this); - Clusters = new ClustersOperations(this); StorageInsightConfigs = new StorageInsightConfigsOperations(this); SavedSearches = new SavedSearchesOperations(this); AvailableServiceTiers = new AvailableServiceTiersOperations(this); Gateways = new GatewaysOperations(this); Schema = new SchemaOperations(this); WorkspacePurge = new WorkspacePurgeOperations(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"); - ApiVersion = "2020-03-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Operations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Operations.cs index 804a636e40ed..9a6f47727500 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Operations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/Operations.cs @@ -59,34 +59,18 @@ internal Operations(OperationalInsightsManagementClient client) /// /// 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(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); - } - } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -94,6 +78,7 @@ internal Operations(OperationalInsightsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -101,9 +86,9 @@ internal Operations(OperationalInsightsManagementClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.OperationalInsights/operations").ToString(); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -165,14 +150,13 @@ internal Operations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -182,10 +166,6 @@ internal Operations(OperationalInsightsManagementClient client) } 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); @@ -242,7 +222,7 @@ internal Operations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -338,14 +318,13 @@ internal Operations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -355,10 +334,6 @@ internal Operations(OperationalInsightsManagementClient client) } 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); diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SavedSearchesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SavedSearchesOperations.cs index 6ae17dca058c..f3e21ee70660 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SavedSearchesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SavedSearchesOperations.cs @@ -135,17 +135,7 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "savedSearchId"); } - 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); - } - } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -156,6 +146,7 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("savedSearchId", savedSearchId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -167,9 +158,9 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{savedSearchId}", System.Uri.EscapeDataString(savedSearchId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -369,17 +360,6 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "savedSearchId"); } - 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 (parameters == null) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); @@ -388,6 +368,7 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) { parameters.Validate(); } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -398,6 +379,7 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("savedSearchId", savedSearchId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); @@ -410,9 +392,9 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{savedSearchId}", System.Uri.EscapeDataString(savedSearchId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -633,17 +615,7 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "savedSearchId"); } - 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); - } - } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -654,6 +626,7 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("savedSearchId", savedSearchId); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -665,9 +638,9 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{savedSearchId}", System.Uri.EscapeDataString(savedSearchId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -864,17 +837,6 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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"); @@ -886,6 +848,7 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -895,6 +858,7 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); } @@ -905,9 +869,9 @@ internal SavedSearchesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SchemaOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SchemaOperations.cs index 26884bba5fb7..5709da8a6bcd 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SchemaOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SchemaOperations.cs @@ -120,17 +120,6 @@ internal SchemaOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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"); @@ -142,6 +131,7 @@ internal SchemaOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -151,6 +141,7 @@ internal SchemaOperations(OperationalInsightsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -161,9 +152,9 @@ internal SchemaOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { 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 b3ea3aa28bba..4c8551057b33 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 @@ -19,38 +19,28 @@ public static IEnumerable> ApiInfo_OperationalInsi { return new Tuple[] { - new Tuple("OperationalInsights", "AvailableServiceTiers", "2020-03-01-preview"), - new Tuple("OperationalInsights", "Clusters", "2020-03-01-preview"), - new Tuple("OperationalInsights", "DataExports", "2020-03-01-preview"), - new Tuple("OperationalInsights", "DataSources", "2020-03-01-preview"), - new Tuple("OperationalInsights", "DeletedWorkspaces", "2020-03-01-preview"), - new Tuple("OperationalInsights", "Gateways", "2020-03-01-preview"), - new Tuple("OperationalInsights", "IntelligencePacks", "2020-03-01-preview"), - new Tuple("OperationalInsights", "LinkedServices", "2020-03-01-preview"), - new Tuple("OperationalInsights", "LinkedStorageAccounts", "2020-03-01-preview"), - new Tuple("OperationalInsights", "ManagementGroups", "2020-03-01-preview"), - new Tuple("OperationalInsights", "OperationStatuses", "2020-03-01-preview"), - new Tuple("OperationalInsights", "Operations", "2020-03-01-preview"), - new Tuple("OperationalInsights", "SavedSearches", "2020-03-01-preview"), - new Tuple("OperationalInsights", "Schema", "2020-03-01-preview"), - new Tuple("OperationalInsights", "SharedKeys", "2020-03-01-preview"), - new Tuple("OperationalInsights", "StorageInsightConfigs", "2020-03-01-preview"), - new Tuple("OperationalInsights", "Usages", "2020-03-01-preview"), - new Tuple("OperationalInsights", "WorkspacePurge", "2020-03-01-preview"), - new Tuple("OperationalInsights", "Workspaces", "2020-03-01-preview"), + new Tuple("OperationalInsights", "AvailableServiceTiers", "2020-08-01"), + new Tuple("OperationalInsights", "Clusters", "2020-10-01"), + new Tuple("OperationalInsights", "DataExports", "2020-08-01"), + new Tuple("OperationalInsights", "DataSources", "2020-08-01"), + new Tuple("OperationalInsights", "DeletedWorkspaces", "2020-10-01"), + new Tuple("OperationalInsights", "Gateways", "2020-08-01"), + new Tuple("OperationalInsights", "IntelligencePacks", "2020-08-01"), + new Tuple("OperationalInsights", "LinkedServices", "2020-08-01"), + new Tuple("OperationalInsights", "LinkedStorageAccounts", "2020-08-01"), + new Tuple("OperationalInsights", "ManagementGroups", "2020-08-01"), + new Tuple("OperationalInsights", "OperationStatuses", "2020-08-01"), + new Tuple("OperationalInsights", "Operations", "2020-10-01"), + new Tuple("OperationalInsights", "SavedSearches", "2020-08-01"), + 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", "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=D:\\workspace\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "b069b0fa4817788d6363007645cae04317864f09"; - 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/SharedKeysOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SharedKeysOperations.cs index a09eb33bbbe2..b42efc65d774 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SharedKeysOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/SharedKeysOperations.cs @@ -120,17 +120,6 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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"); @@ -142,6 +131,7 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -151,6 +141,7 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetSharedKeys", tracingParameters); } @@ -161,9 +152,9 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -372,17 +363,7 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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); - } - } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -392,6 +373,7 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Regenerate", tracingParameters); } @@ -402,9 +384,9 @@ internal SharedKeysOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/StorageInsightConfigsOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/StorageInsightConfigsOperations.cs index 076962dfd0b0..79a48b5f150a 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/StorageInsightConfigsOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/StorageInsightConfigsOperations.cs @@ -138,17 +138,6 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli { parameters.Validate(); } - 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"); @@ -160,6 +149,7 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -171,6 +161,7 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("storageInsightName", storageInsightName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } @@ -182,9 +173,9 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _url = _url.Replace("{storageInsightName}", System.Uri.EscapeDataString(storageInsightName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -412,17 +403,6 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "storageInsightName"); } - 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"); @@ -434,6 +414,7 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -444,6 +425,7 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("storageInsightName", storageInsightName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -455,9 +437,9 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _url = _url.Replace("{storageInsightName}", System.Uri.EscapeDataString(storageInsightName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -658,17 +640,6 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "storageInsightName"); } - 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"); @@ -680,6 +651,7 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -690,6 +662,7 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("storageInsightName", storageInsightName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -701,9 +674,9 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _url = _url.Replace("{storageInsightName}", System.Uri.EscapeDataString(storageInsightName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -882,17 +855,6 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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"); @@ -904,6 +866,7 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -913,6 +876,7 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", tracingParameters); } @@ -923,9 +887,9 @@ internal StorageInsightConfigsOperations(OperationalInsightsManagementClient cli _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs new file mode 100644 index 000000000000..194ae186e9cc --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperations.cs @@ -0,0 +1,764 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + 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; + + /// + /// TablesOperations operations. + /// + internal partial class TablesOperations : IServiceOperations, ITablesOperations + { + /// + /// Initializes a new instance of the TablesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal TablesOperations(OperationalInsightsManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the OperationalInsightsManagementClient + /// + public OperationalInsightsManagementClient Client { get; private set; } + + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// 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>> ListByWorkspaceWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + string apiVersion = "2020-10-01"; + // 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("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByWorkspace", 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}/tables").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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates a Log Analytics workspace table properties. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table 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> UpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string tableName, Table parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2020-10-01"; + // 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("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + tracingParameters.Add("parameters", parameters); + 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}/tables/{tableName}").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("{tableName}", System.Uri.EscapeDataString(tableName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("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(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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// 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 tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + 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 (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (workspaceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "workspaceName"); + } + if (workspaceName != null) + { + if (workspaceName.Length > 63) + { + throw new ValidationException(ValidationRules.MaxLength, "workspaceName", 63); + } + if (workspaceName.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "workspaceName", 4); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(workspaceName, "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$")) + { + throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); + } + } + if (tableName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); + } + string apiVersion = "2020-10-01"; + // 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("apiVersion", apiVersion); + tracingParameters.Add("tableName", tableName); + 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}/tables/{tableName}").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("{tableName}", System.Uri.EscapeDataString(tableName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse
(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject
(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs new file mode 100644 index 000000000000..9578086d4a28 --- /dev/null +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/TablesOperationsExtensions.cs @@ -0,0 +1,165 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.OperationalInsights +{ + 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 TablesOperations. + /// + public static partial class TablesOperationsExtensions + { + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// 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 IEnumerable
ListByWorkspace(this ITablesOperations operations, string resourceGroupName, string workspaceName) + { + return operations.ListByWorkspaceAsync(resourceGroupName, workspaceName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the tables for the specified Log Analytics workspace. + /// + /// + /// 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> ListByWorkspaceAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByWorkspaceWithHttpMessagesAsync(resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates a Log Analytics workspace table properties. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + public static Table Update(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters) + { + return operations.UpdateAsync(resourceGroupName, workspaceName, tableName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates a Log Analytics workspace table properties. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The parameters required to update table properties. + /// + /// + /// The cancellation token. + /// + public static async Task
UpdateAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, Table parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + public static Table Get(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName) + { + return operations.GetAsync(resourceGroupName, workspaceName, tableName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Log Analytics workspace table. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the workspace. + /// + /// + /// The name of the table. + /// + /// + /// The cancellation token. + /// + public static async Task
GetAsync(this ITablesOperations operations, string resourceGroupName, string workspaceName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, workspaceName, tableName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/UsagesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/UsagesOperations.cs index 69348d9d5882..4ea24193db79 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/UsagesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/UsagesOperations.cs @@ -120,17 +120,6 @@ internal UsagesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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"); @@ -142,6 +131,7 @@ internal UsagesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -151,6 +141,7 @@ internal UsagesOperations(OperationalInsightsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -161,9 +152,9 @@ internal UsagesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/WorkspacePurgeOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/WorkspacePurgeOperations.cs index 10c081c3004e..ca74ab7036b6 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/WorkspacePurgeOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/WorkspacePurgeOperations.cs @@ -112,17 +112,6 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - 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"); @@ -161,6 +150,7 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) { body.Validate(); } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -169,6 +159,7 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); @@ -181,9 +172,9 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -384,17 +375,6 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - 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"); @@ -429,6 +409,7 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "purgeId"); } + string apiVersion = "2020-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -437,6 +418,7 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("purgeId", purgeId); tracingParameters.Add("cancellationToken", cancellationToken); @@ -450,9 +432,9 @@ internal WorkspacePurgeOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{purgeId}", System.Uri.EscapeDataString(purgeId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/WorkspacesOperations.cs b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/WorkspacesOperations.cs index 8a03600e471e..5e4958a6ad33 100644 --- a/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/WorkspacesOperations.cs +++ b/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/WorkspacesOperations.cs @@ -59,7 +59,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -76,17 +76,6 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// 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); - } - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -98,6 +87,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -105,6 +95,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -113,9 +104,9 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -177,14 +168,13 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -194,10 +184,6 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) } 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); @@ -254,7 +240,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -290,17 +276,6 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - 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"); @@ -312,6 +287,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -320,6 +296,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } @@ -329,9 +306,9 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -393,14 +370,13 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -410,10 +386,6 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) } 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); @@ -527,7 +499,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -582,17 +554,6 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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"); @@ -604,6 +565,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -613,6 +575,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -623,9 +586,9 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -687,14 +650,13 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -704,10 +666,6 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) } 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); @@ -770,7 +728,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -829,17 +787,6 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - 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"); @@ -851,6 +798,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -861,6 +809,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } @@ -871,9 +820,9 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -941,14 +890,13 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -958,10 +906,6 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) } 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); @@ -1024,7 +968,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1087,17 +1031,6 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) { parameters.Validate(); } - 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"); @@ -1109,6 +1042,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1119,6 +1053,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); tracingParameters.Add("parameters", parameters); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } @@ -1129,9 +1064,9 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1199,14 +1134,13 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1216,10 +1150,6 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) } 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); @@ -1304,7 +1234,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1356,17 +1286,6 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.Pattern, "workspaceName", "^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$"); } } - 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"); @@ -1378,6 +1297,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + string apiVersion = "2020-10-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1387,6 +1307,7 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("workspaceName", workspaceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("force", force); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); @@ -1398,9 +1319,9 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) _url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (force != null) { @@ -1466,14 +1387,13 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1483,10 +1403,6 @@ internal WorkspacesOperations(OperationalInsightsManagementClient client) } 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);