From 73ff182a16cb73252a657bcf2471e29486bdcc1d Mon Sep 17 00:00:00 2001 From: rbandi124 <143381870+rbandi124@users.noreply.github.com> Date: Wed, 24 Jun 2026 17:04:21 -0700 Subject: [PATCH 1/3] generate sdk code --- .../ApplyUpdateForResourceGroupOperations.cs | 203 +++- ...ateForResourceGroupOperationsExtensions.cs | 41 +- .../Generated/ApplyUpdatesOperations.cs | 407 ++++++-- .../ApplyUpdatesOperationsExtensions.cs | 97 +- ...onAssignmentsForResourceGroupOperations.cs | 132 ++- ...ntsForResourceGroupOperationsExtensions.cs | 32 +- ...onAssignmentsForSubscriptionsOperations.cs | 58 +- ...ntsForSubscriptionsOperationsExtensions.cs | 20 +- .../ConfigurationAssignmentsOperations.cs | 874 +++++++++++++----- ...gurationAssignmentsOperationsExtensions.cs | 248 +++-- ...AssignmentsWithinSubscriptionOperations.cs | 193 +++- ...sWithinSubscriptionOperationsExtensions.cs | 45 +- .../IApplyUpdateForResourceGroupOperations.cs | 27 +- .../Generated/IApplyUpdatesOperations.cs | 57 +- ...onAssignmentsForResourceGroupOperations.cs | 16 +- ...onAssignmentsForSubscriptionsOperations.cs | 12 +- .../IConfigurationAssignmentsOperations.cs | 132 ++- ...AssignmentsWithinSubscriptionOperations.cs | 33 +- ...onfigurationsForResourceGroupOperations.cs | 27 +- .../IMaintenanceConfigurationsOperations.cs | 59 +- .../Generated/IMaintenanceManagementClient.cs | 43 +- .../Generated/IOperations.cs | 31 +- ...blicMaintenanceConfigurationsOperations.cs | 27 +- .../Generated/IScheduledEventsOperations.cs | 82 ++ .../Generated/IUpdatesOperations.cs | 54 +- ...onfigurationsForResourceGroupOperations.cs | 203 +++- ...onsForResourceGroupOperationsExtensions.cs | 41 +- .../MaintenanceConfigurationsOperations.cs | 387 ++++++-- ...nanceConfigurationsOperationsExtensions.cs | 97 +- .../Generated/MaintenanceManagementClient.cs | 60 +- .../Generated/Models/ActionType.cs | 18 + .../Generated/Models/ApplyUpdate.cs | 10 +- .../Generated/Models/ApplyUpdateProperties.cs | 69 ++ .../ApplyUpdatesCreateOrUpdateHeaders.cs | 45 + ...ApplyUpdatesCreateOrUpdateParentHeaders.cs | 45 + .../Models/ConfigurationAssignment.cs | 10 +- .../ConfigurationAssignmentProperties.cs | 68 ++ .../Generated/Models/InputLinuxParameters.cs | 6 +- .../Models/InputWindowsParameters.cs | 8 +- .../Models/MaintenanceConfiguration.cs | 10 +- .../MaintenanceConfigurationProperties.cs | 196 ++++ .../Generated/Models/MaintenanceWindow.cs | 141 +++ .../Generated/Models/Operation.cs | 66 +- .../Generated/Models/OperationDisplay.cs | 88 ++ .../Generated/Models/OperationInfo.cs | 78 -- .../Generated/Models/Origin.cs | 20 + .../Generated/Models/Page.cs | 2 +- .../Generated/Models/ProxyResource.cs | 59 ++ .../Generated/Models/Resource.cs | 23 +- .../ScheduledEventsAcknowledgeErrorDetails.cs | 73 ++ .../Models/ScheduledEventsApproveResponse.cs | 48 + .../Generated/Models/ScheduledEventsIdList.cs | 62 ++ .../ScheduledEventsListAcknowledgeError.cs | 48 + ...eduledEventsListAcknowledgeErrorDetails.cs | 70 ++ ...uledEventsListAcknowledgeErrorException.cs | 55 ++ .../Generated/Models/UpdateProperties.cs | 48 + .../Generated/Operations.cs | 184 +++- .../Generated/OperationsExtensions.cs | 43 +- ...blicMaintenanceConfigurationsOperations.cs | 203 +++- ...nanceConfigurationsOperationsExtensions.cs | 41 +- .../Generated/ScheduledEventsOperations.cs | 516 +++++++++++ .../ScheduledEventsOperationsExtensions.cs | 114 +++ .../Generated/UpdatesOperations.cs | 414 ++++++++- .../Generated/UpdatesOperationsExtensions.cs | 82 +- .../Maintenance.Management.Sdk/README.md | 4 +- 65 files changed, 5631 insertions(+), 1074 deletions(-) create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/IScheduledEventsOperations.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ActionType.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdateProperties.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdatesCreateOrUpdateHeaders.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdatesCreateOrUpdateParentHeaders.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ConfigurationAssignmentProperties.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/MaintenanceConfigurationProperties.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/MaintenanceWindow.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/OperationDisplay.cs delete mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/OperationInfo.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Origin.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ProxyResource.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsAcknowledgeErrorDetails.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsApproveResponse.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsIdList.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsListAcknowledgeError.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsListAcknowledgeErrorDetails.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsListAcknowledgeErrorException.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/Models/UpdateProperties.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/ScheduledEventsOperations.cs create mode 100644 src/Maintenance/Maintenance.Management.Sdk/Generated/ScheduledEventsOperationsExtensions.cs diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdateForResourceGroupOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdateForResourceGroupOperations.cs index c73130a5542e..b24ada8050d6 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdateForResourceGroupOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdateForResourceGroupOperations.cs @@ -42,7 +42,7 @@ internal ApplyUpdateForResourceGroupOperations (MaintenanceManagementClient clie /// Get Configuration records within a subscription and resource group /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// /// Headers that will be added to request. @@ -65,27 +65,33 @@ internal ApplyUpdateForResourceGroupOperations (MaintenanceManagementClient clie /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.ApiVersion == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -103,7 +109,7 @@ internal ApplyUpdateForResourceGroupOperations (MaintenanceManagementClient clie var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/applyUpdates").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -199,7 +205,184 @@ internal ApplyUpdateForResourceGroupOperations (MaintenanceManagementClient clie throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MaintenanceError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdateForResourceGroupOperationsExtensions.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdateForResourceGroupOperationsExtensions.cs index 8f3e209398f3..2694c9e51756 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdateForResourceGroupOperationsExtensions.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdateForResourceGroupOperationsExtensions.cs @@ -19,9 +19,9 @@ public static partial class ApplyUpdateForResourceGroupOperationsExtensions /// The operations group for this extension method. /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// - public static System.Collections.Generic.IEnumerable List(this IApplyUpdateForResourceGroupOperations operations, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage List(this IApplyUpdateForResourceGroupOperations operations, string resourceGroupName) { return ((IApplyUpdateForResourceGroupOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); } @@ -33,17 +33,50 @@ public static System.Collections.Generic.IEnumerable List(this IApp /// The operations group for this extension method. /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IApplyUpdateForResourceGroupOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IApplyUpdateForResourceGroupOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IApplyUpdateForResourceGroupOperations operations, string nextPageLink) + { + return ((IApplyUpdateForResourceGroupOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IApplyUpdateForResourceGroupOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdatesOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdatesOperations.cs index bd08dcdb5f23..48d5d5c1e262 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdatesOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdatesOperations.cs @@ -38,11 +38,195 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) /// public MaintenanceManagementClient Client { get; private set; } + /// + /// Get Configuration records within a subscription + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/applyUpdates").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MaintenanceError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } /// /// Track maintenance updates to resource with parent /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -51,16 +235,16 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// applyUpdate Id + /// The name of the ApplyUpdate /// /// /// Headers that will be added to request. @@ -89,16 +273,27 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (providerName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); @@ -129,11 +324,6 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applyUpdateName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -156,8 +346,8 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceParentType}", System.Uri.EscapeDataString(resourceParentType)); @@ -300,19 +490,19 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) /// Track maintenance updates to resource /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// applyUpdate Id + /// The name of the ApplyUpdate /// /// /// Headers that will be added to request. @@ -341,16 +531,27 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (providerName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); @@ -371,11 +572,6 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applyUpdateName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -396,8 +592,8 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); @@ -538,19 +734,19 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) /// Apply maintenance updates to resource /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// ApplyUpdate name + /// The name of the ApplyUpdate /// /// /// The ApplyUpdate @@ -587,16 +783,27 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applyUpdate"); } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (providerName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); @@ -617,11 +824,6 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applyUpdateName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -643,8 +845,8 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/{applyUpdateName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); @@ -809,7 +1011,7 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) /// Apply maintenance updates to resource with parent /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -847,22 +1049,33 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CreateOrUpdateParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (providerName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); @@ -888,11 +1101,6 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -915,7 +1123,7 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceParentType}", System.Uri.EscapeDataString(resourceParentType)); @@ -1016,7 +1224,7 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1060,6 +1268,19 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1075,7 +1296,7 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) /// Apply maintenance updates to resource /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -1107,22 +1328,33 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (providerName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); @@ -1138,11 +1370,6 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1163,7 +1390,7 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/applyUpdates/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); @@ -1262,7 +1489,7 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1306,6 +1533,19 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1320,6 +1560,9 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) /// /// Get Configuration records within a subscription /// + /// + /// The NextLink from the previous successful call to List operation. + /// /// /// Headers that will be added to request. /// @@ -1341,22 +1584,13 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - - - - if (this.Client.SubscriptionId == null) + if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } - - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1364,22 +1598,17 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL - - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/applyUpdates").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -1468,7 +1697,7 @@ internal ApplyUpdatesOperations (MaintenanceManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdatesOperationsExtensions.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdatesOperationsExtensions.cs index b3238e3e40fd..93142fb1e671 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdatesOperationsExtensions.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/ApplyUpdatesOperationsExtensions.cs @@ -12,6 +12,33 @@ namespace Microsoft.Azure.Management.Maintenance /// public static partial class ApplyUpdatesOperationsExtensions { + /// + /// Get Configuration records within a subscription + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IApplyUpdatesOperations operations) + { + return ((IApplyUpdatesOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Get Configuration records within a subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IApplyUpdatesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } /// /// Track maintenance updates to resource with parent /// @@ -19,7 +46,7 @@ public static partial class ApplyUpdatesOperationsExtensions /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -28,16 +55,16 @@ public static partial class ApplyUpdatesOperationsExtensions /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// applyUpdate Id + /// The name of the ApplyUpdate /// public static ApplyUpdate GetParent(this IApplyUpdatesOperations operations, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string applyUpdateName) { @@ -51,7 +78,7 @@ public static ApplyUpdate GetParent(this IApplyUpdatesOperations operations, str /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -60,16 +87,16 @@ public static ApplyUpdate GetParent(this IApplyUpdatesOperations operations, str /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// applyUpdate Id + /// The name of the ApplyUpdate /// /// /// The cancellation token. @@ -88,19 +115,19 @@ public static ApplyUpdate GetParent(this IApplyUpdatesOperations operations, str /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// applyUpdate Id + /// The name of the ApplyUpdate /// public static ApplyUpdate Get(this IApplyUpdatesOperations operations, string resourceGroupName, string providerName, string resourceType, string resourceName, string applyUpdateName) { @@ -114,19 +141,19 @@ public static ApplyUpdate Get(this IApplyUpdatesOperations operations, string re /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// applyUpdate Id + /// The name of the ApplyUpdate /// /// /// The cancellation token. @@ -145,19 +172,19 @@ public static ApplyUpdate Get(this IApplyUpdatesOperations operations, string re /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// ApplyUpdate name + /// The name of the ApplyUpdate /// public static ApplyUpdate CreateOrUpdateOrCancel(this IApplyUpdatesOperations operations, string resourceGroupName, string providerName, string resourceType, string resourceName, string applyUpdateName, ApplyUpdate applyUpdate) { @@ -171,19 +198,19 @@ public static ApplyUpdate CreateOrUpdateOrCancel(this IApplyUpdatesOperations op /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// ApplyUpdate name + /// The name of the ApplyUpdate /// /// /// The cancellation token. @@ -202,7 +229,7 @@ public static ApplyUpdate CreateOrUpdateOrCancel(this IApplyUpdatesOperations op /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -231,7 +258,7 @@ public static ApplyUpdate CreateOrUpdateParent(this IApplyUpdatesOperations oper /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -265,7 +292,7 @@ public static ApplyUpdate CreateOrUpdateParent(this IApplyUpdatesOperations oper /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -288,7 +315,7 @@ public static ApplyUpdate CreateOrUpdate(this IApplyUpdatesOperations operations /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -315,9 +342,12 @@ public static ApplyUpdate CreateOrUpdate(this IApplyUpdatesOperations operations /// /// The operations group for this extension method. /// - public static System.Collections.Generic.IEnumerable List(this IApplyUpdatesOperations operations) + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IApplyUpdatesOperations operations, string nextPageLink) { - return ((IApplyUpdatesOperations)operations).ListAsync().GetAwaiter().GetResult(); + return ((IApplyUpdatesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -326,12 +356,15 @@ public static System.Collections.Generic.IEnumerable List(this IApp /// /// The operations group for this extension method. /// + /// + /// The NextLink from the previous successful call to List operation. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IApplyUpdatesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListNextAsync(this IApplyUpdatesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForResourceGroupOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForResourceGroupOperations.cs index d876fbdfc390..6d0e7186d348 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForResourceGroupOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForResourceGroupOperations.cs @@ -42,10 +42,10 @@ internal ConfigurationAssignmentsForResourceGroupOperations (MaintenanceManageme /// Get configuration assignment for resource.. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// Headers that will be added to request. @@ -74,16 +74,27 @@ internal ConfigurationAssignmentsForResourceGroupOperations (MaintenanceManageme - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (configurationAssignmentName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); @@ -95,11 +106,6 @@ internal ConfigurationAssignmentsForResourceGroupOperations (MaintenanceManageme throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "configurationAssignmentName", "^.+$"); } } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -117,8 +123,8 @@ internal ConfigurationAssignmentsForResourceGroupOperations (MaintenanceManageme // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); @@ -256,10 +262,10 @@ internal ConfigurationAssignmentsForResourceGroupOperations (MaintenanceManageme /// Register configuration for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The configurationAssignment @@ -296,26 +302,38 @@ internal ConfigurationAssignmentsForResourceGroupOperations (MaintenanceManageme throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignment"); } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (configurationAssignmentName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); } - - if (this.Client.ApiVersion == null) + if (configurationAssignmentName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + if (!System.Text.RegularExpressions.Regex.IsMatch(configurationAssignmentName, "^.+$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "configurationAssignmentName", "^.+$"); + } } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -334,8 +352,8 @@ internal ConfigurationAssignmentsForResourceGroupOperations (MaintenanceManageme // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); @@ -497,10 +515,10 @@ internal ConfigurationAssignmentsForResourceGroupOperations (MaintenanceManageme /// Register configuration for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The configurationAssignment @@ -536,26 +554,38 @@ internal ConfigurationAssignmentsForResourceGroupOperations (MaintenanceManageme { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignment"); } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (configurationAssignmentName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); } - - if (this.Client.ApiVersion == null) + if (configurationAssignmentName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + if (!System.Text.RegularExpressions.Regex.IsMatch(configurationAssignmentName, "^.+$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "configurationAssignmentName", "^.+$"); + } } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -574,8 +604,8 @@ internal ConfigurationAssignmentsForResourceGroupOperations (MaintenanceManageme // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); @@ -719,10 +749,10 @@ internal ConfigurationAssignmentsForResourceGroupOperations (MaintenanceManageme /// Unregister configuration for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// Headers that will be added to request. @@ -751,26 +781,38 @@ internal ConfigurationAssignmentsForResourceGroupOperations (MaintenanceManageme - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (configurationAssignmentName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); } - - if (this.Client.ApiVersion == null) + if (configurationAssignmentName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + if (!System.Text.RegularExpressions.Regex.IsMatch(configurationAssignmentName, "^.+$")) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "configurationAssignmentName", "^.+$"); + } } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -788,8 +830,8 @@ internal ConfigurationAssignmentsForResourceGroupOperations (MaintenanceManageme // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForResourceGroupOperationsExtensions.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForResourceGroupOperationsExtensions.cs index af825998f9e3..974ae7fd6bbf 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForResourceGroupOperationsExtensions.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForResourceGroupOperationsExtensions.cs @@ -19,10 +19,10 @@ public static partial class ConfigurationAssignmentsForResourceGroupOperationsEx /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// public static ConfigurationAssignment Get(this IConfigurationAssignmentsForResourceGroupOperations operations, string resourceGroupName, string configurationAssignmentName) { @@ -36,10 +36,10 @@ public static ConfigurationAssignment Get(this IConfigurationAssignmentsForResou /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The cancellation token. @@ -58,10 +58,10 @@ public static ConfigurationAssignment Get(this IConfigurationAssignmentsForResou /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// public static ConfigurationAssignment CreateOrUpdate(this IConfigurationAssignmentsForResourceGroupOperations operations, string resourceGroupName, string configurationAssignmentName, ConfigurationAssignment configurationAssignment) { @@ -75,10 +75,10 @@ public static ConfigurationAssignment CreateOrUpdate(this IConfigurationAssignme /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The cancellation token. @@ -97,10 +97,10 @@ public static ConfigurationAssignment CreateOrUpdate(this IConfigurationAssignme /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// public static ConfigurationAssignment Update(this IConfigurationAssignmentsForResourceGroupOperations operations, string resourceGroupName, string configurationAssignmentName, ConfigurationAssignment configurationAssignment) { @@ -114,10 +114,10 @@ public static ConfigurationAssignment Update(this IConfigurationAssignmentsForRe /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The cancellation token. @@ -136,10 +136,10 @@ public static ConfigurationAssignment Update(this IConfigurationAssignmentsForRe /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment /// public static ConfigurationAssignment Delete(this IConfigurationAssignmentsForResourceGroupOperations operations, string resourceGroupName, string configurationAssignmentName) { @@ -153,10 +153,10 @@ public static ConfigurationAssignment Delete(this IConfigurationAssignmentsForRe /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The cancellation token. diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForSubscriptionsOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForSubscriptionsOperations.cs index a7a27be78b86..4dcede551b4d 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForSubscriptionsOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForSubscriptionsOperations.cs @@ -39,10 +39,10 @@ internal ConfigurationAssignmentsForSubscriptionsOperations (MaintenanceManageme public MaintenanceManagementClient Client { get; private set; } /// - /// Get configuration assignment for resource.. + /// Get configuration assignment for resource. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// Headers that will be added to request. @@ -71,21 +71,17 @@ internal ConfigurationAssignmentsForSubscriptionsOperations (MaintenanceManageme - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (configurationAssignmentName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -103,7 +99,7 @@ internal ConfigurationAssignmentsForSubscriptionsOperations (MaintenanceManageme var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -240,7 +236,7 @@ internal ConfigurationAssignmentsForSubscriptionsOperations (MaintenanceManageme /// Register configuration for resource. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The configurationAssignment @@ -277,21 +273,17 @@ internal ConfigurationAssignmentsForSubscriptionsOperations (MaintenanceManageme throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignment"); } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (configurationAssignmentName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -310,7 +302,7 @@ internal ConfigurationAssignmentsForSubscriptionsOperations (MaintenanceManageme var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -471,7 +463,7 @@ internal ConfigurationAssignmentsForSubscriptionsOperations (MaintenanceManageme /// Register configuration for resource. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The configurationAssignment @@ -507,21 +499,17 @@ internal ConfigurationAssignmentsForSubscriptionsOperations (MaintenanceManageme { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignment"); } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (configurationAssignmentName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -540,7 +528,7 @@ internal ConfigurationAssignmentsForSubscriptionsOperations (MaintenanceManageme var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -683,7 +671,7 @@ internal ConfigurationAssignmentsForSubscriptionsOperations (MaintenanceManageme /// Unregister configuration for resource. /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// Headers that will be added to request. @@ -712,21 +700,17 @@ internal ConfigurationAssignmentsForSubscriptionsOperations (MaintenanceManageme - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (configurationAssignmentName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -744,7 +728,7 @@ internal ConfigurationAssignmentsForSubscriptionsOperations (MaintenanceManageme var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForSubscriptionsOperationsExtensions.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForSubscriptionsOperationsExtensions.cs index 0bd0ddd3e3db..b566339f732f 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForSubscriptionsOperationsExtensions.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsForSubscriptionsOperationsExtensions.cs @@ -13,13 +13,13 @@ namespace Microsoft.Azure.Management.Maintenance public static partial class ConfigurationAssignmentsForSubscriptionsOperationsExtensions { /// - /// Get configuration assignment for resource.. + /// Get configuration assignment for resource. /// /// /// The operations group for this extension method. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// public static ConfigurationAssignment Get(this IConfigurationAssignmentsForSubscriptionsOperations operations, string configurationAssignmentName) { @@ -27,13 +27,13 @@ public static ConfigurationAssignment Get(this IConfigurationAssignmentsForSubsc } /// - /// Get configuration assignment for resource.. + /// Get configuration assignment for resource. /// /// /// The operations group for this extension method. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The cancellation token. @@ -52,7 +52,7 @@ public static ConfigurationAssignment Get(this IConfigurationAssignmentsForSubsc /// The operations group for this extension method. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// public static ConfigurationAssignment CreateOrUpdate(this IConfigurationAssignmentsForSubscriptionsOperations operations, string configurationAssignmentName, ConfigurationAssignment configurationAssignment) { @@ -66,7 +66,7 @@ public static ConfigurationAssignment CreateOrUpdate(this IConfigurationAssignme /// The operations group for this extension method. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The cancellation token. @@ -85,7 +85,7 @@ public static ConfigurationAssignment CreateOrUpdate(this IConfigurationAssignme /// The operations group for this extension method. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// public static ConfigurationAssignment Update(this IConfigurationAssignmentsForSubscriptionsOperations operations, string configurationAssignmentName, ConfigurationAssignment configurationAssignment) { @@ -99,7 +99,7 @@ public static ConfigurationAssignment Update(this IConfigurationAssignmentsForSu /// The operations group for this extension method. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The cancellation token. @@ -118,7 +118,7 @@ public static ConfigurationAssignment Update(this IConfigurationAssignmentsForSu /// The operations group for this extension method. /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment /// public static ConfigurationAssignment Delete(this IConfigurationAssignmentsForSubscriptionsOperations operations, string configurationAssignmentName) { @@ -132,7 +132,7 @@ public static ConfigurationAssignment Delete(this IConfigurationAssignmentsForSu /// The operations group for this extension method. /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The cancellation token. diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsOperations.cs index de7fa7a2b5e5..eb498cf1849a 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsOperations.cs @@ -39,10 +39,10 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) public MaintenanceManagementClient Client { get; private set; } /// - /// Get configuration assignment for resource.. + /// List configurationAssignments for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -51,16 +51,13 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier - /// - /// - /// Configuration assignment name + /// Resource name /// /// /// Headers that will be added to request. @@ -83,22 +80,33 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (providerName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); @@ -124,16 +132,6 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } - if (configurationAssignmentName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); - } - - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -147,24 +145,22 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) tracingParameters.Add("resourceParentName", resourceParentName); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); - tracingParameters.Add("configurationAssignmentName", configurationAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetParent", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListParent", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceParentType}", System.Uri.EscapeDataString(resourceParentType)); _url = _url.Replace("{resourceParentName}", System.Uri.EscapeDataString(resourceParentName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); - _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) @@ -259,7 +255,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -273,7 +269,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -297,10 +293,10 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) } /// - /// Register configuration for resource. + /// Get configuration assignment for resource.. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -309,19 +305,16 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// Configuration assignment name - /// - /// - /// The configurationAssignment + /// The name of the ConfigurationAssignment /// /// /// Headers that will be added to request. @@ -344,27 +337,33 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CreateOrUpdateParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, ConfigurationAssignment configurationAssignment, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (configurationAssignment == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignment"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (providerName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); @@ -395,11 +394,6 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -415,16 +409,15 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("configurationAssignmentName", configurationAssignmentName); - tracingParameters.Add("configurationAssignment", configurationAssignment); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateParent", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetParent", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceParentType}", System.Uri.EscapeDataString(resourceParentType)); @@ -445,7 +438,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -474,12 +467,6 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) } // Serialize Request string _requestContent = null; - if(configurationAssignment != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(configurationAssignment, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -502,7 +489,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -558,24 +545,6 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -588,10 +557,10 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) } /// - /// Unregister configuration for resource. + /// Register configuration for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -600,16 +569,19 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment + /// + /// + /// The configurationAssignment /// /// /// Headers that will be added to request. @@ -632,22 +604,38 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DeleteParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, ConfigurationAssignment configurationAssignment, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (configurationAssignment == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignment"); + } + + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (providerName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); @@ -678,11 +666,6 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -698,15 +681,16 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("configurationAssignmentName", configurationAssignmentName); + tracingParameters.Add("configurationAssignment", configurationAssignment); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "DeleteParent", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdateParent", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceParentType}", System.Uri.EscapeDataString(resourceParentType)); @@ -727,7 +711,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -756,6 +740,12 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) } // Serialize Request string _requestContent = null; + if(configurationAssignment != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(configurationAssignment, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -778,7 +768,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -834,6 +824,24 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -846,22 +854,28 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) } /// - /// Get configuration assignment for resource.. + /// Unregister configuration for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// + /// + /// Resource parent type + /// + /// + /// Resource parent name + /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// Headers that will be added to request. @@ -884,27 +898,48 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (providerName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); } + if (resourceParentType == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceParentType"); + } + + if (resourceParentName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceParentName"); + } + if (resourceType == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceType"); @@ -920,11 +955,6 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -934,21 +964,25 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("providerName", providerName); + tracingParameters.Add("resourceParentType", resourceParentType); + tracingParameters.Add("resourceParentName", resourceParentName); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("configurationAssignmentName", configurationAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "DeleteParent", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); + _url = _url.Replace("{resourceParentType}", System.Uri.EscapeDataString(resourceParentType)); + _url = _url.Replace("{resourceParentName}", System.Uri.EscapeDataString(resourceParentName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); @@ -965,7 +999,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1016,7 +1050,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1084,25 +1118,22 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) } /// - /// Register configuration for resource. + /// Get configuration assignment for resource.. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// Configuration assignment name - /// - /// - /// The configurationAssignment + /// The name of the ConfigurationAssignment /// /// /// Headers that will be added to request. @@ -1125,27 +1156,33 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName, ConfigurationAssignment configurationAssignment, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (configurationAssignment == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignment"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (providerName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); @@ -1166,11 +1203,6 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1184,16 +1216,15 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("configurationAssignmentName", configurationAssignmentName); - tracingParameters.Add("configurationAssignment", configurationAssignment); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); @@ -1212,7 +1243,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1241,12 +1272,6 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) } // Serialize Request string _requestContent = null; - if(configurationAssignment != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(configurationAssignment, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -1269,7 +1294,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1325,24 +1350,6 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1355,22 +1362,25 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) } /// - /// Unregister configuration for resource. + /// Register configuration for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment + /// + /// + /// The configurationAssignment /// /// /// Headers that will be added to request. @@ -1393,22 +1403,38 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName, ConfigurationAssignment configurationAssignment, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (configurationAssignment == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignment"); } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (providerName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); @@ -1429,11 +1455,6 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1447,15 +1468,16 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("configurationAssignmentName", configurationAssignmentName); + tracingParameters.Add("configurationAssignment", configurationAssignment); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); @@ -1474,7 +1496,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1503,6 +1525,12 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) } // Serialize Request string _requestContent = null; + if(configurationAssignment != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(configurationAssignment, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -1525,7 +1553,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1581,6 +1609,24 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1593,25 +1639,22 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) } /// - /// List configurationAssignments for resource. + /// Unregister configuration for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// - /// - /// Resource parent type - /// - /// - /// Resource parent identifier - /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name + /// + /// + /// The name of the ConfigurationAssignment /// /// /// Headers that will be added to request. @@ -1634,35 +1677,36 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (providerName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); - } - - if (resourceParentType == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceParentType"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } } - - if (resourceParentName == null) + if (providerName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceParentName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); } if (resourceType == null) @@ -1675,9 +1719,9 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } - if (this.Client.ApiVersion == null) + if (configurationAssignmentName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configurationAssignmentName"); } // Tracing @@ -1689,26 +1733,24 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("providerName", providerName); - tracingParameters.Add("resourceParentType", resourceParentType); - tracingParameters.Add("resourceParentName", resourceParentName); tracingParameters.Add("resourceType", resourceType); tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("configurationAssignmentName", configurationAssignmentName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListParent", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); - _url = _url.Replace("{resourceParentType}", System.Uri.EscapeDataString(resourceParentType)); - _url = _url.Replace("{resourceParentName}", System.Uri.EscapeDataString(resourceParentName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{configurationAssignmentName}", System.Uri.EscapeDataString(configurationAssignmentName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) @@ -1722,7 +1764,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -1773,7 +1815,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1803,7 +1845,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1817,7 +1859,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1841,10 +1883,10 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) } /// - /// List configurationAssignments for resource. + /// Get Configuration records within a subscription and resource group /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -1876,22 +1918,33 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (providerName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); @@ -1907,11 +1960,6 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1932,7 +1980,7 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); @@ -2031,7 +2079,361 @@ internal ConfigurationAssignmentsOperations (MaintenanceManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// List configurationAssignments for resource. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListParentNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListParentNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MaintenanceError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MaintenanceError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsOperationsExtensions.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsOperationsExtensions.cs index eba3dfb65553..531d8eb2142a 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsOperationsExtensions.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsOperationsExtensions.cs @@ -12,6 +12,69 @@ namespace Microsoft.Azure.Management.Maintenance /// public static partial class ConfigurationAssignmentsOperationsExtensions { + /// + /// List configurationAssignments for resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Resource provider name + /// + /// + /// Resource parent type + /// + /// + /// Resource parent name + /// + /// + /// Resource type + /// + /// + /// Resource name + /// + public static Microsoft.Rest.Azure.IPage ListParent(this IConfigurationAssignmentsOperations operations, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName) + { + return ((IConfigurationAssignmentsOperations)operations).ListParentAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName).GetAwaiter().GetResult(); + } + + /// + /// List configurationAssignments for resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Resource provider name + /// + /// + /// Resource parent type + /// + /// + /// Resource parent name + /// + /// + /// Resource type + /// + /// + /// Resource name + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListParentAsync(this IConfigurationAssignmentsOperations operations, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListParentWithHttpMessagesAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } /// /// Get configuration assignment for resource.. /// @@ -19,7 +82,7 @@ public static partial class ConfigurationAssignmentsOperationsExtensions /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -28,16 +91,16 @@ public static partial class ConfigurationAssignmentsOperationsExtensions /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// public static ConfigurationAssignment GetParent(this IConfigurationAssignmentsOperations operations, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName) { @@ -51,7 +114,7 @@ public static ConfigurationAssignment GetParent(this IConfigurationAssignmentsOp /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -60,16 +123,16 @@ public static ConfigurationAssignment GetParent(this IConfigurationAssignmentsOp /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The cancellation token. @@ -88,7 +151,7 @@ public static ConfigurationAssignment GetParent(this IConfigurationAssignmentsOp /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -97,16 +160,16 @@ public static ConfigurationAssignment GetParent(this IConfigurationAssignmentsOp /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// public static ConfigurationAssignment CreateOrUpdateParent(this IConfigurationAssignmentsOperations operations, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName, ConfigurationAssignment configurationAssignment) { @@ -120,7 +183,7 @@ public static ConfigurationAssignment CreateOrUpdateParent(this IConfigurationAs /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -129,16 +192,16 @@ public static ConfigurationAssignment CreateOrUpdateParent(this IConfigurationAs /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The cancellation token. @@ -157,7 +220,7 @@ public static ConfigurationAssignment CreateOrUpdateParent(this IConfigurationAs /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -166,16 +229,16 @@ public static ConfigurationAssignment CreateOrUpdateParent(this IConfigurationAs /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment /// public static ConfigurationAssignment DeleteParent(this IConfigurationAssignmentsOperations operations, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, string configurationAssignmentName) { @@ -189,7 +252,7 @@ public static ConfigurationAssignment DeleteParent(this IConfigurationAssignment /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -198,16 +261,16 @@ public static ConfigurationAssignment DeleteParent(this IConfigurationAssignment /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The cancellation token. @@ -226,19 +289,19 @@ public static ConfigurationAssignment DeleteParent(this IConfigurationAssignment /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// public static ConfigurationAssignment Get(this IConfigurationAssignmentsOperations operations, string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName) { @@ -252,19 +315,19 @@ public static ConfigurationAssignment Get(this IConfigurationAssignmentsOperatio /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The cancellation token. @@ -283,19 +346,19 @@ public static ConfigurationAssignment Get(this IConfigurationAssignmentsOperatio /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// public static ConfigurationAssignment CreateOrUpdate(this IConfigurationAssignmentsOperations operations, string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName, ConfigurationAssignment configurationAssignment) { @@ -309,19 +372,19 @@ public static ConfigurationAssignment CreateOrUpdate(this IConfigurationAssignme /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The cancellation token. @@ -340,19 +403,19 @@ public static ConfigurationAssignment CreateOrUpdate(this IConfigurationAssignme /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment /// public static ConfigurationAssignment Delete(this IConfigurationAssignmentsOperations operations, string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName) { @@ -366,19 +429,19 @@ public static ConfigurationAssignment Delete(this IConfigurationAssignmentsOpera /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The cancellation token. @@ -391,52 +454,40 @@ public static ConfigurationAssignment Delete(this IConfigurationAssignmentsOpera } } /// - /// List configurationAssignments for resource. + /// Get Configuration records within a subscription and resource group /// /// /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// - /// - /// Resource parent type - /// - /// - /// Resource parent identifier - /// /// /// Resource type /// /// /// Resource identifier /// - public static System.Collections.Generic.IEnumerable ListParent(this IConfigurationAssignmentsOperations operations, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName) + public static Microsoft.Rest.Azure.IPage List(this IConfigurationAssignmentsOperations operations, string resourceGroupName, string providerName, string resourceType, string resourceName) { - return ((IConfigurationAssignmentsOperations)operations).ListParentAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName).GetAwaiter().GetResult(); + return ((IConfigurationAssignmentsOperations)operations).ListAsync(resourceGroupName, providerName, resourceType, resourceName).GetAwaiter().GetResult(); } /// - /// List configurationAssignments for resource. + /// Get Configuration records within a subscription and resource group /// /// /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// - /// - /// Resource parent type - /// - /// - /// Resource parent identifier - /// /// /// Resource type /// @@ -446,9 +497,9 @@ public static System.Collections.Generic.IEnumerable Li /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListParentAsync(this IConfigurationAssignmentsOperations operations, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IConfigurationAssignmentsOperations operations, string resourceGroupName, string providerName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListParentWithHttpMessagesAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, providerName, resourceType, resourceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -459,21 +510,12 @@ public static System.Collections.Generic.IEnumerable Li /// /// The operations group for this extension method. /// - /// - /// Resource group name - /// - /// - /// Resource provider name + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Resource type - /// - /// - /// Resource identifier - /// - public static System.Collections.Generic.IEnumerable List(this IConfigurationAssignmentsOperations operations, string resourceGroupName, string providerName, string resourceType, string resourceName) + public static Microsoft.Rest.Azure.IPage ListParentNext(this IConfigurationAssignmentsOperations operations, string nextPageLink) { - return ((IConfigurationAssignmentsOperations)operations).ListAsync(resourceGroupName, providerName, resourceType, resourceName).GetAwaiter().GetResult(); + return ((IConfigurationAssignmentsOperations)operations).ListParentNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -482,24 +524,48 @@ public static System.Collections.Generic.IEnumerable Li /// /// The operations group for this extension method. /// - /// - /// Resource group name + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Resource provider name + /// + /// The cancellation token. /// - /// - /// Resource type + public static async System.Threading.Tasks.Task> ListParentNextAsync(this IConfigurationAssignmentsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListParentNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// The operations group for this extension method. /// - /// - /// Resource identifier + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IConfigurationAssignmentsOperations operations, string nextPageLink) + { + return ((IConfigurationAssignmentsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IConfigurationAssignmentsOperations operations, string resourceGroupName, string providerName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListNextAsync(this IConfigurationAssignmentsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, providerName, resourceType, resourceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsWithinSubscriptionOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsWithinSubscriptionOperations.cs index 601edb50e8dd..e0319509dda9 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsWithinSubscriptionOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsWithinSubscriptionOperations.cs @@ -39,7 +39,8 @@ internal ConfigurationAssignmentsWithinSubscriptionOperations (MaintenanceManage public MaintenanceManagementClient Client { get; private set; } /// - /// Get configuration assignment within a subscription + /// [UNSUPPORTED] Get configuration assignment within a subscription. This API + /// is not implemented yet. /// /// /// Headers that will be added to request. @@ -62,22 +63,18 @@ internal ConfigurationAssignmentsWithinSubscriptionOperations (MaintenanceManage /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -94,7 +91,7 @@ internal ConfigurationAssignmentsWithinSubscriptionOperations (MaintenanceManage var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) @@ -189,7 +186,185 @@ internal ConfigurationAssignmentsWithinSubscriptionOperations (MaintenanceManage throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// [UNSUPPORTED] Get configuration assignment within a subscription. This API + /// is not implemented yet. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MaintenanceError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsWithinSubscriptionOperationsExtensions.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsWithinSubscriptionOperationsExtensions.cs index 1b9c348ad39d..ae51b0c0638b 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsWithinSubscriptionOperationsExtensions.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/ConfigurationAssignmentsWithinSubscriptionOperationsExtensions.cs @@ -13,18 +13,20 @@ namespace Microsoft.Azure.Management.Maintenance public static partial class ConfigurationAssignmentsWithinSubscriptionOperationsExtensions { /// - /// Get configuration assignment within a subscription + /// [UNSUPPORTED] Get configuration assignment within a subscription. This API + /// is not implemented yet. /// /// /// The operations group for this extension method. /// - public static System.Collections.Generic.IEnumerable List(this IConfigurationAssignmentsWithinSubscriptionOperations operations) + public static Microsoft.Rest.Azure.IPage List(this IConfigurationAssignmentsWithinSubscriptionOperations operations) { return ((IConfigurationAssignmentsWithinSubscriptionOperations)operations).ListAsync().GetAwaiter().GetResult(); } /// - /// Get configuration assignment within a subscription + /// [UNSUPPORTED] Get configuration assignment within a subscription. This API + /// is not implemented yet. /// /// /// The operations group for this extension method. @@ -32,12 +34,47 @@ public static System.Collections.Generic.IEnumerable Li /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IConfigurationAssignmentsWithinSubscriptionOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IConfigurationAssignmentsWithinSubscriptionOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// [UNSUPPORTED] Get configuration assignment within a subscription. This API + /// is not implemented yet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IConfigurationAssignmentsWithinSubscriptionOperations operations, string nextPageLink) + { + return ((IConfigurationAssignmentsWithinSubscriptionOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// [UNSUPPORTED] Get configuration assignment within a subscription. This API + /// is not implemented yet. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IConfigurationAssignmentsWithinSubscriptionOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/IApplyUpdateForResourceGroupOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/IApplyUpdateForResourceGroupOperations.cs index 2bb4e5e601c0..504dfa4baa86 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/IApplyUpdateForResourceGroupOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/IApplyUpdateForResourceGroupOperations.cs @@ -20,7 +20,7 @@ public partial interface IApplyUpdateForResourceGroupOperations /// Get Configuration records within a subscription and resource group /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// /// The headers that will be added to request. @@ -34,7 +34,30 @@ public partial interface IApplyUpdateForResourceGroupOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/IApplyUpdatesOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/IApplyUpdatesOperations.cs index 75ddd943b6fe..d85f696eb04d 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/IApplyUpdatesOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/IApplyUpdatesOperations.cs @@ -13,6 +13,26 @@ namespace Microsoft.Azure.Management.Maintenance /// public partial interface IApplyUpdatesOperations { + /// + /// Get Configuration records within a subscription + /// + /// + /// Get Configuration records within a subscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Track maintenance updates to resource with parent /// @@ -20,7 +40,7 @@ public partial interface IApplyUpdatesOperations /// Track maintenance updates to resource with parent /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -29,16 +49,16 @@ public partial interface IApplyUpdatesOperations /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// applyUpdate Id + /// The name of the ApplyUpdate /// /// /// The headers that will be added to request. @@ -61,19 +81,19 @@ public partial interface IApplyUpdatesOperations /// Track maintenance updates to resource /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// applyUpdate Id + /// The name of the ApplyUpdate /// /// /// The headers that will be added to request. @@ -96,19 +116,19 @@ public partial interface IApplyUpdatesOperations /// Apply maintenance updates to resource /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// ApplyUpdate name + /// The name of the ApplyUpdate /// /// /// The ApplyUpdate @@ -134,7 +154,7 @@ public partial interface IApplyUpdatesOperations /// Apply maintenance updates to resource with parent /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -163,7 +183,7 @@ public partial interface IApplyUpdatesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateOrUpdateParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Apply maintenance updates to resource @@ -172,7 +192,7 @@ public partial interface IApplyUpdatesOperations /// Apply maintenance updates to resource /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -195,7 +215,7 @@ public partial interface IApplyUpdatesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get Configuration records within a subscription @@ -203,6 +223,9 @@ public partial interface IApplyUpdatesOperations /// /// Get Configuration records within a subscription /// + /// + /// The NextLink from the previous successful call to List operation. + /// /// /// The headers that will be added to request. /// @@ -215,7 +238,7 @@ public partial interface IApplyUpdatesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsForResourceGroupOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsForResourceGroupOperations.cs index 82b8f8ed28ac..32ed3f3136a7 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsForResourceGroupOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsForResourceGroupOperations.cs @@ -20,10 +20,10 @@ public partial interface IConfigurationAssignmentsForResourceGroupOperations /// Get configuration assignment for resource.. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The headers that will be added to request. @@ -46,10 +46,10 @@ public partial interface IConfigurationAssignmentsForResourceGroupOperations /// Register configuration for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The configurationAssignment @@ -75,10 +75,10 @@ public partial interface IConfigurationAssignmentsForResourceGroupOperations /// Register configuration for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The configurationAssignment @@ -104,10 +104,10 @@ public partial interface IConfigurationAssignmentsForResourceGroupOperations /// Unregister configuration for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The headers that will be added to request. diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsForSubscriptionsOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsForSubscriptionsOperations.cs index d05661595036..78348bee762a 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsForSubscriptionsOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsForSubscriptionsOperations.cs @@ -14,13 +14,13 @@ namespace Microsoft.Azure.Management.Maintenance public partial interface IConfigurationAssignmentsForSubscriptionsOperations { /// - /// Get configuration assignment for resource.. + /// Get configuration assignment for resource. /// /// - /// Get configuration assignment for resource.. + /// Get configuration assignment for resource. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The headers that will be added to request. @@ -43,7 +43,7 @@ public partial interface IConfigurationAssignmentsForSubscriptionsOperations /// Register configuration for resource. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The configurationAssignment @@ -69,7 +69,7 @@ public partial interface IConfigurationAssignmentsForSubscriptionsOperations /// Register configuration for resource. /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The configurationAssignment @@ -95,7 +95,7 @@ public partial interface IConfigurationAssignmentsForSubscriptionsOperations /// Unregister configuration for resource. /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The headers that will be added to request. diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsOperations.cs index d30f39f99c68..b2637c2d662c 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsOperations.cs @@ -13,6 +13,44 @@ namespace Microsoft.Azure.Management.Maintenance /// public partial interface IConfigurationAssignmentsOperations { + /// + /// List configurationAssignments for resource. + /// + /// + /// List configurationAssignments for resource. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Resource provider name + /// + /// + /// Resource parent type + /// + /// + /// Resource parent name + /// + /// + /// Resource type + /// + /// + /// Resource name + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get configuration assignment for resource.. /// @@ -20,7 +58,7 @@ public partial interface IConfigurationAssignmentsOperations /// Get configuration assignment for resource.. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -29,16 +67,16 @@ public partial interface IConfigurationAssignmentsOperations /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The headers that will be added to request. @@ -61,7 +99,7 @@ public partial interface IConfigurationAssignmentsOperations /// Register configuration for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -70,16 +108,16 @@ public partial interface IConfigurationAssignmentsOperations /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The configurationAssignment @@ -105,7 +143,7 @@ public partial interface IConfigurationAssignmentsOperations /// Unregister configuration for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -114,16 +152,16 @@ public partial interface IConfigurationAssignmentsOperations /// Resource parent type /// /// - /// Resource parent identifier + /// Resource parent name /// /// /// Resource type /// /// - /// Resource identifier + /// Resource name /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The headers that will be added to request. @@ -146,19 +184,19 @@ public partial interface IConfigurationAssignmentsOperations /// Get configuration assignment for resource.. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The headers that will be added to request. @@ -181,19 +219,19 @@ public partial interface IConfigurationAssignmentsOperations /// Register configuration for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// Configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The configurationAssignment @@ -219,19 +257,19 @@ public partial interface IConfigurationAssignmentsOperations /// Unregister configuration for resource. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// /// - /// Resource type + /// Resource parent type /// /// - /// Resource identifier + /// Resource parent name /// /// - /// Unique configuration assignment name + /// The name of the ConfigurationAssignment /// /// /// The headers that will be added to request. @@ -248,23 +286,17 @@ public partial interface IConfigurationAssignmentsOperations System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, string configurationAssignmentName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// List configurationAssignments for resource. + /// Get Configuration records within a subscription and resource group /// /// - /// List configurationAssignments for resource. + /// Get Configuration records within a subscription and resource group /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name /// - /// - /// Resource parent type - /// - /// - /// Resource parent identifier - /// /// /// Resource type /// @@ -283,7 +315,7 @@ public partial interface IConfigurationAssignmentsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// List configurationAssignments for resource. @@ -291,17 +323,31 @@ public partial interface IConfigurationAssignmentsOperations /// /// List configurationAssignments for resource. /// - /// - /// Resource group name + /// + /// The NextLink from the previous successful call to List operation. /// - /// - /// Resource provider name + /// + /// The headers that will be added to request. /// - /// - /// Resource type + /// + /// The cancellation token. /// - /// - /// Resource identifier + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListParentNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -315,7 +361,7 @@ public partial interface IConfigurationAssignmentsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsWithinSubscriptionOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsWithinSubscriptionOperations.cs index 58c9594804ee..e1054850fc80 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsWithinSubscriptionOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/IConfigurationAssignmentsWithinSubscriptionOperations.cs @@ -14,10 +14,12 @@ namespace Microsoft.Azure.Management.Maintenance public partial interface IConfigurationAssignmentsWithinSubscriptionOperations { /// - /// Get configuration assignment within a subscription + /// [UNSUPPORTED] Get configuration assignment within a subscription. This API + /// is not implemented yet. /// /// - /// Get configuration assignment within a subscription + /// [UNSUPPORTED] Get configuration assignment within a subscription. This API + /// is not implemented yet. /// /// /// The headers that will be added to request. @@ -31,7 +33,32 @@ public partial interface IConfigurationAssignmentsWithinSubscriptionOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// [UNSUPPORTED] Get configuration assignment within a subscription. This API + /// is not implemented yet. + /// + /// + /// [UNSUPPORTED] Get configuration assignment within a subscription. This API + /// is not implemented yet. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/IMaintenanceConfigurationsForResourceGroupOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/IMaintenanceConfigurationsForResourceGroupOperations.cs index 5eac4a8a891b..c1a7128a4e71 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/IMaintenanceConfigurationsForResourceGroupOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/IMaintenanceConfigurationsForResourceGroupOperations.cs @@ -20,7 +20,7 @@ public partial interface IMaintenanceConfigurationsForResourceGroupOperations /// Get Configuration records within a subscription and resource group /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// /// The headers that will be added to request. @@ -34,7 +34,30 @@ public partial interface IMaintenanceConfigurationsForResourceGroupOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/IMaintenanceConfigurationsOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/IMaintenanceConfigurationsOperations.cs index 5f49a096cfc3..6fbeec3c654f 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/IMaintenanceConfigurationsOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/IMaintenanceConfigurationsOperations.cs @@ -13,6 +13,26 @@ namespace Microsoft.Azure.Management.Maintenance /// public partial interface IMaintenanceConfigurationsOperations { + /// + /// Get Configuration records within a subscription + /// + /// + /// Get Configuration records within a subscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get Configuration record /// @@ -20,10 +40,10 @@ public partial interface IMaintenanceConfigurationsOperations /// Get Configuration record /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// /// /// The headers that will be added to request. @@ -46,10 +66,10 @@ public partial interface IMaintenanceConfigurationsOperations /// Create or Update configuration record /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// /// /// The configuration @@ -69,16 +89,19 @@ public partial interface IMaintenanceConfigurationsOperations System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, MaintenanceConfiguration configuration, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Delete Configuration record + /// Patch configuration record /// /// - /// Delete Configuration record + /// Patch configuration record /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration + /// + /// + /// The configuration /// /// /// The headers that will be added to request. @@ -92,22 +115,19 @@ public partial interface IMaintenanceConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, MaintenanceConfiguration configuration, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Patch configuration record + /// Delete Configuration record /// /// - /// Patch configuration record + /// Delete Configuration record /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name - /// - /// - /// The configuration + /// The name of the MaintenanceConfiguration /// /// /// The headers that will be added to request. @@ -121,7 +141,7 @@ public partial interface IMaintenanceConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, MaintenanceConfiguration configuration, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get Configuration records within a subscription @@ -129,6 +149,9 @@ public partial interface IMaintenanceConfigurationsOperations /// /// Get Configuration records within a subscription /// + /// + /// The NextLink from the previous successful call to List operation. + /// /// /// The headers that will be added to request. /// @@ -141,7 +164,7 @@ public partial interface IMaintenanceConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/IMaintenanceManagementClient.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/IMaintenanceManagementClient.cs index 8305b2e8ab60..efc3000290ff 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/IMaintenanceManagementClient.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/IMaintenanceManagementClient.cs @@ -42,11 +42,9 @@ public partial interface IMaintenanceManagementClient : System.IDisposable /// - /// Subscription credentials that uniquely identify a Microsoft Azure - /// subscription. The subscription ID forms part of the URI for every service - /// call. + /// The ID of the target subscription. The value must be an UUID. /// - string SubscriptionId { get; set;} + System.Guid SubscriptionId { get; set;} /// @@ -71,9 +69,9 @@ public partial interface IMaintenanceManagementClient : System.IDisposable /// - /// Gets the IPublicMaintenanceConfigurationsOperations + /// Gets the IOperations /// - IPublicMaintenanceConfigurationsOperations PublicMaintenanceConfigurations { get; } + IOperations Operations { get; } /// /// Gets the IApplyUpdatesOperations @@ -81,34 +79,34 @@ public partial interface IMaintenanceManagementClient : System.IDisposable IApplyUpdatesOperations ApplyUpdates { get; } /// - /// Gets the IConfigurationAssignmentsOperations + /// Gets the IConfigurationAssignmentsWithinSubscriptionOperations /// - IConfigurationAssignmentsOperations ConfigurationAssignments { get; } + IConfigurationAssignmentsWithinSubscriptionOperations ConfigurationAssignmentsWithinSubscription { get; } /// - /// Gets the IMaintenanceConfigurationsOperations + /// Gets the IConfigurationAssignmentsForSubscriptionsOperations /// - IMaintenanceConfigurationsOperations MaintenanceConfigurations { get; } + IConfigurationAssignmentsForSubscriptionsOperations ConfigurationAssignmentsForSubscriptions { get; } /// - /// Gets the IMaintenanceConfigurationsForResourceGroupOperations + /// Gets the IMaintenanceConfigurationsOperations /// - IMaintenanceConfigurationsForResourceGroupOperations MaintenanceConfigurationsForResourceGroup { get; } + IMaintenanceConfigurationsOperations MaintenanceConfigurations { get; } /// - /// Gets the IApplyUpdateForResourceGroupOperations + /// Gets the IPublicMaintenanceConfigurationsOperations /// - IApplyUpdateForResourceGroupOperations ApplyUpdateForResourceGroup { get; } + IPublicMaintenanceConfigurationsOperations PublicMaintenanceConfigurations { get; } /// - /// Gets the IConfigurationAssignmentsWithinSubscriptionOperations + /// Gets the IConfigurationAssignmentsOperations /// - IConfigurationAssignmentsWithinSubscriptionOperations ConfigurationAssignmentsWithinSubscription { get; } + IConfigurationAssignmentsOperations ConfigurationAssignments { get; } /// - /// Gets the IConfigurationAssignmentsForSubscriptionsOperations + /// Gets the IApplyUpdateForResourceGroupOperations /// - IConfigurationAssignmentsForSubscriptionsOperations ConfigurationAssignmentsForSubscriptions { get; } + IApplyUpdateForResourceGroupOperations ApplyUpdateForResourceGroup { get; } /// /// Gets the IConfigurationAssignmentsForResourceGroupOperations @@ -116,14 +114,19 @@ public partial interface IMaintenanceManagementClient : System.IDisposable IConfigurationAssignmentsForResourceGroupOperations ConfigurationAssignmentsForResourceGroup { get; } /// - /// Gets the IOperations + /// Gets the IMaintenanceConfigurationsForResourceGroupOperations /// - IOperations Operations { get; } + IMaintenanceConfigurationsForResourceGroupOperations MaintenanceConfigurationsForResourceGroup { get; } /// /// Gets the IUpdatesOperations /// IUpdatesOperations Updates { get; } + /// + /// Gets the IScheduledEventsOperations + /// + IScheduledEventsOperations ScheduledEvents { get; } + } } \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/IOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/IOperations.cs index f9c449bf7634..0234e2271015 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/IOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/IOperations.cs @@ -14,12 +14,10 @@ namespace Microsoft.Azure.Management.Maintenance public partial interface IOperations { /// - /// List the available operations supported by the Microsoft.Maintenance - /// resource provider + /// List the operations for the provider /// /// - /// List the available operations supported by the Microsoft.Maintenance - /// resource provider + /// List the operations for the provider /// /// /// The headers that will be added to request. @@ -33,7 +31,30 @@ public partial interface IOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// List the operations for the provider + /// + /// + /// List the operations for the provider + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/IPublicMaintenanceConfigurationsOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/IPublicMaintenanceConfigurationsOperations.cs index 12919ec54bb1..4d368fbdcee0 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/IPublicMaintenanceConfigurationsOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/IPublicMaintenanceConfigurationsOperations.cs @@ -31,7 +31,7 @@ public partial interface IPublicMaintenanceConfigurationsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get Public Maintenance Configuration record @@ -40,7 +40,7 @@ public partial interface IPublicMaintenanceConfigurationsOperations /// Get Public Maintenance Configuration record /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// /// /// The headers that will be added to request. @@ -56,5 +56,28 @@ public partial interface IPublicMaintenanceConfigurationsOperations /// System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Get Public Maintenance Configuration records + /// + /// + /// Get Public Maintenance Configuration records + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } } \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/IScheduledEventsOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/IScheduledEventsOperations.cs new file mode 100644 index 000000000000..fa26e0480f55 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/IScheduledEventsOperations.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// ScheduledEventsOperations operations. + /// + public partial interface IScheduledEventsOperations + { + /// + /// Post List of ScheduledEvents Acknowledgement + /// + /// + /// Post List of ScheduledEvents Acknowledgement + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Resource type + /// + /// + /// Resource name + /// + /// + /// The list of ScheduledEvents Id. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> AcknowledgeListWithHttpMessagesAsync(string resourceGroupName, string resourceType, string resourceName, System.Collections.Generic.IList value, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Post ScheduledEvents Acknowledgement + /// + /// + /// Post ScheduledEvents Acknowledgement + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Resource type + /// + /// + /// Resource Name + /// + /// + /// ScheduledEvents Id. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000) + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> AcknowledgeWithHttpMessagesAsync(string resourceGroupName, string resourceType, string resourceName, string scheduledEventId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/IUpdatesOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/IUpdatesOperations.cs index c5021f5a81d6..7ebf28de8e86 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/IUpdatesOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/IUpdatesOperations.cs @@ -20,7 +20,7 @@ public partial interface IUpdatesOperations /// Get updates to resources. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -49,7 +49,7 @@ public partial interface IUpdatesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Get updates to resources. @@ -58,7 +58,7 @@ public partial interface IUpdatesOperations /// Get updates to resources. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -81,7 +81,53 @@ public partial interface IUpdatesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get updates to resources. + /// + /// + /// Get updates to resources. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListParentNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Get updates to resources. + /// + /// + /// Get updates to resources. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsForResourceGroupOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsForResourceGroupOperations.cs index 23a4b3fa5030..476e9327bb34 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsForResourceGroupOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsForResourceGroupOperations.cs @@ -42,7 +42,7 @@ internal MaintenanceConfigurationsForResourceGroupOperations (MaintenanceManagem /// Get Configuration records within a subscription and resource group /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// /// Headers that will be added to request. @@ -65,27 +65,33 @@ internal MaintenanceConfigurationsForResourceGroupOperations (MaintenanceManagem /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.ApiVersion == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -103,7 +109,7 @@ internal MaintenanceConfigurationsForResourceGroupOperations (MaintenanceManagem var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -199,7 +205,184 @@ internal MaintenanceConfigurationsForResourceGroupOperations (MaintenanceManagem throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MaintenanceError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsForResourceGroupOperationsExtensions.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsForResourceGroupOperationsExtensions.cs index 416113d7cdc7..5672f48d1239 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsForResourceGroupOperationsExtensions.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsForResourceGroupOperationsExtensions.cs @@ -19,9 +19,9 @@ public static partial class MaintenanceConfigurationsForResourceGroupOperationsE /// The operations group for this extension method. /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// - public static System.Collections.Generic.IEnumerable List(this IMaintenanceConfigurationsForResourceGroupOperations operations, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage List(this IMaintenanceConfigurationsForResourceGroupOperations operations, string resourceGroupName) { return ((IMaintenanceConfigurationsForResourceGroupOperations)operations).ListAsync(resourceGroupName).GetAwaiter().GetResult(); } @@ -33,17 +33,50 @@ public static System.Collections.Generic.IEnumerable L /// The operations group for this extension method. /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IMaintenanceConfigurationsForResourceGroupOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IMaintenanceConfigurationsForResourceGroupOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IMaintenanceConfigurationsForResourceGroupOperations operations, string nextPageLink) + { + return ((IMaintenanceConfigurationsForResourceGroupOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get Configuration records within a subscription and resource group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IMaintenanceConfigurationsForResourceGroupOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsOperations.cs index b9810ef2a3da..d42eec5da634 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsOperations.cs @@ -38,14 +38,198 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client /// public MaintenanceManagementClient Client { get; private set; } + /// + /// Get Configuration records within a subscription + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/maintenanceConfigurations").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MaintenanceError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } /// /// Get Configuration record /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// /// /// Headers that will be added to request. @@ -74,24 +258,30 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (resourceName == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } } - - if (this.Client.ApiVersion == null) + if (resourceName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } // Tracing @@ -111,8 +301,8 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); @@ -250,10 +440,10 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client /// Create or Update configuration record /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// /// /// The configuration @@ -290,24 +480,30 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configuration"); } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (resourceName == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } } - - if (this.Client.ApiVersion == null) + if (resourceName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } // Tracing @@ -328,8 +524,8 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); @@ -488,13 +684,16 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client } /// - /// Delete Configuration record + /// Patch configuration record /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration + /// + /// + /// The configuration /// /// /// Headers that will be added to request. @@ -517,30 +716,40 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, MaintenanceConfiguration configuration, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (configuration == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configuration"); } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (resourceName == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } } - - if (this.Client.ApiVersion == null) + if (resourceName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } // Tracing @@ -553,15 +762,16 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("configuration", configuration); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); @@ -577,7 +787,7 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -606,6 +816,12 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client } // Serialize Request string _requestContent = null; + if(configuration != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(configuration, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -628,7 +844,7 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -696,16 +912,13 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client } /// - /// Patch configuration record + /// Delete Configuration record /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name - /// - /// - /// The configuration + /// The name of the MaintenanceConfiguration /// /// /// Headers that will be added to request. @@ -728,34 +941,36 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string resourceName, MaintenanceConfiguration configuration, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (configuration == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "configuration"); - } - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (resourceName == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } } - - if (this.Client.ApiVersion == null) + if (resourceName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } // Tracing @@ -768,16 +983,15 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceName", resourceName); - tracingParameters.Add("configuration", configuration); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); @@ -793,7 +1007,7 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -822,12 +1036,6 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client } // Serialize Request string _requestContent = null; - if(configuration != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(configuration, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -850,7 +1058,7 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -920,6 +1128,9 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client /// /// Get Configuration records within a subscription /// + /// + /// The NextLink from the previous successful call to List operation. + /// /// /// Headers that will be added to request. /// @@ -941,22 +1152,13 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - - - - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - - if (this.Client.ApiVersion == null) + if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -964,22 +1166,17 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL - - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/maintenanceConfigurations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -1068,7 +1265,7 @@ internal MaintenanceConfigurationsOperations (MaintenanceManagementClient client throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsOperationsExtensions.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsOperationsExtensions.cs index 27ac154ebf9a..ef036628cba5 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsOperationsExtensions.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceConfigurationsOperationsExtensions.cs @@ -12,6 +12,33 @@ namespace Microsoft.Azure.Management.Maintenance /// public static partial class MaintenanceConfigurationsOperationsExtensions { + /// + /// Get Configuration records within a subscription + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IMaintenanceConfigurationsOperations operations) + { + return ((IMaintenanceConfigurationsOperations)operations).ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Get Configuration records within a subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IMaintenanceConfigurationsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } /// /// Get Configuration record /// @@ -19,10 +46,10 @@ public static partial class MaintenanceConfigurationsOperationsExtensions /// The operations group for this extension method. /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// public static MaintenanceConfiguration Get(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName) { @@ -36,10 +63,10 @@ public static MaintenanceConfiguration Get(this IMaintenanceConfigurationsOperat /// The operations group for this extension method. /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// /// /// The cancellation token. @@ -58,10 +85,10 @@ public static MaintenanceConfiguration Get(this IMaintenanceConfigurationsOperat /// The operations group for this extension method. /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// public static MaintenanceConfiguration CreateOrUpdate(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName, MaintenanceConfiguration configuration) { @@ -75,10 +102,10 @@ public static MaintenanceConfiguration CreateOrUpdate(this IMaintenanceConfigura /// The operations group for this extension method. /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// /// /// The cancellation token. @@ -91,79 +118,79 @@ public static MaintenanceConfiguration CreateOrUpdate(this IMaintenanceConfigura } } /// - /// Delete Configuration record + /// Patch configuration record /// /// /// The operations group for this extension method. /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// - public static MaintenanceConfiguration Delete(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName) + public static MaintenanceConfiguration Update(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName, MaintenanceConfiguration configuration) { - return ((IMaintenanceConfigurationsOperations)operations).DeleteAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); + return ((IMaintenanceConfigurationsOperations)operations).UpdateAsync(resourceGroupName, resourceName, configuration).GetAwaiter().GetResult(); } /// - /// Delete Configuration record + /// Patch configuration record /// /// /// The operations group for this extension method. /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateAsync(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName, MaintenanceConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, resourceName, configuration, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Patch configuration record + /// Delete Configuration record /// /// /// The operations group for this extension method. /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// - public static MaintenanceConfiguration Update(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName, MaintenanceConfiguration configuration) + public static MaintenanceConfiguration Delete(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName) { - return ((IMaintenanceConfigurationsOperations)operations).UpdateAsync(resourceGroupName, resourceName, configuration).GetAwaiter().GetResult(); + return ((IMaintenanceConfigurationsOperations)operations).DeleteAsync(resourceGroupName, resourceName).GetAwaiter().GetResult(); } /// - /// Patch configuration record + /// Delete Configuration record /// /// /// The operations group for this extension method. /// /// - /// Resource Group Name + /// The name of the resource group. The name is case insensitive. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName, MaintenanceConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IMaintenanceConfigurationsOperations operations, string resourceGroupName, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, resourceName, configuration, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -174,9 +201,12 @@ public static MaintenanceConfiguration Update(this IMaintenanceConfigurationsOpe /// /// The operations group for this extension method. /// - public static System.Collections.Generic.IEnumerable List(this IMaintenanceConfigurationsOperations operations) + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IMaintenanceConfigurationsOperations operations, string nextPageLink) { - return ((IMaintenanceConfigurationsOperations)operations).ListAsync().GetAwaiter().GetResult(); + return ((IMaintenanceConfigurationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -185,12 +215,15 @@ public static System.Collections.Generic.IEnumerable L /// /// The operations group for this extension method. /// + /// + /// The NextLink from the previous successful call to List operation. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IMaintenanceConfigurationsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListNextAsync(this IMaintenanceConfigurationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceManagementClient.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceManagementClient.cs index 24d4b3b7cbf6..36222e4a7343 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceManagementClient.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/MaintenanceManagementClient.cs @@ -38,11 +38,9 @@ public partial class MaintenanceManagementClient : Microsoft.Rest.ServiceClient< public string ApiVersion { get; private set; } /// - /// Subscription credentials that uniquely identify a Microsoft Azure - /// subscription. The subscription ID forms part of the URI for every service - /// call. + /// The ID of the target subscription. The value must be an UUID. /// - public string SubscriptionId { get; set;} + public System.Guid SubscriptionId { get; set;} /// /// The preferred language for the response. @@ -63,50 +61,54 @@ public partial class MaintenanceManagementClient : Microsoft.Rest.ServiceClient< public bool? GenerateClientRequestId { get; set;} /// - /// Gets the IPublicMaintenanceConfigurationsOperations + /// Gets the IOperations /// - public virtual IPublicMaintenanceConfigurationsOperations PublicMaintenanceConfigurations { get; private set; } + public virtual IOperations Operations { get; private set; } /// /// Gets the IApplyUpdatesOperations /// public virtual IApplyUpdatesOperations ApplyUpdates { get; private set; } /// - /// Gets the IConfigurationAssignmentsOperations + /// Gets the IConfigurationAssignmentsWithinSubscriptionOperations /// - public virtual IConfigurationAssignmentsOperations ConfigurationAssignments { get; private set; } + public virtual IConfigurationAssignmentsWithinSubscriptionOperations ConfigurationAssignmentsWithinSubscription { get; private set; } /// - /// Gets the IMaintenanceConfigurationsOperations + /// Gets the IConfigurationAssignmentsForSubscriptionsOperations /// - public virtual IMaintenanceConfigurationsOperations MaintenanceConfigurations { get; private set; } + public virtual IConfigurationAssignmentsForSubscriptionsOperations ConfigurationAssignmentsForSubscriptions { get; private set; } /// - /// Gets the IMaintenanceConfigurationsForResourceGroupOperations + /// Gets the IMaintenanceConfigurationsOperations /// - public virtual IMaintenanceConfigurationsForResourceGroupOperations MaintenanceConfigurationsForResourceGroup { get; private set; } + public virtual IMaintenanceConfigurationsOperations MaintenanceConfigurations { get; private set; } /// - /// Gets the IApplyUpdateForResourceGroupOperations + /// Gets the IPublicMaintenanceConfigurationsOperations /// - public virtual IApplyUpdateForResourceGroupOperations ApplyUpdateForResourceGroup { get; private set; } + public virtual IPublicMaintenanceConfigurationsOperations PublicMaintenanceConfigurations { get; private set; } /// - /// Gets the IConfigurationAssignmentsWithinSubscriptionOperations + /// Gets the IConfigurationAssignmentsOperations /// - public virtual IConfigurationAssignmentsWithinSubscriptionOperations ConfigurationAssignmentsWithinSubscription { get; private set; } + public virtual IConfigurationAssignmentsOperations ConfigurationAssignments { get; private set; } /// - /// Gets the IConfigurationAssignmentsForSubscriptionsOperations + /// Gets the IApplyUpdateForResourceGroupOperations /// - public virtual IConfigurationAssignmentsForSubscriptionsOperations ConfigurationAssignmentsForSubscriptions { get; private set; } + public virtual IApplyUpdateForResourceGroupOperations ApplyUpdateForResourceGroup { get; private set; } /// /// Gets the IConfigurationAssignmentsForResourceGroupOperations /// public virtual IConfigurationAssignmentsForResourceGroupOperations ConfigurationAssignmentsForResourceGroup { get; private set; } /// - /// Gets the IOperations + /// Gets the IMaintenanceConfigurationsForResourceGroupOperations /// - public virtual IOperations Operations { get; private set; } + public virtual IMaintenanceConfigurationsForResourceGroupOperations MaintenanceConfigurationsForResourceGroup { get; private set; } /// /// Gets the IUpdatesOperations /// public virtual IUpdatesOperations Updates { get; private set; } /// + /// Gets the IScheduledEventsOperations + /// + public virtual IScheduledEventsOperations ScheduledEvents { get; private set; } + /// /// Initializes a new instance of the MaintenanceManagementClient class. /// /// @@ -310,6 +312,9 @@ public MaintenanceManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceCli /// /// Optional. The http client handler used to handle http transport. /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// /// /// Thrown when a required parameter is null /// @@ -341,19 +346,20 @@ public MaintenanceManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceCli /// private void Initialize() { - this.PublicMaintenanceConfigurations = new PublicMaintenanceConfigurationsOperations(this); + this.Operations = new Operations(this); this.ApplyUpdates = new ApplyUpdatesOperations(this); - this.ConfigurationAssignments = new ConfigurationAssignmentsOperations(this); - this.MaintenanceConfigurations = new MaintenanceConfigurationsOperations(this); - this.MaintenanceConfigurationsForResourceGroup = new MaintenanceConfigurationsForResourceGroupOperations(this); - this.ApplyUpdateForResourceGroup = new ApplyUpdateForResourceGroupOperations(this); this.ConfigurationAssignmentsWithinSubscription = new ConfigurationAssignmentsWithinSubscriptionOperations(this); this.ConfigurationAssignmentsForSubscriptions = new ConfigurationAssignmentsForSubscriptionsOperations(this); + this.MaintenanceConfigurations = new MaintenanceConfigurationsOperations(this); + this.PublicMaintenanceConfigurations = new PublicMaintenanceConfigurationsOperations(this); + this.ConfigurationAssignments = new ConfigurationAssignmentsOperations(this); + this.ApplyUpdateForResourceGroup = new ApplyUpdateForResourceGroupOperations(this); this.ConfigurationAssignmentsForResourceGroup = new ConfigurationAssignmentsForResourceGroupOperations(this); - this.Operations = new Operations(this); + this.MaintenanceConfigurationsForResourceGroup = new MaintenanceConfigurationsForResourceGroupOperations(this); this.Updates = new UpdatesOperations(this); + this.ScheduledEvents = new ScheduledEventsOperations(this); this.BaseUri = new System.Uri("https://management.azure.com"); - this.ApiVersion = "2023-09-01-preview"; + this.ApiVersion = "2025-10-01-preview"; this.AcceptLanguage = "en-US"; this.LongRunningOperationRetryTimeout = 30; this.GenerateClientRequestId = true; diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ActionType.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ActionType.cs new file mode 100644 index 000000000000..71b6784b6cd0 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ActionType.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + + /// + /// Defines values for ActionType. + /// + + + public static class ActionType + { + public const string Internal = "Internal"; + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdate.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdate.cs index ae180e2503f5..2d9b320a4453 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdate.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdate.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.Maintenance.Models /// Apply Update request /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class ApplyUpdate : Resource + public partial class ApplyUpdate : ProxyResource { /// /// Initializes a new instance of the ApplyUpdate class. @@ -25,13 +25,15 @@ public ApplyUpdate() /// Initializes a new instance of the ApplyUpdate class. /// - /// Fully qualified identifier of the resource + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// Name of the resource + /// The name of the resource /// - /// Type of the resource + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// /// Azure Resource Manager metadata containing createdBy and modifiedBy diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdateProperties.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdateProperties.cs new file mode 100644 index 000000000000..1842d2e6dd1e --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdateProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + using System.Linq; + + /// + /// Properties for apply update + /// + public partial class ApplyUpdateProperties + { + /// + /// Initializes a new instance of the ApplyUpdateProperties class. + /// + public ApplyUpdateProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplyUpdateProperties class. + /// + + /// The status + /// Possible values include: 'Pending', 'InProgress', 'Completed', 'RetryNow', + /// 'RetryLater', 'NoUpdatesPending', 'Cancel', 'Cancelled' + + /// The resourceId + /// + + /// Last Update time + /// + public ApplyUpdateProperties(string status = default(string), string resourceId = default(string), System.DateTime? lastUpdateTime = default(System.DateTime?)) + + { + this.Status = status; + this.ResourceId = resourceId; + this.LastUpdateTime = lastUpdateTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the status Possible values include: 'Pending', 'InProgress', 'Completed', 'RetryNow', 'RetryLater', 'NoUpdatesPending', 'Cancel', 'Cancelled' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "status")] + public string Status {get; set; } + + /// + /// Gets or sets the resourceId + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } + + /// + /// Gets or sets last Update time + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastUpdateTime")] + public System.DateTime? LastUpdateTime {get; set; } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdatesCreateOrUpdateHeaders.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdatesCreateOrUpdateHeaders.cs new file mode 100644 index 000000000000..c11b41ddb2d0 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdatesCreateOrUpdateHeaders.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.Maintenance.Models +{ + using System.Linq; + + public partial class ApplyUpdatesCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the ApplyUpdatesCreateOrUpdateHeaders class. + /// + public ApplyUpdatesCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplyUpdatesCreateOrUpdateHeaders class. + /// + + /// + /// + public ApplyUpdatesCreateOrUpdateHeaders(int? retryAfter = default(int?)) + + { + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdatesCreateOrUpdateParentHeaders.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdatesCreateOrUpdateParentHeaders.cs new file mode 100644 index 000000000000..4a108c155540 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ApplyUpdatesCreateOrUpdateParentHeaders.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.Maintenance.Models +{ + using System.Linq; + + public partial class ApplyUpdatesCreateOrUpdateParentHeaders + { + /// + /// Initializes a new instance of the ApplyUpdatesCreateOrUpdateParentHeaders class. + /// + public ApplyUpdatesCreateOrUpdateParentHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplyUpdatesCreateOrUpdateParentHeaders class. + /// + + /// + /// + public ApplyUpdatesCreateOrUpdateParentHeaders(int? retryAfter = default(int?)) + + { + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ConfigurationAssignment.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ConfigurationAssignment.cs index 4040c81c77bc..7a86a77c076c 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ConfigurationAssignment.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ConfigurationAssignment.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.Maintenance.Models /// Configuration Assignment /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class ConfigurationAssignment : Resource + public partial class ConfigurationAssignment : ProxyResource { /// /// Initializes a new instance of the ConfigurationAssignment class. @@ -25,13 +25,15 @@ public ConfigurationAssignment() /// Initializes a new instance of the ConfigurationAssignment class. /// - /// Fully qualified identifier of the resource + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// Name of the resource + /// The name of the resource /// - /// Type of the resource + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// /// Azure Resource Manager metadata containing createdBy and modifiedBy diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ConfigurationAssignmentProperties.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ConfigurationAssignmentProperties.cs new file mode 100644 index 000000000000..fa7b73c878ff --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ConfigurationAssignmentProperties.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + using System.Linq; + + /// + /// Properties for configuration assignment + /// + public partial class ConfigurationAssignmentProperties + { + /// + /// Initializes a new instance of the ConfigurationAssignmentProperties class. + /// + public ConfigurationAssignmentProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConfigurationAssignmentProperties class. + /// + + /// The maintenance configuration Id + /// + + /// The unique resourceId + /// + + /// Properties of the configuration assignment + /// + public ConfigurationAssignmentProperties(string maintenanceConfigurationId = default(string), string resourceId = default(string), ConfigurationAssignmentFilterProperties filter = default(ConfigurationAssignmentFilterProperties)) + + { + this.MaintenanceConfigurationId = maintenanceConfigurationId; + this.ResourceId = resourceId; + this.Filter = filter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the maintenance configuration Id + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "maintenanceConfigurationId")] + public string MaintenanceConfigurationId {get; set; } + + /// + /// Gets or sets the unique resourceId + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } + + /// + /// Gets or sets properties of the configuration assignment + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "filter")] + public ConfigurationAssignmentFilterProperties Filter {get; set; } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/InputLinuxParameters.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/InputLinuxParameters.cs index f8665dde452b..777b16e06eac 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/InputLinuxParameters.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/InputLinuxParameters.cs @@ -30,7 +30,8 @@ public InputLinuxParameters() /// Package names to be included for patching. /// - /// Classification category of patches to be patched + /// Classification category of patches to be patched. Allowed values are + /// 'Critical', 'Security', and 'Other'. /// public InputLinuxParameters(System.Collections.Generic.IList packageNameMasksToExclude = default(System.Collections.Generic.IList), System.Collections.Generic.IList packageNameMasksToInclude = default(System.Collections.Generic.IList), System.Collections.Generic.IList classificationsToInclude = default(System.Collections.Generic.IList)) @@ -60,7 +61,8 @@ public InputLinuxParameters() public System.Collections.Generic.IList PackageNameMasksToInclude {get; set; } /// - /// Gets or sets classification category of patches to be patched + /// Gets or sets classification category of patches to be patched. Allowed + /// values are 'Critical', 'Security', and 'Other'. /// [Newtonsoft.Json.JsonProperty(PropertyName = "classificationsToInclude")] public System.Collections.Generic.IList ClassificationsToInclude {get; set; } diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/InputWindowsParameters.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/InputWindowsParameters.cs index a9eee9638cd6..0c7c36f7ba38 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/InputWindowsParameters.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/InputWindowsParameters.cs @@ -30,7 +30,9 @@ public InputWindowsParameters() /// Windows KBID to be included for patching. /// - /// Classification category of patches to be patched + /// Classification category of patches to be patched. Allowed values are + /// 'Critical', 'Security', 'UpdateRollup', 'FeaturePack', 'ServicePack', + /// 'Definition', 'Tools', and 'Updates'. /// /// Exclude patches which need reboot @@ -64,7 +66,9 @@ public InputWindowsParameters() public System.Collections.Generic.IList KbNumbersToInclude {get; set; } /// - /// Gets or sets classification category of patches to be patched + /// Gets or sets classification category of patches to be patched. Allowed + /// values are 'Critical', 'Security', 'UpdateRollup', 'FeaturePack', + /// 'ServicePack', 'Definition', 'Tools', and 'Updates'. /// [Newtonsoft.Json.JsonProperty(PropertyName = "classificationsToInclude")] public System.Collections.Generic.IList ClassificationsToInclude {get; set; } diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/MaintenanceConfiguration.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/MaintenanceConfiguration.cs index 38fd2fd4a038..779f4e96f3a2 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/MaintenanceConfiguration.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/MaintenanceConfiguration.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.Maintenance.Models /// Maintenance configuration record type /// [Microsoft.Rest.Serialization.JsonTransformation] - public partial class MaintenanceConfiguration : Resource + public partial class MaintenanceConfiguration : ProxyResource { /// /// Initializes a new instance of the MaintenanceConfiguration class. @@ -25,13 +25,15 @@ public MaintenanceConfiguration() /// Initializes a new instance of the MaintenanceConfiguration class. /// - /// Fully qualified identifier of the resource + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// Name of the resource + /// The name of the resource /// - /// Type of the resource + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// /// Azure Resource Manager metadata containing createdBy and modifiedBy diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/MaintenanceConfigurationProperties.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/MaintenanceConfigurationProperties.cs new file mode 100644 index 000000000000..4ca0883134e6 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/MaintenanceConfigurationProperties.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + using System.Linq; + + /// + /// Properties for maintenance configuration + /// + [Microsoft.Rest.Serialization.JsonTransformation] + public partial class MaintenanceConfigurationProperties + { + /// + /// Initializes a new instance of the MaintenanceConfigurationProperties class. + /// + public MaintenanceConfigurationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MaintenanceConfigurationProperties class. + /// + + /// Gets or sets namespace of the resource + /// + + /// Gets or sets extensionProperties of the maintenanceConfiguration + /// + + /// Gets or sets maintenanceScope of the configuration + /// Possible values include: 'Host', 'Resource', 'OSImage', 'Extension', + /// 'InGuestPatch', 'SQLDB', 'SQLManagedInstance' + + /// Gets or sets the visibility of the configuration. The default value is + /// 'Custom' + /// Possible values include: 'Custom', 'Public' + + /// The input parameters to be passed to the patch run operation. + /// + + /// Duration of the maintenance window in HH:mm format. If not provided, + /// default value will be used based on maintenance scope provided. Example: + /// 05:00. + /// + + /// Name of the timezone. List of timezones can be obtained by executing + /// [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. Example: Pacific + /// Standard Time, UTC, W. Europe Standard Time, Korea Standard Time, Cen. + /// Australia Standard Time. + /// + + /// Rate at which a Maintenance window is expected to recur. The rate can be + /// expressed as daily, weekly, or monthly schedules. Daily schedule are + /// formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency + /// is provided, the default frequency is 1. Daily schedule examples are + /// recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as + /// recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated + /// list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: + /// 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted + /// as [Frequency as integer]['Month(s)'] [Comma separated list of month days] + /// or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, + /// Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. + /// Offset value must be between -6 to 6 inclusive. Monthly schedule examples + /// are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, + /// recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday, recurEvery: + /// Month Last Sunday Offset-3, recurEvery: Month Third Sunday Offset6. + /// + + /// Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. + /// The start date can be set to either the current date or future date. The + /// window will be created in the time zone provided and adjusted to daylight + /// savings according to that time zone. + /// + + /// Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm + /// format. The window will be created in the time zone provided and adjusted + /// to daylight savings according to that time zone. Expiration date must be + /// set to a future date. If not provided, it will be set to the maximum + /// datetime 9999-12-31 23:59:59. + /// + public MaintenanceConfigurationProperties(string namespaceProperty = default(string), System.Collections.Generic.IDictionary extensionProperties = default(System.Collections.Generic.IDictionary), string maintenanceScope = default(string), string visibility = default(string), InputPatchConfiguration installPatches = default(InputPatchConfiguration), string duration = default(string), string timeZone = default(string), string recurEvery = default(string), string startDateTime = default(string), string expirationDateTime = default(string)) + + { + this.NamespaceProperty = namespaceProperty; + this.ExtensionProperties = extensionProperties; + this.MaintenanceScope = maintenanceScope; + this.Visibility = visibility; + this.InstallPatches = installPatches; + this.Duration = duration; + this.TimeZone = timeZone; + this.RecurEvery = recurEvery; + this.StartDateTime = startDateTime; + this.ExpirationDateTime = expirationDateTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets gets or sets namespace of the resource + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "namespace")] + public string NamespaceProperty {get; set; } + + /// + /// Gets or sets gets or sets extensionProperties of the + /// maintenanceConfiguration + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "extensionProperties")] + public System.Collections.Generic.IDictionary ExtensionProperties {get; set; } + + /// + /// Gets or sets gets or sets maintenanceScope of the configuration Possible values include: 'Host', 'Resource', 'OSImage', 'Extension', 'InGuestPatch', 'SQLDB', 'SQLManagedInstance' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "maintenanceScope")] + public string MaintenanceScope {get; set; } + + /// + /// Gets or sets gets or sets the visibility of the configuration. The default + /// value is 'Custom' Possible values include: 'Custom', 'Public' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "visibility")] + public string Visibility {get; set; } + + /// + /// Gets or sets the input parameters to be passed to the patch run operation. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "installPatches")] + public InputPatchConfiguration InstallPatches {get; set; } + + /// + /// Gets or sets duration of the maintenance window in HH:mm format. If not + /// provided, default value will be used based on maintenance scope provided. + /// Example: 05:00. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "maintenanceWindow.duration")] + public string Duration {get; set; } + + /// + /// Gets or sets name of the timezone. List of timezones can be obtained by + /// executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + /// Example: Pacific Standard Time, UTC, W. Europe Standard Time, Korea + /// Standard Time, Cen. Australia Standard Time. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "maintenanceWindow.timeZone")] + public string TimeZone {get; set; } + + /// + /// Gets or sets rate at which a Maintenance window is expected to recur. The + /// rate can be expressed as daily, weekly, or monthly schedules. Daily + /// schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If + /// no frequency is provided, the default frequency is 1. Daily schedule + /// examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are + /// formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma + /// separated list of weekdays Monday-Sunday]. Weekly schedule examples are + /// recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are + /// formatted as [Frequency as integer]['Month(s)'] [Comma separated list of + /// month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, + /// Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. + /// of days)]. Offset value must be between -6 to 6 inclusive. Monthly schedule + /// examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month + /// day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth + /// Monday, recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third + /// Sunday Offset6. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "maintenanceWindow.recurEvery")] + public string RecurEvery {get; set; } + + /// + /// Gets or sets effective start date of the maintenance window in YYYY-MM-DD + /// hh:mm format. The start date can be set to either the current date or + /// future date. The window will be created in the time zone provided and + /// adjusted to daylight savings according to that time zone. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "maintenanceWindow.startDateTime")] + public string StartDateTime {get; set; } + + /// + /// Gets or sets effective expiration date of the maintenance window in + /// YYYY-MM-DD hh:mm format. The window will be created in the time zone + /// provided and adjusted to daylight savings according to that time zone. + /// Expiration date must be set to a future date. If not provided, it will be + /// set to the maximum datetime 9999-12-31 23:59:59. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "maintenanceWindow.expirationDateTime")] + public string ExpirationDateTime {get; set; } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/MaintenanceWindow.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/MaintenanceWindow.cs new file mode 100644 index 000000000000..a6eafdcf8a98 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/MaintenanceWindow.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + using System.Linq; + + /// + /// Definition of a MaintenanceWindow + /// + public partial class MaintenanceWindow + { + /// + /// Initializes a new instance of the MaintenanceWindow class. + /// + public MaintenanceWindow() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MaintenanceWindow class. + /// + + /// Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. + /// The start date can be set to either the current date or future date. The + /// window will be created in the time zone provided and adjusted to daylight + /// savings according to that time zone. + /// + + /// Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm + /// format. The window will be created in the time zone provided and adjusted + /// to daylight savings according to that time zone. Expiration date must be + /// set to a future date. If not provided, it will be set to the maximum + /// datetime 9999-12-31 23:59:59. + /// + + /// Duration of the maintenance window in HH:mm format. If not provided, + /// default value will be used based on maintenance scope provided. Example: + /// 05:00. + /// + + /// Name of the timezone. List of timezones can be obtained by executing + /// [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. Example: Pacific + /// Standard Time, UTC, W. Europe Standard Time, Korea Standard Time, Cen. + /// Australia Standard Time. + /// + + /// Rate at which a Maintenance window is expected to recur. The rate can be + /// expressed as daily, weekly, or monthly schedules. Daily schedule are + /// formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency + /// is provided, the default frequency is 1. Daily schedule examples are + /// recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as + /// recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated + /// list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: + /// 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted + /// as [Frequency as integer]['Month(s)'] [Comma separated list of month days] + /// or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, + /// Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. + /// Offset value must be between -6 to 6 inclusive. Monthly schedule examples + /// are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, + /// recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday, recurEvery: + /// Month Last Sunday Offset-3, recurEvery: Month Third Sunday Offset6. + /// + public MaintenanceWindow(string startDateTime = default(string), string expirationDateTime = default(string), string duration = default(string), string timeZone = default(string), string recurEvery = default(string)) + + { + this.StartDateTime = startDateTime; + this.ExpirationDateTime = expirationDateTime; + this.Duration = duration; + this.TimeZone = timeZone; + this.RecurEvery = recurEvery; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets effective start date of the maintenance window in YYYY-MM-DD + /// hh:mm format. The start date can be set to either the current date or + /// future date. The window will be created in the time zone provided and + /// adjusted to daylight savings according to that time zone. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "startDateTime")] + public string StartDateTime {get; set; } + + /// + /// Gets or sets effective expiration date of the maintenance window in + /// YYYY-MM-DD hh:mm format. The window will be created in the time zone + /// provided and adjusted to daylight savings according to that time zone. + /// Expiration date must be set to a future date. If not provided, it will be + /// set to the maximum datetime 9999-12-31 23:59:59. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expirationDateTime")] + public string ExpirationDateTime {get; set; } + + /// + /// Gets or sets duration of the maintenance window in HH:mm format. If not + /// provided, default value will be used based on maintenance scope provided. + /// Example: 05:00. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "duration")] + public string Duration {get; set; } + + /// + /// Gets or sets name of the timezone. List of timezones can be obtained by + /// executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. + /// Example: Pacific Standard Time, UTC, W. Europe Standard Time, Korea + /// Standard Time, Cen. Australia Standard Time. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "timeZone")] + public string TimeZone {get; set; } + + /// + /// Gets or sets rate at which a Maintenance window is expected to recur. The + /// rate can be expressed as daily, weekly, or monthly schedules. Daily + /// schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If + /// no frequency is provided, the default frequency is 1. Daily schedule + /// examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are + /// formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma + /// separated list of weekdays Monday-Sunday]. Weekly schedule examples are + /// recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are + /// formatted as [Frequency as integer]['Month(s)'] [Comma separated list of + /// month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, + /// Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. + /// of days)]. Offset value must be between -6 to 6 inclusive. Monthly schedule + /// examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month + /// day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth + /// Monday, recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third + /// Sunday Offset6. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "recurEvery")] + public string RecurEvery {get; set; } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Operation.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Operation.cs index fa706e4b90d5..97ee825c5aba 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Operation.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Operation.cs @@ -8,9 +8,13 @@ namespace Microsoft.Azure.Management.Maintenance.Models using System.Linq; /// - /// Represents an operation returned by the GetOperations request + /// Details of a REST API operation, returned from the Resource Provider + /// Operations API /// - [Microsoft.Rest.Serialization.JsonTransformation] + /// + /// Details of a REST API operation, returned from the Resource Provider + /// Operations API + /// public partial class Operation { /// @@ -25,28 +29,33 @@ public Operation() /// Initializes a new instance of the Operation class. /// - /// Name of the operation + /// The name of the operation, as per Resource-Based Access Control (RBAC). + /// Examples: "Microsoft.Compute/virtualMachines/write", + /// "Microsoft.Compute/virtualMachines/capture/action" /// - /// Display name of the operation + /// Whether the operation applies to data-plane. This is "true" for data-plane + /// operations and "false" for ARM/control-plane operations. /// - /// Origin of the operation + /// Localized display information for this particular operation. /// - /// Properties of the operation - /// + /// The intended executor of the operation; as in Resource Based Access Control + /// (RBAC) and audit logs UX. Default value is "user,system" + /// Possible values include: 'user', 'system', 'user,system' - /// Indicates whether the operation is a data action - /// - public Operation(string name = default(string), OperationInfo display = default(OperationInfo), string origin = default(string), object properties = default(object), bool? isDataAction = default(bool?)) + /// Enum. Indicates the action type. "Internal" refers to actions that are for + /// internal only APIs. + /// Possible values include: 'Internal' + public Operation(string name = default(string), bool? isDataAction = default(bool?), OperationDisplay display = default(OperationDisplay), string origin = default(string), string actionType = default(string)) { this.Name = name; + this.IsDataAction = isDataAction; this.Display = display; this.Origin = origin; - this.Properties = properties; - this.IsDataAction = isDataAction; + this.ActionType = actionType; CustomInit(); } @@ -57,33 +66,38 @@ public Operation() /// - /// Gets or sets name of the operation + /// Gets the name of the operation, as per Resource-Based Access Control + /// (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + /// "Microsoft.Compute/virtualMachines/capture/action" /// [Newtonsoft.Json.JsonProperty(PropertyName = "name")] - public string Name {get; set; } + public string Name {get; private set; } /// - /// Gets or sets display name of the operation + /// Gets whether the operation applies to data-plane. This is "true" for + /// data-plane operations and "false" for ARM/control-plane operations. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "display")] - public OperationInfo Display {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "isDataAction")] + public bool? IsDataAction {get; private set; } /// - /// Gets or sets origin of the operation + /// Gets or sets localized display information for this particular operation. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "origin")] - public string Origin {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "display")] + public OperationDisplay Display {get; set; } /// - /// Gets or sets properties of the operation + /// Gets the intended executor of the operation; as in Resource Based Access + /// Control (RBAC) and audit logs UX. Default value is "user,system" Possible values include: 'user', 'system', 'user,system' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] - public object Properties {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "origin")] + public string Origin {get; private set; } /// - /// Gets or sets indicates whether the operation is a data action + /// Gets enum. Indicates the action type. "Internal" refers to actions that are + /// for internal only APIs. Possible values include: 'Internal' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "isDataAction")] - public bool? IsDataAction {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "actionType")] + public string ActionType {get; private set; } } } \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/OperationDisplay.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/OperationDisplay.cs new file mode 100644 index 000000000000..d157f3bbb3c2 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/OperationDisplay.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + using System.Linq; + + /// + /// Localized display information for this particular operation. + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + + /// The localized friendly form of the resource provider name, e.g. "Microsoft + /// Monitoring Insights" or "Microsoft Compute". + /// + + /// The localized friendly name of the resource type related to this operation. + /// E.g. "Virtual Machines" or "Job Schedule Collections". + /// + + /// The concise, localized friendly name for the operation; suitable for + /// dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual + /// Machine". + /// + + /// The short, localized friendly description of the operation; suitable for + /// tool tips and detailed views. + /// + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + + { + this.Provider = provider; + this.Resource = resource; + this.Operation = operation; + this.Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the localized friendly form of the resource provider name, e.g. + /// "Microsoft Monitoring Insights" or "Microsoft Compute". + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "provider")] + public string Provider {get; private set; } + + /// + /// Gets the localized friendly name of the resource type related to this + /// operation. E.g. "Virtual Machines" or "Job Schedule Collections". + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resource")] + public string Resource {get; private set; } + + /// + /// Gets the concise, localized friendly name for the operation; suitable for + /// dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual + /// Machine". + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + public string Operation {get; private set; } + + /// + /// Gets the short, localized friendly description of the operation; suitable + /// for tool tips and detailed views. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; private set; } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/OperationInfo.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/OperationInfo.cs deleted file mode 100644 index 6fd98c7d98e4..000000000000 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/OperationInfo.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.Management.Maintenance.Models -{ - using System.Linq; - - /// - /// Information about an operation - /// - public partial class OperationInfo - { - /// - /// Initializes a new instance of the OperationInfo class. - /// - public OperationInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the OperationInfo class. - /// - - /// Name of the provider - /// - - /// Name of the resource type - /// - - /// Name of the operation - /// - - /// Description of the operation - /// - public OperationInfo(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) - - { - this.Provider = provider; - this.Resource = resource; - this.Operation = operation; - this.Description = description; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - - /// - /// Gets or sets name of the provider - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "provider")] - public string Provider {get; set; } - - /// - /// Gets or sets name of the resource type - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "resource")] - public string Resource {get; set; } - - /// - /// Gets or sets name of the operation - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] - public string Operation {get; set; } - - /// - /// Gets or sets description of the operation - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "description")] - public string Description {get; set; } - } -} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Origin.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Origin.cs new file mode 100644 index 000000000000..68a566283b7a --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Origin.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + + /// + /// Defines values for Origin. + /// + + + public static class Origin + { + public const string User = "user"; + public const string System = "system"; + public const string UserSystem = "user,system"; + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Page.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Page.cs index b1ae08776780..a57aecaceca3 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Page.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Page.cs @@ -16,7 +16,7 @@ public class Page : Microsoft.Rest.Azure.IPage /// /// Gets the link to the next page. /// - [Newtonsoft.Json.JsonProperty("")] + [Newtonsoft.Json.JsonProperty("nextLink")] public System.String NextPageLink { get; private set; } [Newtonsoft.Json.JsonProperty("value")] diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ProxyResource.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ProxyResource.cs new file mode 100644 index 000000000000..c994bc81dcbe --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ProxyResource.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + using System.Linq; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. + /// It will not have tags and a location + /// + /// + /// The resource model definition for a Azure Resource Manager proxy resource. + /// It will not have tags and a location + /// + public partial class ProxyResource : Resource + { + /// + /// Initializes a new instance of the ProxyResource class. + /// + public ProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyResource class. + /// + + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + public ProxyResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) + + : base(id, name, type, systemData) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Resource.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Resource.cs index cc6447a63ab2..59b37571090a 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Resource.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/Resource.cs @@ -8,8 +8,13 @@ namespace Microsoft.Azure.Management.Maintenance.Models using System.Linq; /// - /// Definition of a Resource + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// public partial class Resource : Microsoft.Rest.Azure.IResource { /// @@ -24,13 +29,15 @@ public Resource() /// Initializes a new instance of the Resource class. /// - /// Fully qualified identifier of the resource + /// Fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// - /// Name of the resource + /// The name of the resource /// - /// Type of the resource + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// /// Azure Resource Manager metadata containing createdBy and modifiedBy @@ -53,19 +60,21 @@ public Resource() /// - /// Gets fully qualified identifier of the resource + /// Gets fully qualified resource ID for the resource. E.g. + /// "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" /// [Newtonsoft.Json.JsonProperty(PropertyName = "id")] public string Id {get; private set; } /// - /// Gets name of the resource + /// Gets the name of the resource /// [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name {get; private set; } /// - /// Gets type of the resource + /// Gets the type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// [Newtonsoft.Json.JsonProperty(PropertyName = "type")] public string Type {get; private set; } diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsAcknowledgeErrorDetails.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsAcknowledgeErrorDetails.cs new file mode 100644 index 000000000000..a0b461391f7f --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsAcknowledgeErrorDetails.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + using System.Linq; + + /// + /// An error response details received from the Azure Maintenance service for + /// each ScheduledEvents. + /// + public partial class ScheduledEventsAcknowledgeErrorDetails + { + /// + /// Initializes a new instance of the ScheduledEventsAcknowledgeErrorDetails class. + /// + public ScheduledEventsAcknowledgeErrorDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScheduledEventsAcknowledgeErrorDetails class. + /// + + /// ScheduledEvents Id. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000) + /// + + /// Status code for the ScheduledEvents acknowledge operation on the target + /// ScheduledEvents Id. + /// + + /// Human-readable representation of the error. + /// + public ScheduledEventsAcknowledgeErrorDetails(string target = default(string), string code = default(string), string message = default(string)) + + { + this.Target = target; + this.Code = code; + this.Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets scheduledEvents Id. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000) + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; set; } + + /// + /// Gets or sets status code for the ScheduledEvents acknowledge operation on + /// the target ScheduledEvents Id. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } + + /// + /// Gets or sets human-readable representation of the error. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsApproveResponse.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsApproveResponse.cs new file mode 100644 index 000000000000..13b3ee785153 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsApproveResponse.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + using System.Linq; + + /// + /// Response of ScheduledEvents acknowledge + /// + public partial class ScheduledEventsApproveResponse + { + /// + /// Initializes a new instance of the ScheduledEventsApproveResponse class. + /// + public ScheduledEventsApproveResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScheduledEventsApproveResponse class. + /// + + /// Successfully Approved + /// + public ScheduledEventsApproveResponse(string value = default(string)) + + { + this.Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets successfully Approved + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public string Value {get; set; } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsIdList.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsIdList.cs new file mode 100644 index 000000000000..8e438786dc53 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsIdList.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + using System.Linq; + + /// + /// ScheduledEvents Id List + /// + public partial class ScheduledEventsIdList + { + /// + /// Initializes a new instance of the ScheduledEventsIdList class. + /// + public ScheduledEventsIdList() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScheduledEventsIdList class. + /// + + /// The list of ScheduledEvents Id. + /// + public ScheduledEventsIdList(System.Collections.Generic.IList value) + + { + this.Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the list of ScheduledEvents Id. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "value")] + public System.Collections.Generic.IList Value {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (this.Value == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Value"); + } + + } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsListAcknowledgeError.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsListAcknowledgeError.cs new file mode 100644 index 000000000000..dcc45ef46481 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsListAcknowledgeError.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + using System.Linq; + + /// + /// An error response received from the Azure Maintenance service. + /// + public partial class ScheduledEventsListAcknowledgeError + { + /// + /// Initializes a new instance of the ScheduledEventsListAcknowledgeError class. + /// + public ScheduledEventsListAcknowledgeError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScheduledEventsListAcknowledgeError class. + /// + + /// Error response + /// + public ScheduledEventsListAcknowledgeError(ScheduledEventsListAcknowledgeErrorDetails error = default(ScheduledEventsListAcknowledgeErrorDetails)) + + { + this.Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets error response + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ScheduledEventsListAcknowledgeErrorDetails Error {get; set; } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsListAcknowledgeErrorDetails.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsListAcknowledgeErrorDetails.cs new file mode 100644 index 000000000000..cbcaea2b9d10 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsListAcknowledgeErrorDetails.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + using System.Linq; + + /// + /// An error response details received from the Azure Maintenance service. + /// + public partial class ScheduledEventsListAcknowledgeErrorDetails + { + /// + /// Initializes a new instance of the ScheduledEventsListAcknowledgeErrorDetails class. + /// + public ScheduledEventsListAcknowledgeErrorDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScheduledEventsListAcknowledgeErrorDetails class. + /// + + /// Service-defined error code. This code serves as a sub-status for the HTTP + /// error code specified in the response. + /// + + /// Human-readable representation of the error. + /// + + /// Error details for each ScheduledEvents. + /// + public ScheduledEventsListAcknowledgeErrorDetails(string code = default(string), string message = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList)) + + { + this.Code = code; + this.Message = message; + this.Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets service-defined error code. This code serves as a sub-status + /// for the HTTP error code specified in the response. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } + + /// + /// Gets or sets human-readable representation of the error. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } + + /// + /// Gets or sets error details for each ScheduledEvents. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; set; } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsListAcknowledgeErrorException.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsListAcknowledgeErrorException.cs new file mode 100644 index 000000000000..99555d0046c2 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/ScheduledEventsListAcknowledgeErrorException.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + + /// + /// Exception thrown for an invalid response with ScheduledEventsListAcknowledgeError information. + /// + public partial class ScheduledEventsListAcknowledgeErrorException : Microsoft.Rest.RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ScheduledEventsListAcknowledgeError Body { get; set; } + + /// + /// Initializes a new instance of the ScheduledEventsListAcknowledgeErrorException class. + /// + public ScheduledEventsListAcknowledgeErrorException() + { + } + + /// + /// Initializes a new instance of the ScheduledEventsListAcknowledgeError class. + /// + /// The exception message. + public ScheduledEventsListAcknowledgeErrorException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ScheduledEventsListAcknowledgeError class. + /// + /// The exception message. + /// Inner exception. + public ScheduledEventsListAcknowledgeErrorException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/UpdateProperties.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/UpdateProperties.cs new file mode 100644 index 000000000000..1fd5315d0122 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Models/UpdateProperties.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance.Models +{ + using System.Linq; + + /// + /// Properties for update + /// + public partial class UpdateProperties + { + /// + /// Initializes a new instance of the UpdateProperties class. + /// + public UpdateProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UpdateProperties class. + /// + + /// The resourceId + /// + public UpdateProperties(string resourceId = default(string)) + + { + this.ResourceId = resourceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the resourceId + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceId")] + public string ResourceId {get; set; } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/Operations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/Operations.cs index 5b167f9473f2..2b75d8792c93 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/Operations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/Operations.cs @@ -39,8 +39,7 @@ internal Operations (MaintenanceManagementClient client) public MaintenanceManagementClient Client { get; private set; } /// - /// List the available operations supported by the Microsoft.Maintenance - /// resource provider + /// List the operations for the provider /// /// /// Headers that will be added to request. @@ -63,7 +62,7 @@ internal Operations (MaintenanceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -184,7 +183,184 @@ internal Operations (MaintenanceManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// List the operations for the provider + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MaintenanceError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/OperationsExtensions.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/OperationsExtensions.cs index 3c3afd5886eb..689a95ad6703 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/OperationsExtensions.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/OperationsExtensions.cs @@ -13,20 +13,18 @@ namespace Microsoft.Azure.Management.Maintenance public static partial class OperationsExtensions { /// - /// List the available operations supported by the Microsoft.Maintenance - /// resource provider + /// List the operations for the provider /// /// /// The operations group for this extension method. /// - public static System.Collections.Generic.IEnumerable List(this IOperations operations) + public static Microsoft.Rest.Azure.IPage List(this IOperations operations) { return ((IOperations)operations).ListAsync().GetAwaiter().GetResult(); } /// - /// List the available operations supported by the Microsoft.Maintenance - /// resource provider + /// List the operations for the provider /// /// /// The operations group for this extension method. @@ -34,12 +32,45 @@ public static System.Collections.Generic.IEnumerable List(this IOpera /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// List the operations for the provider + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IOperations operations, string nextPageLink) + { + return ((IOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List the operations for the provider + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/PublicMaintenanceConfigurationsOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/PublicMaintenanceConfigurationsOperations.cs index d20ca913ba4e..edb51713dba3 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/PublicMaintenanceConfigurationsOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/PublicMaintenanceConfigurationsOperations.cs @@ -62,22 +62,18 @@ internal PublicMaintenanceConfigurationsOperations (MaintenanceManagementClient /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -94,7 +90,7 @@ internal PublicMaintenanceConfigurationsOperations (MaintenanceManagementClient var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) @@ -189,7 +185,7 @@ internal PublicMaintenanceConfigurationsOperations (MaintenanceManagementClient throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -230,7 +226,7 @@ internal PublicMaintenanceConfigurationsOperations (MaintenanceManagementClient /// Get Public Maintenance Configuration record /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// /// /// Headers that will be added to request. @@ -259,21 +255,17 @@ internal PublicMaintenanceConfigurationsOperations (MaintenanceManagementClient - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -291,7 +283,7 @@ internal PublicMaintenanceConfigurationsOperations (MaintenanceManagementClient var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/{resourceName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -423,6 +415,183 @@ internal PublicMaintenanceConfigurationsOperations (MaintenanceManagementClient + } + /// + /// Get Public Maintenance Configuration records + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MaintenanceError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + } } } \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/PublicMaintenanceConfigurationsOperationsExtensions.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/PublicMaintenanceConfigurationsOperationsExtensions.cs index f68c31fef4af..5d57398ccd9e 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/PublicMaintenanceConfigurationsOperationsExtensions.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/PublicMaintenanceConfigurationsOperationsExtensions.cs @@ -18,7 +18,7 @@ public static partial class PublicMaintenanceConfigurationsOperationsExtensions /// /// The operations group for this extension method. /// - public static System.Collections.Generic.IEnumerable List(this IPublicMaintenanceConfigurationsOperations operations) + public static Microsoft.Rest.Azure.IPage List(this IPublicMaintenanceConfigurationsOperations operations) { return ((IPublicMaintenanceConfigurationsOperations)operations).ListAsync().GetAwaiter().GetResult(); } @@ -32,7 +32,7 @@ public static System.Collections.Generic.IEnumerable L /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IPublicMaintenanceConfigurationsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IPublicMaintenanceConfigurationsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -46,7 +46,7 @@ public static System.Collections.Generic.IEnumerable L /// The operations group for this extension method. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// public static MaintenanceConfiguration Get(this IPublicMaintenanceConfigurationsOperations operations, string resourceName) { @@ -60,7 +60,7 @@ public static MaintenanceConfiguration Get(this IPublicMaintenanceConfigurations /// The operations group for this extension method. /// /// - /// Maintenance Configuration Name + /// The name of the MaintenanceConfiguration /// /// /// The cancellation token. @@ -72,5 +72,38 @@ public static MaintenanceConfiguration Get(this IPublicMaintenanceConfigurations return _result.Body; } } + /// + /// Get Public Maintenance Configuration records + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IPublicMaintenanceConfigurationsOperations operations, string nextPageLink) + { + return ((IPublicMaintenanceConfigurationsOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get Public Maintenance Configuration records + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IPublicMaintenanceConfigurationsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/ScheduledEventsOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/ScheduledEventsOperations.cs new file mode 100644 index 000000000000..46a232023c27 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/ScheduledEventsOperations.cs @@ -0,0 +1,516 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.Maintenance +{ + using System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// ScheduledEventsOperations operations. + /// + internal partial class ScheduledEventsOperations : Microsoft.Rest.IServiceOperations, IScheduledEventsOperations + { + /// + /// Initializes a new instance of the ScheduledEventsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ScheduledEventsOperations (MaintenanceManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the MaintenanceManagementClient + /// + public MaintenanceManagementClient Client { get; private set; } + + /// + /// Post List of ScheduledEvents Acknowledgement + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Resource type + /// + /// + /// Resource name + /// + /// + /// The list of ScheduledEvents Id. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task> AcknowledgeListWithHttpMessagesAsync(string resourceGroupName, string resourceType, string resourceName, System.Collections.Generic.IList value, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (resourceType == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceType"); + } + + if (resourceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); + } + + ScheduledEventsIdList scheduledEventsIdList = new ScheduledEventsIdList(); + if(value != null) + { + scheduledEventsIdList.Value = value; + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceType", resourceType); + tracingParameters.Add("resourceName", resourceName); + + tracingParameters.Add("scheduledEventsIdList", scheduledEventsIdList); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "AcknowledgeList", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/scheduledevents").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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(scheduledEventsIdList != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(scheduledEventsIdList, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new ScheduledEventsListAcknowledgeErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ScheduledEventsListAcknowledgeError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Post ScheduledEvents Acknowledgement + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Resource type + /// + /// + /// Resource Name + /// + /// + /// ScheduledEvents Id. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000) + /// + /// + /// 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 System.Threading.Tasks.Task> AcknowledgeWithHttpMessagesAsync(string resourceGroupName, string resourceType, string resourceName, string scheduledEventId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (resourceType == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceType"); + } + + if (resourceName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); + } + + if (scheduledEventId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "scheduledEventId"); + } + + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceType", resourceType); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("scheduledEventId", scheduledEventId); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Acknowledge", tracingParameters); + } + // Construct URL + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Compute/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/scheduledevents/{scheduledEventId}/acknowledge").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{scheduledEventId}", System.Uri.EscapeDataString(scheduledEventId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MaintenanceError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/ScheduledEventsOperationsExtensions.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/ScheduledEventsOperationsExtensions.cs new file mode 100644 index 000000000000..1b07a31eb869 --- /dev/null +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/ScheduledEventsOperationsExtensions.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +namespace Microsoft.Azure.Management.Maintenance +{ + using Microsoft.Rest.Azure; + using Models; + + /// + /// Extension methods for ScheduledEventsOperations + /// + public static partial class ScheduledEventsOperationsExtensions + { + /// + /// Post List of ScheduledEvents Acknowledgement + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Resource type + /// + /// + /// Resource name + /// + public static ScheduledEventsApproveResponse AcknowledgeList(this IScheduledEventsOperations operations, string resourceGroupName, string resourceType, string resourceName, System.Collections.Generic.IList value) + { + return ((IScheduledEventsOperations)operations).AcknowledgeListAsync(resourceGroupName, resourceType, resourceName, value).GetAwaiter().GetResult(); + } + + /// + /// Post List of ScheduledEvents Acknowledgement + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Resource type + /// + /// + /// Resource name + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task AcknowledgeListAsync(this IScheduledEventsOperations operations, string resourceGroupName, string resourceType, string resourceName, System.Collections.Generic.IList value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.AcknowledgeListWithHttpMessagesAsync(resourceGroupName, resourceType, resourceName, value, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Post ScheduledEvents Acknowledgement + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Resource type + /// + /// + /// Resource Name + /// + /// + /// ScheduledEvents Id. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000) + /// + public static ScheduledEventsApproveResponse Acknowledge(this IScheduledEventsOperations operations, string resourceGroupName, string resourceType, string resourceName, string scheduledEventId) + { + return ((IScheduledEventsOperations)operations).AcknowledgeAsync(resourceGroupName, resourceType, resourceName, scheduledEventId).GetAwaiter().GetResult(); + } + + /// + /// Post ScheduledEvents Acknowledgement + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// Resource type + /// + /// + /// Resource Name + /// + /// + /// ScheduledEvents Id. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000) + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task AcknowledgeAsync(this IScheduledEventsOperations operations, string resourceGroupName, string resourceType, string resourceName, string scheduledEventId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.AcknowledgeWithHttpMessagesAsync(resourceGroupName, resourceType, resourceName, scheduledEventId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/UpdatesOperations.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/UpdatesOperations.cs index 66be38573989..ea6e5c3978a5 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/UpdatesOperations.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/UpdatesOperations.cs @@ -42,7 +42,7 @@ internal UpdatesOperations (MaintenanceManagementClient client) /// Get updates to resources. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -80,22 +80,33 @@ internal UpdatesOperations (MaintenanceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListParentWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (providerName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); @@ -121,11 +132,6 @@ internal UpdatesOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -148,7 +154,7 @@ internal UpdatesOperations (MaintenanceManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/updates").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceParentType}", System.Uri.EscapeDataString(resourceParentType)); @@ -249,7 +255,7 @@ internal UpdatesOperations (MaintenanceManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -290,7 +296,7 @@ internal UpdatesOperations (MaintenanceManagementClient client) /// Get updates to resources. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -322,22 +328,33 @@ internal UpdatesOperations (MaintenanceManagementClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string providerName, string resourceType, string resourceName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (this.Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } + if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (providerName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "providerName"); @@ -353,11 +370,6 @@ internal UpdatesOperations (MaintenanceManagementClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -378,7 +390,7 @@ internal UpdatesOperations (MaintenanceManagementClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/updates").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(this.Client.SubscriptionId, this.Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{providerName}", System.Uri.EscapeDataString(providerName)); _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); @@ -477,7 +489,361 @@ internal UpdatesOperations (MaintenanceManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Get updates to resources. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListParentNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListParentNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MaintenanceError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Get updates to resources. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new MaintenanceErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + MaintenanceError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; diff --git a/src/Maintenance/Maintenance.Management.Sdk/Generated/UpdatesOperationsExtensions.cs b/src/Maintenance/Maintenance.Management.Sdk/Generated/UpdatesOperationsExtensions.cs index 920cfaad2613..5845a86df4c3 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/Generated/UpdatesOperationsExtensions.cs +++ b/src/Maintenance/Maintenance.Management.Sdk/Generated/UpdatesOperationsExtensions.cs @@ -19,7 +19,7 @@ public static partial class UpdatesOperationsExtensions /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -36,7 +36,7 @@ public static partial class UpdatesOperationsExtensions /// /// Resource identifier /// - public static System.Collections.Generic.IEnumerable ListParent(this IUpdatesOperations operations, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName) + public static Microsoft.Rest.Azure.IPage ListParent(this IUpdatesOperations operations, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName) { return ((IUpdatesOperations)operations).ListParentAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName).GetAwaiter().GetResult(); } @@ -48,7 +48,7 @@ public static System.Collections.Generic.IEnumerable ListParent(this IUp /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -68,7 +68,7 @@ public static System.Collections.Generic.IEnumerable ListParent(this IUp /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListParentAsync(this IUpdatesOperations operations, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListParentAsync(this IUpdatesOperations operations, string resourceGroupName, string providerName, string resourceParentType, string resourceParentName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListParentWithHttpMessagesAsync(resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, null, cancellationToken).ConfigureAwait(false)) { @@ -82,7 +82,7 @@ public static System.Collections.Generic.IEnumerable ListParent(this IUp /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -93,7 +93,7 @@ public static System.Collections.Generic.IEnumerable ListParent(this IUp /// /// Resource identifier /// - public static System.Collections.Generic.IEnumerable List(this IUpdatesOperations operations, string resourceGroupName, string providerName, string resourceType, string resourceName) + public static Microsoft.Rest.Azure.IPage List(this IUpdatesOperations operations, string resourceGroupName, string providerName, string resourceType, string resourceName) { return ((IUpdatesOperations)operations).ListAsync(resourceGroupName, providerName, resourceType, resourceName).GetAwaiter().GetResult(); } @@ -105,7 +105,7 @@ public static System.Collections.Generic.IEnumerable List(this IUpdatesO /// The operations group for this extension method. /// /// - /// Resource group name + /// The name of the resource group. The name is case insensitive. /// /// /// Resource provider name @@ -119,12 +119,78 @@ public static System.Collections.Generic.IEnumerable List(this IUpdatesO /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IUpdatesOperations operations, string resourceGroupName, string providerName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IUpdatesOperations operations, string resourceGroupName, string providerName, string resourceType, string resourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, providerName, resourceType, resourceName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } + /// + /// Get updates to resources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListParentNext(this IUpdatesOperations operations, string nextPageLink) + { + return ((IUpdatesOperations)operations).ListParentNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get updates to resources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListParentNextAsync(this IUpdatesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListParentNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Get updates to resources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IUpdatesOperations operations, string nextPageLink) + { + return ((IUpdatesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Get updates to resources. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IUpdatesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } } } diff --git a/src/Maintenance/Maintenance.Management.Sdk/README.md b/src/Maintenance/Maintenance.Management.Sdk/README.md index 24ffa0de4241..bc572faeaa77 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/README.md +++ b/src/Maintenance/Maintenance.Management.Sdk/README.md @@ -25,9 +25,9 @@ payload-flattening-threshold: 2 ### ``` yaml -commit: fa64058384cb457552f54428f32667d384b794d4 +commit: 45b9a465ba8a14a7657adff55146893e46fb1cd2 input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2023-09-01-preview/Maintenance.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/maintenance/resource-manager/Microsoft.Maintenance/Maintenance/preview/2025-10-01-preview/Maintenance.json output-folder: Generated From 625ba093bf1c1990eb349f651625067c97cf0261 Mon Sep 17 00:00:00 2001 From: rbandi124 <143381870+rbandi124@users.noreply.github.com> Date: Thu, 25 Jun 2026 19:26:03 -0700 Subject: [PATCH 2/3] create cmdlets --- .../Maintenance.Management.Sdk/README.md | 2 +- .../MaintenanceAutomationBaseCmdlet.cs | 8 ++ .../Models/MaintenanceAutoMapperProfile.cs | 4 + .../PSScheduledEventsApproveResponse.cs | 23 +++++ .../ScheduledEventsAcknowledgeMethod.cs | 83 +++++++++++++++++++ .../ScheduledEventsListAcknowledgeMethod.cs | 83 +++++++++++++++++++ 6 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 src/Maintenance/Maintenance/Models/PSScheduledEventsApproveResponse.cs create mode 100644 src/Maintenance/Maintenance/ScheduledEvents/ScheduledEventsAcknowledgeMethod.cs create mode 100644 src/Maintenance/Maintenance/ScheduledEvents/ScheduledEventsListAcknowledgeMethod.cs diff --git a/src/Maintenance/Maintenance.Management.Sdk/README.md b/src/Maintenance/Maintenance.Management.Sdk/README.md index bc572faeaa77..81eb3bd05fa6 100644 --- a/src/Maintenance/Maintenance.Management.Sdk/README.md +++ b/src/Maintenance/Maintenance.Management.Sdk/README.md @@ -25,7 +25,7 @@ payload-flattening-threshold: 2 ### ``` yaml -commit: 45b9a465ba8a14a7657adff55146893e46fb1cd2 +commit: f4eee8aea9ad8cf95d8070c62711c0a344bda58c input-file: - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/maintenance/resource-manager/Microsoft.Maintenance/Maintenance/preview/2025-10-01-preview/Maintenance.json diff --git a/src/Maintenance/Maintenance/MaintenanceAutomationBaseCmdlet.cs b/src/Maintenance/Maintenance/MaintenanceAutomationBaseCmdlet.cs index dee783376554..6cf6e5f6e1e9 100644 --- a/src/Maintenance/Maintenance/MaintenanceAutomationBaseCmdlet.cs +++ b/src/Maintenance/Maintenance/MaintenanceAutomationBaseCmdlet.cs @@ -131,6 +131,14 @@ public IUpdatesOperations UpdatesClient } } + public IScheduledEventsOperations ScheduledEventsClient + { + get + { + return MaintenanceClient.MaintenanceManagementClient.ScheduledEvents; + } + } + public static string FormatObject(Object obj) { var objType = obj.GetType(); diff --git a/src/Maintenance/Maintenance/Models/MaintenanceAutoMapperProfile.cs b/src/Maintenance/Maintenance/Models/MaintenanceAutoMapperProfile.cs index 53b5d37a3f35..18ff94f3c8f0 100644 --- a/src/Maintenance/Maintenance/Models/MaintenanceAutoMapperProfile.cs +++ b/src/Maintenance/Maintenance/Models/MaintenanceAutoMapperProfile.cs @@ -57,6 +57,10 @@ private static void Initialize() cfg.CreateMap() .ForMember(dest => dest.Status, src => src.MapFrom(o => o.Status)) .ForMember(src => src.SystemData, s => s.Ignore()); + cfg.CreateMap() + .ForMember(dest => dest.Value, src => src.MapFrom(o => o.Value)); + cfg.CreateMap() + .ForMember(dest => dest.Value, src => src.MapFrom(o => o.Value)); cfg.CreateMap() .ForMember(dest => dest.FilterResourceGroup, src => src.MapFrom(o => o.Filter.ResourceGroups)) .ForMember(dest => dest.FilterLocation, src => src.MapFrom(o => o.Filter.Locations)) diff --git a/src/Maintenance/Maintenance/Models/PSScheduledEventsApproveResponse.cs b/src/Maintenance/Maintenance/Models/PSScheduledEventsApproveResponse.cs new file mode 100644 index 000000000000..fafd467c49cd --- /dev/null +++ b/src/Maintenance/Maintenance/Models/PSScheduledEventsApproveResponse.cs @@ -0,0 +1,23 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using System.Collections.Generic; + +namespace Microsoft.Azure.Commands.Maintenance.Models +{ + public partial class PSScheduledEventsApproveResponse + { + public List Value { get; set; } + } +} diff --git a/src/Maintenance/Maintenance/ScheduledEvents/ScheduledEventsAcknowledgeMethod.cs b/src/Maintenance/Maintenance/ScheduledEvents/ScheduledEventsAcknowledgeMethod.cs new file mode 100644 index 000000000000..ec59baa53d66 --- /dev/null +++ b/src/Maintenance/Maintenance/ScheduledEvents/ScheduledEventsAcknowledgeMethod.cs @@ -0,0 +1,83 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Commands.Maintenance.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Management.Maintenance; +using Microsoft.Azure.Management.Maintenance.Models; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.Commands.Maintenance +{ + [Cmdlet(VerbsCommon.Set, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ScheduledEvents", DefaultParameterSetName = "DefaultParameter", SupportsShouldProcess = true)] + [OutputType(typeof(ScheduledEventsApproveResponse))] + public partial class NewAzureRmScheduledEvents : MaintenanceAutomationBaseCmdlet + { + public override void ExecuteCmdlet() + { + base.ExecuteCmdlet(); + ExecuteClientAction(() => + { + if (ShouldProcess("default", VerbsCommon.New)) + { + string resourceGroupName = this.ResourceGroupName; + string resourceType = this.ResourceType; + string resourceName = this.ResourceName; + string ScheduledEventsId = this.ScheduledEventsId; + ScheduledEventsApproveResponse response; + response = ScheduledEventsClient.Acknowledge(resourceGroupName, resourceType, resourceName, ScheduledEventsId); + var psObject = new PSScheduledEventsApproveResponse(); + MaintenanceAutomationAutoMapperProfile.Mapper.Map(response, psObject); + WriteObject(psObject); + } + }); + } + + [Parameter( + ParameterSetName = "DefaultParameter", + Position = 0, + Mandatory = true, + HelpMessage = "The resource Group Name.", + ValueFromPipelineByPropertyName = true)] + [ResourceGroupCompleter] + public string ResourceGroupName { get; set; } + + [Parameter( + ParameterSetName = "DefaultParameter", + Position = 2, + Mandatory = true, + HelpMessage = "The resource type.", + ValueFromPipelineByPropertyName = true)] + public string ResourceType { get; set; } + + [Parameter( + ParameterSetName = "DefaultParameter", + Position = 3, + Mandatory = true, + HelpMessage = "The resource name.", + ValueFromPipelineByPropertyName = true)] + public string ResourceName { get; set; } + + [Parameter( + ParameterSetName = "DefaultParameter", + Mandatory = true, + HelpMessage = "The ScheduledEvents Id", + ValueFromPipelineByPropertyName = true)] + public string ScheduledEventsId { get; set; } + } +} \ No newline at end of file diff --git a/src/Maintenance/Maintenance/ScheduledEvents/ScheduledEventsListAcknowledgeMethod.cs b/src/Maintenance/Maintenance/ScheduledEvents/ScheduledEventsListAcknowledgeMethod.cs new file mode 100644 index 000000000000..8c349583d406 --- /dev/null +++ b/src/Maintenance/Maintenance/ScheduledEvents/ScheduledEventsListAcknowledgeMethod.cs @@ -0,0 +1,83 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Commands.Maintenance.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Management.Maintenance; +using Microsoft.Azure.Management.Maintenance.Models; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.Commands.Maintenance +{ + [Cmdlet(VerbsCommon.Set, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ScheduledEventsList", DefaultParameterSetName = "DefaultParameter", SupportsShouldProcess = true)] + [OutputType(typeof(ScheduledEventsApproveResponse))] + public partial class NewAzureRmScheduledEventsList : MaintenanceAutomationBaseCmdlet + { + public override void ExecuteCmdlet() + { + base.ExecuteCmdlet(); + ExecuteClientAction(() => + { + if (ShouldProcess("default", VerbsCommon.New)) + { + string resourceGroupName = this.ResourceGroupName; + string resourceType = this.ResourceType; + string resourceName = this.ResourceName; + string[] ScheduledEventsId = this.ScheduledEventsId; + ScheduledEventsApproveResponse response; + response = ScheduledEventsClient.AcknowledgeList(resourceGroupName, resourceType, resourceName, ScheduledEventsId); + var psObject = new PSScheduledEventsApproveResponse(); + MaintenanceAutomationAutoMapperProfile.Mapper.Map(response, psObject); + WriteObject(psObject); + } + }); + } + + [Parameter( + ParameterSetName = "DefaultParameter", + Position = 0, + Mandatory = true, + HelpMessage = "The resource Group Name.", + ValueFromPipelineByPropertyName = true)] + [ResourceGroupCompleter] + public string ResourceGroupName { get; set; } + + [Parameter( + ParameterSetName = "DefaultParameter", + Position = 2, + Mandatory = true, + HelpMessage = "The resource type.", + ValueFromPipelineByPropertyName = true)] + public string ResourceType { get; set; } + + [Parameter( + ParameterSetName = "DefaultParameter", + Position = 3, + Mandatory = true, + HelpMessage = "The resource name.", + ValueFromPipelineByPropertyName = true)] + public string ResourceName { get; set; } + + [Parameter( + ParameterSetName = "DefaultParameter", + Mandatory = true, + HelpMessage = "The list of ScheduledEvents Ids.", + ValueFromPipelineByPropertyName = true)] + public string[] ScheduledEventsId { get; set; } + } +} \ No newline at end of file From 48c1daa49a110cb7f4b3c0034b1b247acbc065f3 Mon Sep 17 00:00:00 2001 From: rbandi124 <143381870+rbandi124@users.noreply.github.com> Date: Thu, 25 Jun 2026 23:03:06 -0700 Subject: [PATCH 3/3] generate help for cmdlets --- .../Maintenance/Az.Maintenance.psd1 | 1 + src/Maintenance/Maintenance/ChangeLog.md | 3 + .../PSScheduledEventsApproveResponse.cs | 2 +- .../Maintenance/help/Az.Maintenance.md | 6 + .../Maintenance/help/Set-AzScheduledEvents.md | 147 +++++++++++++++++ .../help/Set-AzScheduledEventsList.md | 149 ++++++++++++++++++ .../help/Update-AzMaintenanceConfiguration.md | 64 ++++++-- 7 files changed, 362 insertions(+), 10 deletions(-) create mode 100644 src/Maintenance/Maintenance/help/Set-AzScheduledEvents.md create mode 100644 src/Maintenance/Maintenance/help/Set-AzScheduledEventsList.md diff --git a/src/Maintenance/Maintenance/Az.Maintenance.psd1 b/src/Maintenance/Maintenance/Az.Maintenance.psd1 index 4c9a7588a911..01e305238168 100644 --- a/src/Maintenance/Maintenance/Az.Maintenance.psd1 +++ b/src/Maintenance/Maintenance/Az.Maintenance.psd1 @@ -82,6 +82,7 @@ CmdletsToExport = 'Get-AzApplyUpdate', 'Get-AzConfigurationAssignment', 'New-AzMaintenanceConfiguration', 'Remove-AzConfigurationAssignment', 'Remove-AzMaintenanceConfiguration', + 'Set-AzScheduledEvents', 'Set-AzScheduledEventsList', 'Update-AzMaintenanceConfiguration' # Variables to export from this module diff --git a/src/Maintenance/Maintenance/ChangeLog.md b/src/Maintenance/Maintenance/ChangeLog.md index dde91c2d97e8..8ee20eebe189 100644 --- a/src/Maintenance/Maintenance/ChangeLog.md +++ b/src/Maintenance/Maintenance/ChangeLog.md @@ -20,6 +20,9 @@ ## Upcoming Release +## Version 1.7.0 +* Added support to acknowledge ScheduledEvents + ## Version 1.6.0 * Added ChangeSafety Support diff --git a/src/Maintenance/Maintenance/Models/PSScheduledEventsApproveResponse.cs b/src/Maintenance/Maintenance/Models/PSScheduledEventsApproveResponse.cs index fafd467c49cd..ea748876e347 100644 --- a/src/Maintenance/Maintenance/Models/PSScheduledEventsApproveResponse.cs +++ b/src/Maintenance/Maintenance/Models/PSScheduledEventsApproveResponse.cs @@ -18,6 +18,6 @@ namespace Microsoft.Azure.Commands.Maintenance.Models { public partial class PSScheduledEventsApproveResponse { - public List Value { get; set; } + public string Value { get; set; } } } diff --git a/src/Maintenance/Maintenance/help/Az.Maintenance.md b/src/Maintenance/Maintenance/help/Az.Maintenance.md index a6fc7094dd11..168f538bd790 100644 --- a/src/Maintenance/Maintenance/help/Az.Maintenance.md +++ b/src/Maintenance/Maintenance/help/Az.Maintenance.md @@ -41,6 +41,12 @@ Unregister configuration for resource. ### [Remove-AzMaintenanceConfiguration](Remove-AzMaintenanceConfiguration.md) Delete Configuration record +### [Set-AzScheduledEvents](Set-AzScheduledEvents.md) +Acknowledge ScheduledEvents Id + +### [Set-AzScheduledEventsList](Set-AzScheduledEventsList.md) +Acknolwedge list of ScheduledEvents Id + ### [Update-AzMaintenanceConfiguration](Update-AzMaintenanceConfiguration.md) Patch configuration record diff --git a/src/Maintenance/Maintenance/help/Set-AzScheduledEvents.md b/src/Maintenance/Maintenance/help/Set-AzScheduledEvents.md new file mode 100644 index 000000000000..2f3eb4f82f24 --- /dev/null +++ b/src/Maintenance/Maintenance/help/Set-AzScheduledEvents.md @@ -0,0 +1,147 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Maintenance.dll-Help.xml +Module Name: Az.Maintenance +online version: +schema: 2.0.0 +--- + +# Set-AzScheduledEvents + +## SYNOPSIS + +Acknowledge ScheduledEvents of a resource + +## SYNTAX + +```powershell +Set-AzScheduledEvents [-ResourceGroupName] [-ResourceType] [-ResourceName] + -ScheduledEventsId [-DefaultProfile ] [] +``` + +## DESCRIPTION + +Acknowledge ScheduledEvents of a resource. Supported resources types are VirtualMachines, VirtualMachineScaleSets, AvailabilitySets. + +## EXAMPLES + +### Example 1 + +```powershell +Set-AzScheduledEvents -ResourceGroupName testrg -ResourceType virtualMachines -ResourceName testvm -ScheduledEventsId F1574F0D-2CFC-4F5A-8C0E-F84FF8776F93 +``` + +Acknowledge ScheduledEvents job of a VirtualMachine + +### Example 2 + +```powershell +Set-AzScheduledEvents -ResourceGroupName testrg -ResourceType virtualMachineScaleSets -ResourceName testvmss -ScheduledEventsId F1574F0D-2CFC-4F5A-8C0E-F84FF8776F93 +``` + +Acknowledge ScheduledEvents job of a VirtualMachineScaleSet + +### Example 3 + +```powershell +Set-AzScheduledEvents -ResourceGroupName testrg -ResourceType AvailabilitySets -ResourceName testavset -ScheduledEventsId F1574F0D-2CFC-4F5A-8C0E-F84FF8776F93 +``` + +Acknowledge ScheduledEvents job of a AvailabilitySet + +## PARAMETERS + +### -DefaultProfile + +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName + +The resource Group Name. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ResourceName + +The resource name. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ResourceType + +The resource type. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ScheduledEventsId + +The ScheduledEvents Id + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Management.Maintenance.Models.ScheduledEventsApproveResponse + +## NOTES + +## RELATED LINKS diff --git a/src/Maintenance/Maintenance/help/Set-AzScheduledEventsList.md b/src/Maintenance/Maintenance/help/Set-AzScheduledEventsList.md new file mode 100644 index 000000000000..8ef81f666c21 --- /dev/null +++ b/src/Maintenance/Maintenance/help/Set-AzScheduledEventsList.md @@ -0,0 +1,149 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Maintenance.dll-Help.xml +Module Name: Az.Maintenance +online version: +schema: 2.0.0 +--- + +# Set-AzScheduledEventsList + +## SYNOPSIS + +Acknowledge list of ScheduledEvents of a resource + +## SYNTAX + +```powershell +Set-AzScheduledEventsList [-ResourceGroupName] [-ResourceType] [-ResourceName] + -ScheduledEventsId [-DefaultProfile ] [] +``` + +## DESCRIPTION + +Acknowledge list of ScheduledEvents of a resource. Supported resources types are VirtualMachines, VirtualMachineScaleSets, AvailabilitySets. + +## EXAMPLES + +### Example 1 + +```powershell +Set-AzScheduledEventsList -ResourceGroupName testrg -ResourceType virtualMachines -ResourceName testvm -ScheduledEventsId F1574F0D-2CFC-4F5A-8C0E-F84FF8776F93 +``` + +Acknowledge ScheduledEvents job of a VirtualMachine + +### Example 2 + +```powershell +Set-AzScheduledEventsList -ResourceGroupName testrg -ResourceType virtualMachineScaleSets -ResourceName testvmss -ScheduledEventsId F1574F0D-2CFC-4F5A-8C0E-F84FF8776F93,CCB334AE-7404-4DE9-A7A8-54B7DB69B566 +``` + +Acknowledge list of ScheduledEvents job of a VirtualMachineScaleSet + +### Example 3 + +```powershell +Set-AzScheduledEventsList -ResourceGroupName testrg -ResourceType AvailabilitySets -ResourceName testavset -ScheduledEventsId F1574F0D-2CFC-4F5A-8C0E-F84FF8776F93,CCB334AE-7404-4DE9-A7A8-54B7DB69B566 +``` + +Acknowledge list ScheduledEvents job of a AvailabilitySet + +## PARAMETERS + +### -DefaultProfile + +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName + +The resource Group Name. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ResourceName + +The resource name. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ResourceType + +The resource type. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ScheduledEventsId + +The list of ScheduledEvents Ids. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters + +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +### System.String[] + +## OUTPUTS + +### Microsoft.Azure.Management.Maintenance.Models.ScheduledEventsApproveResponse + +## NOTES + +## RELATED LINKS diff --git a/src/Maintenance/Maintenance/help/Update-AzMaintenanceConfiguration.md b/src/Maintenance/Maintenance/help/Update-AzMaintenanceConfiguration.md index 7154f57b1545..45c32524dbf9 100644 --- a/src/Maintenance/Maintenance/help/Update-AzMaintenanceConfiguration.md +++ b/src/Maintenance/Maintenance/help/Update-AzMaintenanceConfiguration.md @@ -14,8 +14,9 @@ Patch configuration record ``` Update-AzMaintenanceConfiguration [-ResourceGroupName] [-Name] - [-Configuration] [-AsJob] [-DefaultProfile ] [-WhatIf] - [-Confirm] [] + [-Configuration] [-AsJob] [-DefaultProfile ] + [-ProgressAction ] [-WhatIf] [-Confirm] [-AcquirePolicyToken] [-ChangeReference ] + [] ``` ## DESCRIPTION @@ -42,11 +43,41 @@ Patch maintenance configuration record ## PARAMETERS +### -AcquirePolicyToken +Acquire an Azure Policy token automatically for this resource operation. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -AsJob Run cmdlet in the background ```yaml -Type: System.Management.Automation.SwitchParameter +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ChangeReference +The change reference resource ID for this resource operation. + +```yaml +Type: String Parameter Sets: (All) Aliases: @@ -61,7 +92,7 @@ Accept wildcard characters: False The maintenance configuration to be updated. ```yaml -Type: Microsoft.Azure.Commands.Maintenance.Models.PSMaintenanceConfiguration +Type: PSMaintenanceConfiguration Parameter Sets: (All) Aliases: @@ -76,7 +107,7 @@ Accept wildcard characters: False The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Type: IAzureContextContainer Parameter Sets: (All) Aliases: AzContext, AzureRmContext, AzureCredential @@ -91,7 +122,7 @@ Accept wildcard characters: False The maintenance configuration Name. ```yaml -Type: System.String +Type: String Parameter Sets: (All) Aliases: @@ -102,11 +133,26 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -ProgressAction +{{ Fill ProgressAction Description }} + +```yaml +Type: ActionPreference +Parameter Sets: (All) +Aliases: proga + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ResourceGroupName The resource Group Name. ```yaml -Type: System.String +Type: String Parameter Sets: (All) Aliases: @@ -121,7 +167,7 @@ Accept wildcard characters: False Prompts you for confirmation before running the cmdlet. ```yaml -Type: System.Management.Automation.SwitchParameter +Type: SwitchParameter Parameter Sets: (All) Aliases: cf @@ -137,7 +183,7 @@ Shows what would happen if the cmdlet runs. The cmdlet is not run. ```yaml -Type: System.Management.Automation.SwitchParameter +Type: SwitchParameter Parameter Sets: (All) Aliases: wi